Hey all,
I’ve tried to digest the Unity docs on the relevant parts, but I’m really struggling to understand what’s going on.
What i’m trying to do is rotate between two set angles, and back again and basically keep doing this. (Ping.pong).
private var from : Quaternion;
private var to : Quaternion;
function Start(){
from = transform.rotation * Quaternion.Euler(transform.up * 90);
to = transform.rotation * Quaternion.Euler(transform.up * 270);
}
function Update(){
//transform.rotation = Quaternion.Slerp (from, to, Time.deltaTime * speed);
//transform.rotation = Quaternion.Euler(0.0, Mathf.Repeat(from, to), 0.0);
}
I have commented out the actual attempts I’ve had, as they’ve not been successful.
Any ideas?
Thanks, Bobble.