Search Issue Tracker
Won't Fix
Votes
9
Found in
5.0.1f1
Issue ID
686693
Regression
No
IPointerExitHandler.OnPointerExit not triggered if object below pointer is destroyed or disabled
Reproduction steps:
1. Open the user project "UnityBugs"
2. Open the scene "HoverBug"
3. Enter play mode
4. Hover the UI panel in the scene, with the pointer. Script on the panel logs messages OnPointerEnter and OnPointerExit
5. Click the panel, it will be destroyed
6. Notice that OnPointerExit was not called
Notes:
1. OnPointerExit is not called on the object that becomes inactive
2. OnPointerEnter is not called when an object becomes active under the pointer, until the pointer is moved
Comments (3)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on JobQueue::HasJobGroupIDCompleted when closing the Editor while in Play mode on a specific project
- In "Preferences" section the “SpriteShape” menu item, the details page title “SpriteShape”, and “ControlPoint” entries are displayed as code strings rather than formatted UI strings
- Errors thrown constantly when Virtual Offset Debug is enabled and lighting was baked on AMD machine
- Persistent Memory Leak when reloading domain and using Distance-based Ghost Importance
- HDRP project doesn't render in standalone player when using High stripping
stargamingentertainment
May 09, 2020 03:31
FIX Example:
If you have a script that implements from OnPointerEnter and OnPointerExit, attached to an object in the scene.
what ever logic you have in the OnPointerExit, you can either execute that code or method in the
OnDestroy()
OnDisable()
aswell as in the OnpointerExit
e.g. i had this problem with a tooltip being showed. and i had the hide tooltip method being executed in the OnPointerExit.
when the object was deleted the tooltip stayed up, which looked stupid.
so i also called that hide method in destory and disable, so it will always get called
Hope it helped
Ricky
DFSko
Sep 25, 2015 12:37
i have a button with code
public void OnPointerClick(PointerEventData eventData)
{
Application.ExternalEval("window.open('/','_blank')");
}
after new tab opened, clicks on any place of document open new tabs
emayberry
Jun 19, 2015 14:12
I got around this issue by testing for the cursor being over the game object in OnEnable/OnDisable, but it would be awesome for OnPointerEnter/Exit to work as expected when things are instantiated or destroyed under the cursor.