Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Inboke method not working in unity

I have this script that im trying to run so my level restarts when I die and I get the issue "Trying to Invoke method: GameManager.Restart couldn't be called." How do I fix it?

Answers

  • ZicrusZicrus Member

    Check in update if "gameHasEnded" is true. If it is, count down from 2: restartDelay -= Time.deltaTime; Then if restartDelay reaches 0, restart the game

  • edited June 2020

    not gonna lie I dont really know what that means

  • He literally explained everything...

  • WarpWarp Administrator

    You have a nested function. Im surprised this even compiles, because I thought that was illegal to do.

    Move the "restart" function out of the scope of EndGame(), and tell me what happens. That should fix it.

Sign In or Register to comment.