Do the MonoBehavior Scripts "OnMouseEnter/Over/Exit" only work for game objects that they are attached to?
Hi, I've been trying to get objects in my scene to "highlight" by changing the material to a different color when my mouse hovers over them. I cam across the scripts "OnMouseEnter()" "OnMouseOver()" and "OnMouseExit()". I'm using them in a script component on a canvas meant for Raycasting. I thought these functions would be called whenever I hovered over any collider within my scene, but as I go through the API it is beginning sound like these scripts only work for the game object they are attached to. Is this the case?
Is there a better way to go about making assets highlight when I hover over them while the application is running?
Your answer
![](https://koobas.hobune.stream/wayback/20220613045547im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
3d space heading/volocity direction prediction and mp/s hud,code? 1 Answer
Is it possible to make multiple prefabs out of a single prefab for use in the map editor? 0 Answers
dialogemanager Error 0 Answers
Android how to wake up the screen when in stand by 1 Answer
Static method performance vs non static 0 Answers