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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
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.