Question by
Shezard · Apr 02, 2016 at 09:50 PM ·
breakwhile loopgetbuttonlaser beam
Break a GetButton
Hi EveryOne I'm pretty new in C# and coding in general
I'm trying to break a while loop that wotks this way:
while (Input.GetButton("Fire1"){
random raycast shooting code }
In fact I'm able to brake it but only works if I stop pressing "fire1". There is a way to break it even if I'm pressing "fire1"?
I've tried disableing the gameobject with setActive(False) but the loop still works
Thanks!
Comment