Creating a predictable and reliable player launchpad?

I’m trying to create a player launchpad for my game. The current launcher I have relies on injecting a BodyForce into the player when they touch the pad, but I’m noticing two problems that come with that technique.

Both are especially noticeable when bouncing between pads, but both issues still present even when making repeated jumps on the same pad - or when making single jumps on separate but identical pads.

  1. The result is not always predictable.
    Despite the values applied to the BodyForce being the same, the distance and height achieved at launch can vary dramatically. This is a major problem that risks making the game much less enjoyable to play. I would like the launch to be the same every time a player uses the launchpad - or at least, I want to be able to control how often it behaves differently.

  2. The launchpad does not always trigger.
    The launchpads are relatively small and the player walkspeed is higher than is typical. This is presumably the cause for the fact that the launchpad will not always trigger when touched. This could be easily mitigated by simply making the launchpads bigger, though, so it’s much less of an issue than the unpredictable behaviour mentioned above.

Are there better ways to have players launched into the air to travel distances that can be more easily predicted? What other techniques could I try?

For the for the first issue, try to first set the player Y velocity to 0 and then apply the BodyForce. For the second issue it is a little bit hard to find what wrong cause it could be caused by a lot of thing. Could you put a video?

I’m not worried issue 2 right now since I’m fairly sure I can fix it by just changing the launchpad sizes, but I’ll work on it once issue 1 is resolved.

Setting the player’s velocity to 0 sounds like a good solution, but I’m not sure how to do it - the API says that BasePart.Velocity is deprecated, so I can’t set the character’s RootPart Velocity like I was expecting to. How should it be done?

It AssemblyLinearVelocity for the linear or if you prefer the mouvement up, down etc and for the angular velocity(The speed that the object is turning at) is it AssemblyAngularVelocity

Okay, that seems to have done the trick! The behaviour is now far more predictable, and the registration issues I was noticing seems to be gone too after increasing the launchpad size.

Thanks!

1 Like