RotateAround two axis?
Hi, I've had this working in the past and remember being able to do it with either a single object and/or a parent/child, I've gone with the parent/child for now but I also remember that to get this to work I had to use the transform.up and vector3.right, I'm pretty sure I modified the Euler too but completely unsure.
What I'm trying to achieve is a simple RPG Camera, something like DarkSouls has. Though I keep running into the issue of the Z Axis rotating as well, modifying the Euler of either to set the Z Axis to 0 doesnt help.
void CameraControl() {
float x = Input.GetAxisRaw ("Mouse X") * lookRotation;
float y = -Input.GetAxisRaw ("Mouse Y") * lookRotation;
//ROTATE AROUND LEFT AND RIGHT
CameraParent.RotateAround (transform.position, CameraParent.up, x);
//ROTATE AROUND UP AND DOWN
CameraChild.RotateAround(transform.position, Vector3.right, y);
}
Your answer
Follow this Question
Related Questions
How do I exclude an axis from 'transform.localPosition'? 1 Answer
Hard coded rotation of child results in weird arc rotation when parent is rotated? 0 Answers
Limit Rotation with RotateAround on 2 axis 0 Answers
Problems with rotating the player on the Y axis C# 0 Answers
Manual RotateAround 0 Answers