- Home /
Euler Angles under Empty object
I have question. I use transform.eulerAngles.y to control angle on object so I use condicion:
if(transform.eulerAngles.y==90)
then something
but object is under empty object and I start rotate with empty and the condition doesnt work because the object work with global coord but angle of an object is not changed, bc object has a angle what I need. What I need to use for this solution? Sorry for my bad English, many thank for answer.
Andy.
Answer by pheash · Jun 11, 2012 at 10:44 PM
hey Andy, I am not quite sure whether this is what you want. If you are looking for the objects euler angle instead of the global one you can use: transform.localEulerAngles.y==90 maybe giving a range to your condition statement would be better instead of using ==90 which might never get true if you continuously rotate the object, esp if it gets multiplied by Time.deltaTime. it would return false even if the angle is 90.001. maybe a screenshot of what is happening would help answer your question better.
Yes this is what I need. $$anonymous$$any Thanks. Now working perfectlly...:)
Your answer
![](https://koobas.hobune.stream/wayback/20220613072636im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rotation like in editor 2 Answers
Clamping localrotation between two angles 0 Answers
Change orientation 1 Answer
How to make an empty object to follow part of a sprite? 2 Answers
Restricting GameObject Rotation 1 Answer