Back to basics

Hi all,

It’s been a while since I have used unity and it shows. I am trying to get back on track with a simple app, one of the premises of which is you click on something and it rotates and additional 90 degrees. However to do this I feel I need to store the current y rotation and add 90 to it each time but when I store the variable it displays as 0.0287 for example rather than 90.

This is the code I am using,
yRot = game object. Transtorm. Rotation.y;

Please ignore the caps and spaces. I am on a phone and this site is not too mobile friendly.

Anyway, am I on the right path or should I be using a different approach?

Thanks

Steve

I always do the same thing. In my mind it makes total logical sense, and I spend a lot of time reading the docs, haha!

You have to create a new quarturnion, or Vector3 euler angle. By simply saying,

“this game objects rotation is equal to this rotation” Seems to have no effect other than a variable that just records this exchange of information. When you say, “this game objects rotation is equal to a new rotation/euler that is the same as the input variable”, then the object rotates! wizzbang.