-2

In my game you need to fix things by pressing X. When X is pressed an animation of the guy fixing is played, then the text changes for the number of things left to fix, then the broken thing's game object is destroyed.

The issue I'm having is if the player spams X when fixing one thing it minuses the amount left enough to win the game without having to fix the other things (if that makes sense).

I have tried adding delays and stopping time, which haven't had the desired result.

  • 1
    Please include the relevant code in your question. This can be accomplished with a bool that is checked before doing the action, and set when starting the action. Something akin to `if (fixing) return; fixing = true; StartFixing();` – hijinxbassist Jan 19 '23 at 00:25
  • Thanks for the help!! I guess I just needed a reminder that I had that bool in the code already I just had to disable it!! – SumDumMcfun Jan 19 '23 at 03:39
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 19 '23 at 09:39

1 Answers1

0

I just had to change my fixhole bool to false!

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 20 '23 at 07:08