#External Force Negation in Auto Runner

1 messages · Page 1 of 1 (latest)

remote igloo
#

https://paste.myst.rs/hxz2wu9y

I am making an auto runner game - and I've got a custom gravity system working relatively fine by my standards. I was trying to implement jump pads when I ran into some issues. First off, even though the jump pad was applying a constant velocity at an angle, the player was being launched straight up when they ran into the pad? I checked the pad's code and it was perfectly fine so the issue lies in the player controller. I feel my application of gravity and, for example, freezing of movement when an external force is applied are not optimal, but I don't know any good alternatives. Could someone help me get the system working for this use case and in a flexible way such that I can easily implement future potential forces like conveyor belts as well.

calm nest
#

You're using forces for the jump pad, yet most methods of movement in your code is setting the velocity directly which sounds like the problem.

remote igloo
#

Cos I used debug draw rays to confirm that the jump pad is applying the force in the correct direction

#

So I think the player code is negating that somehow

#

I tried to remove the velocity in the direction of the force to mitigate this but I'm not sure if it worked

calm nest
#

I'm just saying that any time you set the velocity, any forces you've set are thrown out the window so you should be using that sparingly if you're using a non-kinematic body

remote igloo
#

So how would you suggest I implement external forces on this object then?

calm nest
#

If you're going to use forces then usually the idea is all methods of movement should be using them

#

using forces is how your character interacts with things like drag, but if this is not something you care too much for, then using a kinematic solution and doing it all yourself is the idea

remote igloo
#

I'm just wondering if I should freeze player movement and gravity while doing the jump pad

#

Cos they're on slopes some times