I have a mobile game where the only thing you have to do is to tap to jump,now i added a pause menu and when i click it the player still jumps,after i click on resume button the player also jumps and makes the game annoying
How to fix?
Code:
public void Pause()
{
Time.timeScale = 0;
panel.SetActive(true);
}
public void Resume()
{
Time.timeScale = 1;
panel.SetActive(false);
}
And for jump if u ask(it's called in void update):
void Jump()
{
if (Input.GetMouseButtonDown(0))
{
rb.AddForce(Arrow.transform.right * -ImpulseForce * Time.fixedDeltaTime, ForceMode2D.Impulse);
}
}