-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);
}
}
那么是什么错误? –