How do I set up an invisible Button?
On click to jump.
How do I set up an invisible Button?
On click to jump.
from OnGUI (using normal rect positions for button):
if (Event.current.type == EventType.MouseUp && yourInvisibleButtonRect.Contains(Event.current.mousePosition))
{
//jump
}
from Update (the rect needs to be defined with bottom left of the screen at 0,0):
if (Input.GetMouseButtonDown(0) && yourInvisibleButtonRect.Contains(Input.mousePosition))
{
//jump
}