Unity2022.3.20f1でPlayerを動かすプログラミングが反応しない

このソースコードを書いたのですがこのエラー文が出ます
イメージ説明
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
public float moveSpead = 5f;
public float rotationSpeed = 360f;

CharacterController characterController; // Start is called before the first frame update void Start() { characterController = GetComponent<CharacterController>(); } // Update is called once per frame void Update() { Vector3 direction = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); if (direction.sqrMagnitude > 0.01f) { Vector3 forward = Vector3.slerp(transform.forward, direction, rotationSpeed * Time.deltaTime / Vector3.Angle(transform.forward,direction)); transform.LookAt(transform.position + forward); } characterController.Move(direction * moveSpead * Time.deltaTime); }

}
イメージ説明
このようにスクリプトが反応しません
どうすれば改善できるでしょうか。
ご教授お願いいたします。

コメントを投稿

0 コメント