Camera script is invert?

Hi everyone! I recently started coding so i am very new with little knowledge. I watched a tutorial that created a third person camera follow script to achieve a follow effect(?) And when i point my cursor at the sky, the character looks down. So how do i get it to where when i look at the sky with my mouse, the character looks there to?

HERE IS THE CAMERA FOLLOW SCRIPT

using UnityEngine;

public class Thirdpersoncameracontroller : MonoBehaviour
{
public float RotationSpeed = 1;
public Transform Target, Player;
float mouseX, mouseY;

// Start is called before the first frame update
void Start()
{
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
}

void LateUpdate()
{
CamControl();
}

void CamControl()
{
mouseX += Input.GetAxis(“Mouse X”) * RotationSpeed;
mouseY += Input.GetAxis(“Mouse Y”) * RotationSpeed;
mouseY = Mathf.Clamp(mouseY, -35, 60);

transform.LookAt(Target);

Target.rotation = Quaternion.Euler(mouseY, mouseX, 0);
Player.rotation = Quaternion.Euler(0, mouseX, 0);

}

}
(Also i have no idea what a lot of this is so any help is appreciated)

Please use code tags: https://discussions.unity.com/t/481379

Well that is gonna stop you pretty cold from doing anything truly interesting or useful. I recommend going back to that tutorial working through it with a mind to understanding what the guy is building, one step at a time. I don’t know what tutorials you are using, but Brackeys makes amazingly good stuff, so I highly recommend that for learning.

1 Like

Ok thanks!