I'm making a game where you can walk on planets and rotate around them, the movement script I have is from CatLikesCoding (will send link on request if needed) And then there's a seperate rotation script which references that to get the velocity directions. I'm having issues to make the rotation work properly, here's how the code looks like for now in the rotation: ```cs
//The upAxis is gained from a CustomGravity script and //returns 2 things, 1: the gravity pull direction, and the //upaxis (which is just the opposite of the pull direction)
//the GetLookDirection() returns the player velocity, //normalized
if (!playerMovement.OnGround)
{
Vector3 forwardDirection = playerMovement.GetLookDirection();
Vector3 upAxis = playerMovement.UpAxis;
Quaternion rotation = Quaternion.LookRotation(forwardDirection, upAxis);
//rotation.Normalize();
rotation.x = 0f;
//player kept tiling on the x-axis so set that to 0
transform.rotation = rotation;
}
else if (inputs.magnitude > velocityThreshHold && !playerMovement.DesiredJump)
{
Vector3 forwardDirection = playerMovement.GetLookDirection();
Vector3 upAxis = playerMovement.UpAxis;
Quaternion rotation = Quaternion.LookRotation(forwardDirection, upAxis);
//rotation.Normalize();
transform.rotation = rotation;
}
