Help with a rotation problem.

function Ladder()
{
if(onLadder && Input.GetButtonDown(“Action”))
{
climbing = true;
}
if(climbing)
{
gravity = 0;
transform.position.x = climbable.transform.position.x;
transform.rotation.y = 90;//this is making me do a 180 every time, doesn’t matter if the value is 90, 180, 270, or even 360! it always returns 180
velocity.y = 0;
velocity.z = 0;
}
}

Keep in mind that transform.rotation is a Quaternion and does not behave as you might initially expect. Try setting the eulerAngles or localEulerAngles of the transform instead, depending on your use case.

    transform.eulerAngles.y = 90;