Moving the player with moving platform whilst jumping

0 favourites
  • 3 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • I'm halfway to getting this to work, but it's still not 100% working.

    Basically I want the player to move with a horizontal moving platform, whilst the player jumps on the platform. If you jump on a moving platform with the platform behavior, the player sticks to it and can move about no problem, but if you jump, then the player goes flying back, as they're no longer moving with the platform.

    Right now I have it to set the X vector of the platform behavior to itself, if the player doesn't press any button whilst jumping. Then to allow the player to move around whilst they're jumping, I increase/decrease the max speed as required.

    This works for the most part, however it ignores the acceleration and deceleration for the platform behavior, due to it needing to set the X vector to itself if the player isn't holding a direction. Does anyone know of a better way of doing this?

    Many thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think what you're asking for is for the platform behaviour to behave more like the physics behaviour by preserving momentum. I think the only way to achieve what you want - consistent behaviour whether jumping off a platform or not - is to write your own x velocity code using events. It sounds like you've done that already for when the player jumps off a moving platform. For the rest, then, set the default platform deceleration to 0 and set x velocity to reduce to 0 as you have already. It might take a bit of experimentation to get the effect you want but at least then it'll be consistent wherever the player jumps. I've personally found the default behaviour OK for a quick prototype but things like this require some alternative behaviour writing using events.

  • I think what you're asking for is for the platform behaviour to behave more like the physics behaviour by preserving momentum. I think the only way to achieve what you want - consistent behaviour whether jumping off a platform or not - is to write your own x velocity code using events. It sounds like you've done that already for when the player jumps off a moving platform. For the rest, then, set the default platform deceleration to 0 and set x velocity to reduce to 0 as you have already. It might take a bit of experimentation to get the effect you want but at least then it'll be consistent wherever the player jumps. I've personally found the default behaviour OK for a quick prototype but things like this require some alternative behaviour writing using events.

    Many thanks for the advice. I'll get right to it and start experimenting with some events to set the velocity!

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