disable input temporarly if a variable is true

Hello. Im Using the FPSController in unity and I want to disable input temporarly if a variable is true. How do I do this? I tried putting an if statement under the GetInput() But it still doesnt work. Help? Thanks!

Show some code probably on how you tried to handle it. But you should be able to just check the bool before your input check happens. If the bool is true, then just return. (you could do an if else also, but setting up the return is easier).

thats what I did but it doesnt work…

If you don’t show some code (unless you are unable to for some reason) I couldn’t tell you why it isn’t working. All I can tell you is how it should be handled.

Like Brathnann said, you need to show code, and are just making people take blind guesses. That isn’t helpful at all. If I had to take a stab in the dark, I’d guess that either you aren’t setting your bool correctly, or your bool isn’t scoped properly (for example, you’ve declared it in two different functions, each having their own scope, and therefore their own individual values for the bool). Code helps… use [ code ] tags