Skip to content

Instantly share code, notes, and snippets.

@Zerophase
Created July 9, 2014 06:24
Show Gist options
  • Save Zerophase/6956d5a2680e3a3501ab to your computer and use it in GitHub Desktop.
Save Zerophase/6956d5a2680e3a3501ab to your computer and use it in GitHub Desktop.
// Rotating with Quaternions.
Quaternion rotation = Quaternion.LookRotation(transform.position);
rotation *= Quaternion.Euler(0f, 90f, 0f);
transform.rotation =
Quaternion.Slerp(gameObject.transform.rotation, rotation, 1f); // place holder for testing final position.
// Rotating with vector 3
transform.eulerAngles += Vector3.Slerp(gameObject.transform.position,
gameObject.transform.position + new Vector3(0f, 90f, 0f), 1f); // place holder for testing final position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment