I’m following the Roll a ball tutorial, and I’ve reached the part when the pickup object (cube) is tilted. Since I want the spatial (larger) diagonal of the cube to be pointing straight up (globally), I’ve tilted / rotated the cube like so:
x = 35°
y = 0
z = 45°
What values should I use in this:
void Update() {
transform.Rotate(new Vector3(x,y,z) * Time.deltaTime);
}
so that the cube rotates around its spatial diagonal? In case it’s not clear what I’m asking. I want to achieve this kind of rotation (minus the wiggling):
Is this even possible to do with one line of code?