UI and 3d raycast crossover solution
I am making an isometric point and click game that uses code like: Physics.Raycast(interactionRay, out interactionInfo, Mathf.Infinity) to get mouse interactions with the 3d objects. But now i have a intractable HUD i am finding i need a different set of options to deal with that. For example i want "on hover" or mouse over tooltip functionality to work if the player hovers on a 3d game object or a button in the HUD UI.
Is there any system where i can have all the pointer functionality like hover, mouse enter, etc. that gives the info for the first object hit regardless of UI or 3d object and my code can decide how to handle each case?
Graphic raycasters blocking objects can be set to All which sounded promising but doesn't seem to do anything. Maybe i am using it wrong?
Answer by douglassophies · Aug 31, 2017 at 12:47 PM
Problem not solved but closer: https://www.youtube.com/watch?v=EVZiv7DLU6E
Frustratingly, the question in the comments comes close but the non-answer seems to be accepted (unless its an answer i do not get)
Raphael Cabrera: If I have hundreds of clickable objects, I would have to implement a check on the mouseUp function of every single one of them?
Kiwasi Games: If you use OnMouseUp, then yes. This is one of the reasons I would suggest moving away from OnMouseUp. Ultimately IPointerClickHandler with a PhysicsRaycaster is more maintainable.
Your answer
![](https://koobas.hobune.stream/wayback/20220612133444im_/https://answers.unity.com/themes/thub/images/avi.jpg)