I want to make a thirdpersonshooter-camerascript
the player is the parent of an empty(pivot) and the camera should follow the pivot
when i move my mouse to the left the player rotates to the left with the pivot
but the problem lies with the camera:
it keeps the distance to the pivot but it doesnt inherit the rotation
(red is how the camera is, green is how the camera should be)
following the responsible part of the cameracontroller:
//rotation of the camera
transform.position = pivot.transform.position + (pivot.transform.rotation * (new Vector3 (0.5f,2,-2)));
targetlook = Quaternion.LookRotation (pivot.transform.position - transform.position);
transform.rotation = Quaternion.Slerp (transform.rotation, targetlook, smoothlook * Time.deltaTime);
transform.LookAt (pivot.transform);
any advice?