antk
1
Hi,
Fairly new to unity here. I am working on a 2d infinite runner. I recently added a speed boost bar with a GUI button to activate a speed boost. I am also using GetMouseDown to make the character jump.
When I click on the GUI button, my character jumps.
Is there a way to separate the two? Is that the point of layers?
Sorry if this is not clear. You can see the problem here: http://fanqu.net/demo. When you click the speed boost button, the character jumps.
Thanks in advance.
antk
2
Of course after I post this question and dig a little deeper, I find an answer right here on unity answers.
if(Input.GetMouseButtonDown(0) && GUIUtility.hotControl == 0) {
//character controller code here
}