Last active
May 3, 2023 10:18
-
-
Save unitycoder/041fc2cde8d95f1473af0809fce43679 to your computer and use it in GitHub Desktop.
Check if mouse is over UI element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (eventSystem.IsPointerOverGameObject()) return; | |
| if (eventSystem.currentSelectedGameObject != null) return; | |
| // this works with Oculus vr also: | |
| if (EventSystem.current.IsPointerOverGameObject()) return; | |
| if (EventSystem.current.currentSelectedGameObject != null) return; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://forum.unity.com/threads/canvas-group-not-blocking-raycasts-even-when-option-is-enabled.557584/