Skip to content

Instantly share code, notes, and snippets.

View rajesh1993's full-sized avatar
🐶
Doggo Work!

Rajesh.M rajesh1993

🐶
Doggo Work!
View GitHub Profile
@rajesh1993
rajesh1993 / updateCamRotation.cs
Created March 25, 2020 03:48
Rotate Camera around Player/Character in Unity
// Rotates the camera around character's current position based on axis input.
// PS4 - Right Analog Stick
void updateCamRotation(Vector3 characterPosition) {
// Set speed of rotation
float rotationSpeed = 2;
// Obtain Axes input.
float rotateHorizontal = Input.GetAxis("RightStickX");
float rotateVertical = Input.GetAxis("RightStickY");