Skip to content

Instantly share code, notes, and snippets.

@newyellow
Created August 9, 2020 05:40
Show Gist options
  • Save newyellow/924d901cf9c5c1a307346611f9ae0d80 to your computer and use it in GitHub Desktop.
Save newyellow/924d901cf9c5c1a307346611f9ae0d80 to your computer and use it in GitHub Desktop.
Quaternion _preRotation;
public Vector3 newRotation = Vector3.zero;
void Awake () {
_preRotation = transform.rotation;
}
void Update () {
transform.rotation = _preRotation * Quaternion.Euler(newRotation);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment