- Home /
This question was
closed Jan 31, 2016 at 04:47 PM by
Fattie for the following reason:
How do I set up an invisible Button?
How do I set up an invisible Button?
On click to jump.
Comment
For modern Unity, it's just
http://answers.unity3d.com/answers/851816/view.html
if performance is not an issue just move the slider on Image to transparent
I wonder if @$$anonymous$$IkezNesh has been patiently hitting refresh on his browser every day for the last 5 1/2 years waiting for this comment....
Answer by Mike 3 · Jul 04, 2010 at 06:28 PM
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
}
Follow this Question
Related Questions
GUI button to NGUI button ? 1 Answer
Input press to play different animation to input hold? 0 Answers
player jump on UI button release 1 Answer
Android Jump 0 Answers
Problem with GUITexture upon another 1 Answer