Vector Rotation (425055)

Im trying to get a object to rotate 90 when it gets past a certain point ie x>50

I have already created a funciton Rotate_Y() which contains an if statement for this but fail to impletement the actual rotation - doing the rotation solely with transform.rotation.y = 90 isnt working as it turns to 180 which leads me to think it will work better with vector method

Quaternion.AddForce(Vector3(0,90,0));

could you point me in the correct direction to fix this -

Have you tried something like this?

float v = 90;
transform.Rotate(0,v, 0);

Never access a Quaternion’s elements (x,y,z,w), unless you’re a math genius. They are not simple degrees.

You want to use the Euler angles instead, which will let you alter x/y/z directly, or do as Weylin suggested and just use the Rotate function.