Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Avoid clicks through UI

Discussion in 'UI Toolkit' started by Graysome, May 20, 2021.

  1. Graysome

    Graysome

    Joined:
    Aug 13, 2020
    Posts:
    3
    Hello,

    I'm trying to make a drag function for one UI panel but because I use point and click movement for the character sometime the character move when I drag the panel even if i used EventSystem.current.IsPointerOverGameObject(). Didn't managed to find a pattern for this bad behaviour to reproduce it, just clicked and drag around randomly.

    I attached the drag and character controller script and also a gif with in game behaviour to understand better my problem.

    pic.png


    pic2.png

    ezgif.com-gif-maker (1).gif
    Any help will be appreciated.

    Thank you.

    PS. I noticed that if I change in player controller to Input.GetMouseButtonDown it work but I want cursive movement without clicking many times.
     
  2. ManuelSegura

    ManuelSegura

    Joined:
    Dec 12, 2015
    Posts:
    19