Skip to content

Instantly share code, notes, and snippets.

@honix
Last active June 16, 2018 14:05
Show Gist options
  • Save honix/baba061fb073ebf67469a83485b2f6eb to your computer and use it in GitHub Desktop.
Save honix/baba061fb073ebf67469a83485b2f6eb to your computer and use it in GitHub Desktop.
void Update () {
// ...
// - Body
// \_ - Camera
// Rotate full body right and left
transform.Rotate(
0,
Input.GetAxis("Mouse X"),
0
);
// Rotate camera attached to body up and down
camera.transform.Rotate(
Input.GetAxis("Mouse Y") * -1,
0,
0
);
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment