void Start ()
v = Vector3.zero;
void Update ()
_xRotation = Mathf.Lerp(_xRotation, 0, _lerpRate); _yYRotation = Mathf.Lerp(_yYRotation, 0, _lerpRate); v.x += _yYRotation; v.y += _xRotation; v.z += 1 * Time.deltaTime; transform.eulerAngles = v;
// ******Above code *********
transform.eulerAngles += new Vector3(0, _xRotation, -_yYRotation);
I am a beginner in unity and also please forgive my spelling mistake or grammatical mistake in the question.
Actually i am trying to orbit the camera around the player and i have problem in understanding in eulerAngles because when i use code above comment line the camera rotate in 360 angle but when i use code below the comment line the camera rotates only in 180 degree for x axis and for y axis it rotate 360 angle same value same code for x and y value but still this weird behavior. i am guessing this happen because " vector3 v" Declared ones in code above comment line and and in code below comment line every time it register new vector3 m i correct?? please explain.
note : code below is in comment written just for understanding
thank you in advance.