0
下面是我爲我的字符控制器編寫的代碼:如何解決我的播放器控制器中的錯誤?
using UnityEngine;
using System.Collections;
公共類FirstPersonController:MonoBehaviour {
public float movementSpeed = 5.0f;
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
float forwardSpeed = Input.GetAxis("Verical") * movementSpeed;
float sideSpeed = Input.GetAxis("Horizontal") * movementSpeed;
Vector3 speed = new Vector3(sideSpeed, 0, forwardSpeed);
CharacterController cc = GetComponent<CharacterController>();
cc.SimpleMove(speed);
}
}
當我嘗試移動我的性格,我不能動,我得到這個錯誤:
UnityException:輸入軸立式沒有設置。要改變輸入設置使用:編輯 - >項目設置 - >輸入FirstPersonController.Update()(在資產/腳本/ FirstPersonController.cs:16)
你能幫我解決我的問題。