So i have this object that i can move using the mouse. My camera is linked as a child object to my character.
When i move the mouse left, the char goes left and it also rotates 15°.
My camera also rotates 15° but i don’t want that. I want my camera to be stable but still linked to my character because he must follow it everywere.
THis is what i have so far:
changeX = Input.GetAxis("Mouse X");
if(changeX != 0)
{
if(changeX > 0)
{
transform.eulerAngles.x = 15;
mainCamera.transform.eulerAngles.x = 0;
}
else
{
transform.eulerAngles.x = -15;
mainCamera.transform.eulerAngles.x = 0;
}
}
I tried it with localEulerAngles. Different setting like -15 and +15 when the character rotates +15 and -15 but it seems my camera does not respond to my values.