I am making a ability for a character where it pushes the character forwards by a certain distance with the click of a button, and I was wondering if I should use LinearVelocity for this, or ApplyImpulse?
Yes, these two systems are very different as one is a constraint and the other is a function but they both happen to suit the system that I’m making.
For LinearVelocities, the length and speed it pushes the player is more consistent, but it is less stable which makes it more likely to fling the player (especially when it collides into walls).
For ApplyImpulses, it is more stable in pushing the player and is less jankier overall than LinearVelocities, but since it uses force to push the player, the length it pushes depends on the friction of the surface the player is standing on which makes it less predictable to use.
I don’t mind having different pushing distances with ApplyImpulses, but I would prefer the distance pushed being manually set instead of depending on external factors (part friction, character mass, etc)
I’ll show you videos of the pushing mechanic with LinearVelocity vs ApplyImpulse
LinearVelocity Pushing Mechanic:
I’ve improved it from the video shown so that it no longer flings the player unless it pushes the player into walls which gives it a chance to fling the player
ApplyImpulse Pushing Mechanic: