- Home /
Collision between player and static object doesn't work as intended
I am working on a 3D isometric shooter game and it's my first time making a 3D game but not my first time using Unity, and have just tried to sort out the core gameplay elements first using basic shapes. I have one cube shape representing the player, one that represents a border/wall and one that represents an enemy. The player and enemy cubes have a box collider and a Rigidbody since they would move in the game, and both move by setting the velocity atribute on their Rigidbodies. The border/wall cube only has a box collider since it would be a static object.
When the player collides with the enemy cube everything works as intended; the two objects can collide all the way around and can't pass through each other. When the player collides with the static border/wall cube however, the player overlaps and passes through the bottom half of the shape from the point of view of the camera, but when colliding with the top half of the shape, collides as intended and doesn't pass through.
The only difference between the enemy and border/wall cubes is that the enemy has a Rigidbody so why would this effect occur with the static object? I haven't altered the colliders in anyway either, I literally just attached a box collider to all objects and a Rigidbody to the player and enemy cube.