Hey all,
I am very new to unity and right now I am working on a simple endless runner in 3d.
I am using a simple capsule as player. Right now I have a moving charakter, I have endless platforms coming in front and being deleted in the back of the level, I have random obstacles spawning and I have a death/restart system if the player falls down or hits an obstacle.
BUT:
As soon as I hit play and the player moved a bit it always falls to the side and rools off the map.
Is the player using a rigidbody controller? If so, there’s most likely physics being applied to the object, causing it to topple over, when colliding with something. There’s a simple way around this, and that is to lock the x, y, and z rotation of the rigidbody, so that it can’t topple over.
You can do this by going into the contstraints dropdown in the rigidbody component in the inspector, and ticking lock x, y, and z rotation.