Hi,
I am following along with a youtube video by Brackeys about making a first person controller and some of my script is not working.
Firstly, in Visual Studio functions like Transform arent even being highlighted as if they arent part of any repository. Im getting an error:
Assets\Scripts\PlayerLook.cs(28,19): error CS1061: ‘Transform’ does not contain a definition for ‘localRoatation’ and no accessible extension method ‘localRoatation’ accepting a first argument of type ‘Transform’ could be found (are you missing a using directive or an assembly reference?)
So I downloaded Unity 2020 through the hub last night, the only thing I added myself was .NET core 3.1.
Visual Studio does contain the unity tools extension.
What else should I have downloaded? I have most recent .NET framework.
Or what program should I set as default for scripting with .cs?
for reference here is my script:
(my apologies, I dont know how to get line numbers)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float mouseSensitivity = 100f;
public Transform playerBody;
float xRotation = 0f;
// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}
// 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;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRoatation = Quaternion.Euler(xRotation, 0f, 0f);
playerBody.Rotate(Vector3.up * mouseX);
}
}