我想用unity写一个可以控制方块移动的程序,导入之后,出现了按"a"键盘没有反应,按“d”却是正常的情况,已经检查过键盘没有问题了
就算把"A"键改成其他按键也无法正常运行。
脚本:using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
// Start is called before the first frame update
public Rigidbody rb;
public float forwardForce = 2000f;
public float 向左的力 = 500f;
public float 向右的力 =500f;
void FixedUpdate()
{
rb.AddForce(0,0,forwardForce*Time.deltaTime);
if(Input.GetKey("d")){
rb.AddForce(向右的力*Time.deltaTime,0,0);
if(Input.GetKey("a")){
rb.AddForce(向左的力*Time.deltaTime,0,0);
}
}
}
}