I’m creating a script to control my camera and my character on a unity scene but when I turn my camera with my mouse, the background tremble. But the more I turn, the more my background tremble.
public Camera FPSCam;
void Update()
{
yaw += speedH * Input.GetAxis("Mouse X");
pitch += speedV * Input.GetAxis("Mouse Y");
transform.eulerAngles = new Vector3(0.0f, yaw, 0.0f);
FPSCam.transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
}
I already tried many thinks to fix my bug like change the Update() by a FixedUpdate() or use a Vector3.smoothDamp() to update the transform.eulerAngles.
You can download build project following this link:
https://drive.google.com/file/d/1KIJMp0Kr_6vsXF7dXn2HUOe33r473zJQ/view?usp=sharing
Thanks for help.
PS: please, excuse my English level, I’m french…