- Home /
Physics Based Sprint and Jump?
So, I'm having a bit of trouble with something. In the default Unity player controller, if you hold sprint while jumping, you jump farther and faster, which is good. The problem is, if you let go of the sprint key mid jump, you slow down in mid air. I'd still like the player to be able to change direction mid air, but not be slowed by releasing shift until they land. Would the solution to this be a more physics based player controller? Something that adds velocity instead of setting a max speed for walking and sprinting and alternating between the two? I'm not really much of a programmer myself, and I've looked for solutions to this, but I can't seem to figure it out or find any answers. Would I need to write a new script from scratch, or can the default script be edited to work the way I need it to? Any help would be greatly appreciated.
EDIT: Essentially, what I'm trying to do is create a player controller that feels about the same as the player controller in Thief: The Dark Project, if that helps any.
Answer by Ellie97 · Sep 28, 2018 at 10:38 AM
Hmm... I've personally never worked with first person controllers, however if I were to approach this from third person I'd use AddForce (forcemode impulse) for jumping. This would require a rigidbody and a collider on your player. What is the default script? You may be able to just add that to it.
Answer by andre_unity362 · May 25, 2020 at 12:52 PM
Because the modern jump is not a straight jump, it is a jump plus a bowing rotation. The rotation is about the center of mass, which acts as the hub of rotation.
Your answer
Follow this Question
Related Questions
How do you calculate DeltaX and DeltaZ for a character? 1 Answer
SphereCast to detect remote player 1 Answer
Why am I not jumping? 1 Answer
How do I solve this error? 2 Answers
Player movement 0 Answers