2016-08-21 118 views
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)

你能幫我解決我的問題。

回答

0

輸入軸垂直未設置。

現在可能無法幫到你。 希望能在未來幫助別人。

我有這個問題。當我發現它時,結果很容易解決。我沒有在我的代碼中輸入垂直字樣。

一個人有一個帽V其他非帽訴這種基本的錯誤lol。