【发布时间】:2021-03-23 02:02:00
【问题描述】:
我有一个小型 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();
}
}
【问题讨论】:
标签: c# unity3d game-development