Manual movement and rotation like a factory belt

0 favourites
  • 5 posts
From the Asset Store
Strange factory themed set of tiles for your platformer game
  • Hey,

    I'm trying to make an object move in a predetermined path, going in a straight line first, then rotating until it is completely inverted, then proceeding straight and finally rotating back to normal and continuing the loop.

    I tried doing this with overlap checks, custom movement, and other things but none work perfectly and it almost always moves out of the intended path after a while.

    I'm going for something like this. When the rod reaches the right edge, it collects a bubble, and when it reaches the left, the bubble bursts as it rotates back to normal.

    Here's a crude reference pic.

    <img src="http://s18.postimg.org/vc7et53t5/referencev2.png" border="0" />

    Thanks! :)

  • What I think you need are objects on the end of the belt, when the blue object hits those then you would get the blue object to rotate.

    My advice code wise would be to do this:

    • If object is colliding with Turning Point

    -- Stop object

    -- Rotate object by 2 degrees

    -- Once object is at the right angle, let it carry on moving again

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Okay I put together a little example of what I was talking about.

    mediafire.com

    This of course doesn't solve the problem of having it turn around a particular point. One way I can think of getting around it is having one object on the ground and the other object in the air at a specific distance away, so you would rotate the object in the air, rather than the entire object itself.

  • What I think you need are objects on the end of the belt, when the blue object hits those then you would get the blue object to rotate.

    My advice code wise would be to do this:

    - If object is colliding with Turning Point

    -- Stop object

    -- Rotate object by 2 degrees

    -- Once object is at the right angle, let it carry on moving again

    I have it working in one direction using rotate x towards y degrees. However, it just encounters my 2nd sensor object and then just goes ahead without rotating.

    dropbox.com/sh/py6arnkalgcgdvb/3jnInlg6fR

  • Well after working on it a bit more, I solved it with instance variables n some experimenting.

    Thanks a bunch for the 'Stop' suggestion tho! :) That's what got my thing started :P

    dropbox.com/s/v1u60tjiljnqqrk/belt%20bubble%20holder.capx

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)