Question by
shoumyareeq · Mar 23 at 04:49 AM ·
touch controls
how to stop character movement when finger is on GUI (lean touch)
I am new to unity and coding. i am using lean touch and i want to stop the movement of the player the moment my finger goes over an UI element. i want to ignore touches when IsOverGUI instead of StartOverGUI. how do i do this?
code: void OnEnable() { Lean.Touch.LeanTouch.OnFingerTap += HandleFingerTap; }
void OnDisable()
{
Lean.Touch.LeanTouch.OnFingerTap -= HandleFingerTap;
}
void HandleFingerTap(Lean.Touch.LeanFinger finger)
{
if (finger.IsOverGui)
{
Debug.Log("You just tapped the screen on top of the GUI!");
}
}
Comment
Your answer
Follow this Question
Related Questions
How can I detect a touch on a custom button and object in Unity3d 1 Answer
Trying to drag GameObject using touch input 0 Answers
TouchInput in Update. Physics in FixedUpdate. Lag and Lost calls? 1 Answer
Calculate speed for different devices 0 Answers
Trying to make a pong game for android. Touch control problems. 0 Answers