Hello, I am new in Unity and I try to write my first lines of code, for creating a character rotation.
.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseLook : MonoBehaviour
{
public float mouseSensitivity = 100f;
public Transform playerBody;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
float mouseY = Input.GetAxis("mouse Y") * mouseSensitivity * Time.deltaTime;
playerBody.Rotate(Vector3.up * mouseX);
}
}
.
I saved it, but that doesn’t let me play in the options or activate it in unity
.
.
It stay like that and I don’t find a solution for it.
So I ask you the question because I can’t complete my work
.
. ( I wrote with NotePad++ )
.