- Home /
Ball n Floor Collision Problems
Hi all, first post and first non taught project, all on my own.
So basic issue im sure, at the start of game, a ball drops a few ft to hit the a floor.
OnCollision with floor, ball gets velocity and starts rolling forward.
It rolls for about 3 feet then falls through the world.
the floor is a plane with a Tag, the ball is calling in Debug.Log that it hit the floor in the console and rolls briefly then falls through.
Ball has rigidbody.
Both have a physics material applied to them.
Even when i take off the forward movement and just use the strafing left n right, it moves a bit then starts to get stuck and the whole floor shakes and vibrates.
I can post screens of code if it would help but i figured someone would be able to laugh at my noob-ness and know whats going on?
Thanks
I would recommend using a CharacterController. What is likely happening is that the collisions are clipping, thus causing the ball to get stuck and freak out. I had that issue when I was writing my Spotlight game.
Another fix is on the Rigidbody, use the Constraints, and constrain the Y, so the ball doesn't fall into the floor, or force it to stay on the same axis.
Do i need to do anything else after i add a Character Controller to the code or anything like that?
When i added a y constraint the ball just fell through the floor immediately, anything else i can do?