model maker
New Coder
ok so im trying to make a movement system in unity using c++ but it wont asign to the camera properly meaning it wont work does anybody know a fix?
this is the message
Assets\playercontroller.cs(7,32): warning CS0414: The field 'playercontroller.playerCamera' is assigned but its value is never used
and this is my code
sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playercontroller : MonoBehaviour
{
[SerializeField] Transform playerCamera = null;
[SerializeField] float mouseSensivity = 3.5f;
void Start()
{
}
void Update()
{
}
void UpdateMouseLook()
{
Vector2 mouseDelta = new Vector2(Input.GetAxis("Mouse x"), Input.GetAxis("Mouse y"));
transform.Rotate(Vector3.up * mouseDelta.x * mouseSensivity);
}
}
this is the message
Assets\playercontroller.cs(7,32): warning CS0414: The field 'playercontroller.playerCamera' is assigned but its value is never used
and this is my code
sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playercontroller : MonoBehaviour
{
[SerializeField] Transform playerCamera = null;
[SerializeField] float mouseSensivity = 3.5f;
void Start()
{
}
void Update()
{
}
void UpdateMouseLook()
{
Vector2 mouseDelta = new Vector2(Input.GetAxis("Mouse x"), Input.GetAxis("Mouse y"));
transform.Rotate(Vector3.up * mouseDelta.x * mouseSensivity);
}
}