下一级到来时玩家停止移动unity2d

Player stops moving when next level comes unity2d

你好,我正在制作一个冒险跑酷游戏作为一个项目,我编写了下一个级别的功能(这样你就可以在完成一个级别后切换级别)但问题是我的玩家突然决定它想要偷懒一动不动

我真的不知道该尝试什么,但这是我的移动代码:

horizontalInput = Input.GetAxis("Horizontal");

    transform.Translate(Vector3.right * speed * horizontalInput * Time.fixedDeltaTime);

和我的切换级别代码:

public void GoToNextLevel() {
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}

如果你能提供帮助,我将不胜感激

它不起作用的原因是因为在我的代码中它说:

Time.timeScale = 0;

这意味着暂停游戏。所以我没有取消暂停游戏,玩家无法移动。抱歉称你为懒惰玩家 - Smaika 的回答