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)