Gradual Movement

This forum is currently in read-only mode.
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Is there any way to make a physics object just gradually move, say i wanted a platform to slide to the right then back again and loop, is this possible, so far all i can make something do is teleport, not gradually move.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The only way you can move physics objects properly, is to apply physics forces to them. If you do things, like set angle, or X and Y positions, it can do some weird stuff.

    To make a platform slide, you would have to apply force in the desired direction. You may even have to make some invisible "tracks" with invisible "bump-stops" at each end to stop it from moving too far, messing up, and falling off the end.

    If you have trouble with this, let me know... I can make a quick example as to how this would work in finer detail.

    Make note, you may also need to play with settings like friction and elasticity in order to get things to work the way you want.

    ~Sol

  • Ok thanks man will try this, what about non-physics objects? Is there a good way to do this? In MMF2 I have a setting where I have an object with a bouncing ball movement which is stopped at the start of frame, the object follows a path which goes round in a circle, when another object collides with it it starts the bouncing ball movement and the object floats away nicely. Am trying to reproduce this but am having trouble with it.

    The only way you can move physics objects properly, is to apply physics forces to them. If you do things, like set angle, or X and Y positions, it can do some weird stuff.

    To make a platform slide, you would have to apply force in the desired direction. You may even have to make some invisible "tracks" with invisible "bump-stops" at each end to stop it from moving too far, messing up, and falling off the end.

    If you have trouble with this, let me know... I can make a quick example as to how this would work in finer detail.

    Make note, you may also need to play with settings like friction and elasticity in order to get things to work the way you want.

    ~Sol

  • Ok thanks man will try this, what about non-physics objects? Is there a good way to do this? In MMF2 I have a setting where I have an object with a bouncing ball movement which is stopped at the start of frame, the object follows a path which goes round in a circle, when another object collides with it it starts the bouncing ball movement and the object floats away nicely. Am trying to reproduce this but am having trouble with it.

    Path movement is yet to be added to Construct, but it's happening sooner or later. What you have described above is completely possible with construct, though a path movement behaviour would make things a little easier...

    You would have to (without using a lot of math):

    1. create a sprite that is long and thin, like string. set the hotspot to one end and the action point to the other end

    2. rotate the object using an event "always > rotate clockwise"

    3. create your "ball" object, tell it to stick to the action point of the "string". Give this "ball" object either the bullet or ball behaviour.

    4. if the "ball" is touched, destroy the string and set the behaviour ot accelerate the "ball" away.

    Now, there are 101 ways of doing that... if you are good at math, you can try something like: (Thanks to Ashley for this next bit)

    To rotate an object A degrees around point P:

    Set 'distance' to distance(Object.X, Object.Y, P.X, P.Y)

    Set 'angle' to angle(Object.X, Object.Y, P.X, P.Y)

    Set X to P.X + cos(angle + A) * distance

    Set Y to P.Y + sin(angle + A) * distance

    Then you can use some more fancy math to make your object fly away on contact with something else...

    There is no instant answer, since Construct is more powerful than MMF, there are so many ways to do the same thing... really it comes down to creative thinking and logic/puzzle solving. If you can think of a way it would work, chances are you can make it happen.

    For pathing, you could even create several "points" objects that your "ball" follows... going to the first point, then the nest, then the next etc.

    Let me know if any of that needs to be explained further... always glad to help.

    ~Sol

  • If you need a physics object to interact with an object controlled in some other way, set that one to "inmovable". Then you move it by other means, and physics objects will react to it (although somewhat improperly because of speed and acceleration info discrepancies)

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