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

OnPointerEnter problem in unity 5.3.0 and 5.3.1

Discussion in 'UGUI & TextMesh Pro' started by Rnd--, Dec 28, 2015.

  1. Rnd--

    Rnd--

    Joined:
    Sep 27, 2012
    Posts:
    30
    Hi guys, I'm making virtual button for my unity game in android
    and I believe this is an issue in 5.3.0 and its not repaired in 5.3.1 but its working well in 5.2.x

    script is like this
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.EventSystems;
    4. using UnityEngine.UI;
    5. using enumeration;
    6.  
    7. public class buttonScript : MonoBehaviour, IPointerUpHandler, IPointerDownHandler, IPointerExitHandler, IPointerEnterHandler{
    8.     private Text debugText;
    9.     public void Start()
    10.     {
    11.         debugText = GameObject.Find ("Canvas/debugText1").GetComponent<Text> ();
    12.     }
    13.  
    14.     public void OnPointerUp (PointerEventData eventData)
    15.     {
    16.         debugText.text = "The mouse up";
    17.     }
    18.  
    19.     public void OnPointerExit (PointerEventData eventData)
    20.     {
    21.         debugText.text = "The mouse exit";
    22.     }
    23.  
    24.     public void OnPointerDown (PointerEventData eventData)
    25.     {
    26.         debugText.text = "The mouse down";
    27.     }
    28.  
    29.     public void OnPointerEnter (PointerEventData eventData)
    30.     {
    31.         debugText.text = "The mouse enter";
    32.     }
    33. }
    the problem is like this
    - finger touch the button in android screen -> call OnPointerDown, then OnPointerEnter.
    - take your finger away from android screen -> call OnPointerUp and then keep calling OnPointerEnter
    so its make my character keep moving :(

    its seems OnPointerEnter only can remove by OnPointerExit, for Example :
    - finger Touch the button -> call OnPointerDown, then OnPointerEnter
    - move your finger from the button but still touch the android screen -> call OnPointerExit, and OnPointerEnter Stop

    anyone feel the same ?? please Unity.. solve this problem :(
     
  2. LTLeonardo

    LTLeonardo

    Joined:
    Nov 13, 2015
    Posts:
    20
    HELP!

    I'm also having the same problem :(
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,851
    Anyone created a bug report?
     
  4. LTLeonardo

    LTLeonardo

    Joined:
    Nov 13, 2015
    Posts:
    20
    PROBLEM SOLVED!

    Within "EventSystem" added "Touch Input Module" Simply check the flag "Force Module Active" :D
     
    karl_jones likes this.
  5. Trav3l3r

    Trav3l3r

    Joined:
    Sep 16, 2014
    Posts:
    60
    Just to add to this, I have submitted a case report that sounds a lot like what you describe here (see this thread
    http://forum.unity3d.com/threads/unity-5-3-0f4-touch-bug.372925/)

    I have tested your solution and it does appear to solve the problem. However, the thing is that the Touch Input is no longer needed. (from the 5.3 release notes: UI: TouchInput module is no longer needed. Standalone is the only required module to get both touch and mouse/ keyboard events). So your solution, while seemingly effective probably shouldn't be used as a final solution.

    It would be nice though if a Unity rep could confirm this ;)
     
    Hanz-Hansal likes this.
  6. Rnd--

    Rnd--

    Joined:
    Sep 27, 2012
    Posts:
    30
    force module active not help :(
    Im already submit case and got number 762332
    I hope Unity can solve the problem :)
     

    Attached Files:

  7. PedroGV

    PedroGV

    Joined:
    Nov 1, 2010
    Posts:
    415
    The workaround that works for me is to deactivate the Standalone Input Module and to activate the Touch Input module (no need to force it).
     
    ChicoDorado and 3dpowermax like this.
  8. 3dpowermax

    3dpowermax

    Joined:
    Sep 9, 2013
    Posts:
    110
    Thank you "PedroGV" , it's work form me :)
     
    PedroGV likes this.
  9. ChicoDorado

    ChicoDorado

    Joined:
    Sep 13, 2016
    Posts:
    1
    The solution posted by PedroGV worked for me too, thank you :).
     
    PedroGV likes this.