Fix OnPointerEnter and OnPointerExit firing twice
tracked
zSkull162
Using an EventTrigger component on a UI element, and telling it to SendCustomEvent (string) to an UdonBehaviour will cause the event to fire twice.
I tested this by having an Event Trigger on one button sent _OnPointerEnter to an UdonSharpBehaviour named "HoverTest," and a second button send _OnPointerExit to the same UdonSharpBehaviour.
Both of those methods had Debug.Logs in them, and when testing in unity with Clientsim, I only saw the messages once, as expected. However, testing in-VRChat, the logs showed up doubled for every event that was sent. I added some code to toggle a cube initially, and I thought these events just didn't work in VRChat, but it was actually getting enabled and disabled in the same frame, due to the duplicated events.
This is a very annoying bug(?), as it means any Udon you make related to these events will have to account for the event being sent twice. This makes it really annoying to create toggles or incrementing counters based on hovering a UI element.
Log In
StormRel
tracked