我有以下对象和玩家控制器
private float turnSpeed = 45.0f;
private float horizontalInput;
private float forwardInput;
public bool hasDelivery = false;
public bool hasPowerUp = false;
public GameManager1 gameManager;
private Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
gameManager = GameObject.Find("GameManager").GetComponent<GameManager1>();
}
//(0.00, 0.00, 1.34)"
void FixedUpdate()
{
forwardInput = Input.GetAxis("Vertical");
horizontalInput = Input.GetAxis("Horizontal");
Vector3 movement = transform.forward * forwardInput * speed;
rb.AddForce(movement * speed);
float turn = horizontalInput * turnSpeed * Time.fixedDeltaTime;
Quaternion turnRotation = Quaternion.Euler(0f, turn, 0f);
//rb.AddTorque(transform.up * turn);
rb.MoveRotation(rb.rotation * turnRotation);
}
当我尝试移动物体时,什么也没有发生。任何帮助将不胜感激
尝试将其更改为非运动学。