Помогите исправить ошибку Unity C# (Transform.rotation, CS1612)
public class Controll : MonoBehaviour
{
[SerializeField]
public GameObject cam;
private Vector2 Axis;
private void Update()
{
if (Math.Abs(cam.transform.localRotation.x) <= 90)
{
cam.transform.rotation.x = 0;
}
if (Input.GetKey(KeyCode.W)) gameObject.transform.position += gameObject.transform.forward * 10 * Time.deltaTime;
if (Input.GetKey(KeyCode.S)) gameObject.transform.position -= gameObject.transform.forward * 10 * Time.deltaTime;
if (Input.GetKey(KeyCode.D)) gameObject.transform.position += gameObject.transform.right * 10 * Time.deltaTime;
if (Input.GetKey(KeyCode.A)) gameObject.transform.position -= gameObject.transform.right * 10 * Time.deltaTime;
}
}
Код не лучший но ошибка с ним скорее всего не связано Как её исправить?