このソースコードを書いたのですがこのエラー文が出ます
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 コメント