我有一个小型 3d 游戏,其中一个球只能在前面并跳跃。我想在球落下时停止球员的移动,但我不知道。
void FixedUpdate()
{
// Player movement
rb.transform.Translate(0, 0, forwardForce * Time.deltaTime,);
// What's happening when the ball fall down
if (rb.position.y < -1f)
{
FindObjectOfType<GameManager>().EndGame();
}
}