- Home /
collision with floor fails when jumping,Player falls through floor
I have a Terrain(I also tried a plane) so I have a Terrain Collider, and I have a Capsule Collider on my character. The characters mass is 1 and the collision detection is set to continuous dynamic. neither colliders are triggers. I have a script. that checks if the character has touched a object with tag "floor" which allows the character the ability to jump. My script uses rigidbody.addForce to make the character jump. When the character jumps, everything goes as planned except he will fall through the floor. It seems like there is so much downward velocity that its making the collisions fail. Any help is appreciated.
Answer by sylicstar · Sep 30, 2019 at 10:21 AM
Check if your player's rigidbody component has iskinematic turned on. If so, then turn it off. Otherwise, you may have to detect collisions using raycast for advance accuracy. Usually, its easy to detect collisons unless its a very fast moving object we do not need raycast.
Answer by Artajerjes · Oct 24, 2021 at 03:50 PM
Your player is falling because you are using a Capsule collider, it cant stay on the ground because of its form :)
Answer by ValerijD · Oct 24, 2021 at 03:49 PM
Check the Collision Detection. If it skips thin walls, you can set it to interpolate.