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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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.