In my voxel game, much like other voxel games, you use the mouse to add or delete blocks in the world.
When the pause menu or other UI elements are on screen, I don't want the click (used for returning back to the game) to go through and also add or delete a block in the world.
So, I use IsPointerOverGameObject() to determine if the cursor is over an event object. If it is, I don't cast the ray into the world.
The problem is, I overlay a cursor icon over the hidden/locked cursor while in...
IsPointerOverGameObject - Ignoring Some Objects
When the pause menu or other UI elements are on screen, I don't want the click (used for returning back to the game) to go through and also add or delete a block in the world.
So, I use IsPointerOverGameObject() to determine if the cursor is over an event object. If it is, I don't cast the ray into the world.
The problem is, I overlay a cursor icon over the hidden/locked cursor while in...
IsPointerOverGameObject - Ignoring Some Objects