- Home /
GUI.RepeatButton blocks input for other GUI.RepeatButton
The problem is that if "Speed" button is held down, the Fire Button doesn't work. What is the fix? (Edit: Testing on iPhone/iPad)
if(GUI.RepeatButton(Rect(originalWidth-120,originalHeight-200,100,100),"Fire")) {
shootScript.fireProj();
}
if(GUI.RepeatButton(Rect(10,originalHeight-300,100,100),"Speed")) {
shootScript.increasedSpeed();
} else {
shootScript.decreasedSpeed();
}
FTR I'd just do it "raw" by looking at the touches array. Or, use one of the many gestures libraries on the asset store! Unity's GUI is a bit trashy.
Is there anything Unity actually does well? GUI sucks, basic collisions barely work (resort to DontGoThroughThings script), I've had problems where applying torques/forces went haywire as soon as I added a collider. Sorry to rant.
For the record, I find that Unity does almost everything incredibly well.
"Basic collisions" work amazingly, torques/forces work amazingly, all the calls are incredibly stable, the 3D pipeline is incredible and so on.
Your answer
Follow this Question
Related Questions
Putting Dictionary/List using foreach as buttons in a scroll view? 3 Answers
GUI Display Help 0 Answers
Button doesn't show up in pause 2 Answers
Can I dynamically create buttons from an arraylist? 1 Answer