- Home /
Player falls through ground after a high jump
Hey,
I have a player which has a rigidbody and a box collider attached to it. Istrigger is not checked. The ground has a box collider too. The problem is that after a very high jump, my player comes down and falls through the ground, but if the jump is small then everything is normal. It doesnt fall then. I do not understand. Please help.
What is the scale of your object compared to world and how high is the big jump?
mrpmorris is correct. this is what the RigidBody's collisionDetection setting is for. change it to one of the continuous settings
Answer by iamthecoolguy11 · Aug 16, 2014 at 11:11 PM
This is just a unity physics problem, Unity can handle physics at slow speeds but once things start going fast it runs in to problems like going threw colliders. Turn the drag up on the rigid body and it should fix the problem.
This helped me out, I have a skateboard that would clip through the ground quads or planes until I set drag to 1.5 and it quit TY!!
Do you mean as in the angular drag or the linear drag?
Answer by mrpmorris · Jul 29, 2016 at 08:30 AM
Try ensuring your position update is done in FixedUpdate rather than Update, and also set your RigidBody's collisionDetection to "Continuous Dynamic"
I don't know why this isn't the best answer, this answer is the one that worked and didn't require I redid how the physics worked in my game. Thank you very much.
Awesome! Couldn't drag up Rigidbody because it slowed the player down (moving otherwise in constant speed). Changing to continuos worked though! Thanks!
Changing collision detection to "continuous" solved this for me. This is the best answer.
Answer by ffedU · Aug 17, 2014 at 12:40 AM
Hi, I'm new to Unity, so I may be wrong. Could this be an issue with the Update()? Maybe in high speed the the gameObject moves too far in only one frame, skipping the collider entirely.
Maybe try checking the collision on a FixedUpdate(). I understand it checks more often than the Update(), but again, I maybe wrong, in which case, please correct me.
Update() - updates every single frame, whilst FixedUpdate() updates every frame rate frame.
So if you're locked to 60FPS, then FixedUpdate() will update every 16ms.
Answer by Cherno · Aug 17, 2014 at 01:17 AM
There are some ways to increase the physics reliability at the cost of increases system load, as listed in this Stack Overflow thread:
http://stackoverflow.com/questions/9688237/how-to-prevent-colliders-from-passing-through-each-other
Answer by Joxno · Aug 17, 2014 at 01:38 AM
A possible way of preventing this would be to attach a script that Raycasts downwards in a decent interval and checks if the object has moved further than the distance of the Ray from the previous raycast.
Although this being more of prevention method rather than a proper solution.
Your answer
Follow this Question
Related Questions
Trigger Rigidbody with CharacterController 0 Answers
My Player keeps launching into the air 4 Answers
Excluding some physics collisions 3 Answers
Avoid overlapping of random spawned prefab 3 Answers
Rigidbody behaves differently when I add a collider 5 Answers