-1
我已經嘗試檢查文檔,它似乎對我來說是正確的,但當我嘗試構建此項目時仍然出現錯誤。我不知道如何處理input.getaxis(「垂直」)中的錯誤?
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
private Rigidbody rb;
void Start() {
rb = GetComponent<Rigidbody>();
}
void FixedUpdate() {
Input side = Input.GetAxis("Horizontal");
Input up = Input.GetAxis("Vertical");
Vector3 movement = new Vector3 (side, 0.0f, up);
rb.AddForce (movement);
}
}
那麼是什麼錯誤? –