I want to make a thirdpersonshooter-camerascript
the player is the parent of an empty(pivot) and the camera should follow the pivot
![camera][1]
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)
![alt text][2]
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?
[1]: /storage/temp/51420-camerasetting1.jpg
[2]: /storage/temp/51421-camerasetting2.jpg
↧