- Home /
First Person Controller Physics
Alright, so I have noticed if you have terrain which is too steep to walk up (ie: vertical), if you press spacebar and forward, you can continuously jump and would be able to reach the top, this is very inaccurate physics, as there is little support force to hold up the user, without even considering balance.
How can I go about solving this?
Answer by Dinosaurs · Oct 22, 2015 at 08:56 PM
Check out this answer: http://answers.unity3d.com/questions/411616/slope-limiting-for-rigidbody.html
Basically you want to cast a ray downward from your character, compare the normal of the raycast hit against the world up vector, and not move if the result is below a certain threshold.
$$anonymous$$y problem was actually 2 issues:
I can navigate up slopes I am unable to walk up by jumping repeatedly.
There is no concept of support force, which is holding the player up. For Example, if i am standing on a point on a wall which is 90 degree's vertical, making completely upright and I am standing on about "1 mm" of terrain which is supposed to be holding up my player. In the real world, you would be incompletely incapable of standing on 1mm of terrain due to your center of gravity, and balance. I should be falling. How could I implement this?
Using the same technique, you could check if the player is standing on a slope and disable jumping or apply a force downhill. To deter$$anonymous$$e the direction of the gravity you could do multiple raycasts from the players feet downward and check which point is lowest.
Answer by toromano · Oct 23, 2015 at 02:22 PM
You need to create physics joints for arms legs fingers and drive them, really complicated though. There is a ragdol tutorial in unity: https://www.youtube.com/watch?v=Hw1UK85sARc
Your answer
![](https://koobas.hobune.stream/wayback/20220612042326im_/https://answers.unity.com/themes/thub/images/avi.jpg)