i have a very simple question
how do i rotate an object instantly along an axe, with no delta time?
i'm looking for something like:
transform.rotation.y = 20;
i have a very simple question
how do i rotate an object instantly along an axe, with no delta time?
i'm looking for something like:
transform.rotation.y = 20;
Take a look at the Transform.Rotate reference page.
Short answer:
transform.Rotate(0, 20, 0);
// transform.Rotate(x, y, z);
If you're wanting to instantly set it to a specific rotation, rather than rotate it by a specific amount, you'll need to use Transform.eulerAngles instead.
For example, this will explicitly set the y rotation to 20.
transform.eulerAngles = Vector3(0, 20, 0)
yes i want to set it explicitly to a value and not rotate it by an amount....
thank you!
-ask-
how to safe the data, for example, my player hit a cube with xyz rotation, i want to safe it into a variable.
this is for position
data.Ycordinat=transform.position.y;