I’m not sure why this is not working. It works for the most part but when I leave the ground by going over the edge of map the character is still tilted but by a very small amount. I looked through documentation and looked at components but I don’t see anything to constrain rotation.
Entities.ForEach((ref MovementInputComponent movementInputComponent, ref MovementCharacterComponent movementCharacterComponent, ref PhysicsVelocity physicsVelocity, ref Rotation rotation) =>
{
// Get Current Velcity
var currentVelocity = physicsVelocity.Linear;
//Read Movement Input
currentVelocity.x = movementInputComponent.input.x;
currentVelocity.z = movementInputComponent.input.z;
//Move
physicsVelocity.Linear = currentVelocity;
//Constrain Rotation
rotation.Value = quaternion.EulerXYZ(0, 0, 0);
});