if(transform.Rotate) Doesn't Work?

I’m trying to check what angle my object is at and performing a particular task when it reaches that angle.

if(transform.Rotate.x > 85){
   do something
}

But this does not work. What is the correct way to do this?

Thanks

transform.Rotate returns void and has no property x.

Use transform.eulerAngles instead.

Hi

   You should use :

                 transform.localRotation instead of transform.Rotate .

Regards

Laksh

if(transform.localEulerAngles.x > 85) 
{
    doSomeStuff();
}

–David

Try transform.rotation.x