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.
Try ensuring your position update is done in FixedUpdate rather than Update, and also set your RigidBody’s collisionDetection to “Continuous Dynamic”
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.
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.
There are some ways to increase the physics reliability at the cost of increases system load, as listed in this Stack Overflow thread:
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.