所以,我试图用WSAD按钮移动一个立方体,由于某种原因,即使我没有触摸任何按钮,它也会向上和向左对角移动。我使用的是Unity 4.5.1
代码:
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
public float moveSpeed;
private Vector3 input;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
input = new Vector3(Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical"));
print(input);
}
}