Hello, I have a third person survival game. I have a problem and not solve it. my chracter pass the inside the wall. How can i prevent this ?
This is my character and you can see inside the wall(If ı move the character, character pass the wall). My character has collider and rigidbody.
This is my sample wall. I try add mesh collider and box collider but not working. Why?
I do not want to pass through the wall when character move. Thank you.
Right, so you are not moving with the physics system.
One other option I didn’t mention before is that you could raycast to determine valid movements.
So, options are: raycasting to determine valid moves, physics system to move, or using a character controller.
When you change the transform’s position in code directly, it doesn’t obey collisions automatically, as you imagined.