Uploaded August 2021 | Updated September 2026, 2 weeks ago
#unitytooltip #unityhint
Hi! In this video I show you a simple way to add a kind of tooltip to your game. You point to a game object with a mouse and a tooltip with its name appears.
I play games here - twitch.tv/zzotoff
You are very welcome :-)
Thank you)
Project Here drive.google.com/file/d/1ZqmxBPBEkEUl8HDUixZbw6-ntzC1TVQO/view?usp=sharing
I add an apple a carrot and a pear to the scene. Apple goes here. Pear goes here. Fruits and vegetable need colliders to detect mouse pointer. I select all of them and add a box collider. Set it as a trigger. I need a text for my tooltip. Right click on hierarchy and create new UI text. Rename it as tooltip. Double click to focus on it. Put it about here. Once canvas is created I prefer to set its scale mode to scale with screen size. I edit tooltip object like so. Put it here. Make font bigger. Make object bigger. Put it here. Align it in the middle. Change color. Ok. I don’t need any text initially so I remove it. Now lets see the script that helps to control everything. It’s Plant script which is pretty simple. Here I have tooltip text which will be assigned in inspector. OnmouseEnter method fires up when the mouse pointer is above an object. When it happens tooltip text shows a name of that game object. When the mouse leaves an object (OnmouseExit method is invoked) tooltip text shows nothing. I select all of my plants and add this script to them. Now I need to assign tooltip text. Make sure all of plants are selected and D&D tooltip into this slot. Now I can hit play and see how it works. No text initially. Once mouse pointer is over an object tooltip appears and shows its name.
#unitytooltip #unityhint
Hi! In this video I show you a simple way to add a kind of tooltip to your game. You point to a game object with a mouse and a tooltip with its name appears.
I play games here - twitch.tv/zzotoff
You are very welcome :-)
Thank you)
Project Here drive.google.com/file/d/1ZqmxBPBEkEUl8HDUixZbw6-ntzC1TVQO/view?usp=sharing
I add an apple a carrot and a pear to the scene. Apple goes here. Pear goes here. Fruits and vegetable need colliders to detect mouse pointer. I select all of them and add a box collider. Set it as a trigger. I need a text for my tooltip. Right click on hierarchy and create new UI text. Rename it as tooltip. Double click to focus on it. Put it about here. Once canvas is created I prefer to set its scale mode to scale with screen size. I edit tooltip object like so. Put it here. Make font bigger. Make object bigger. Put it here. Align it in the middle. Change color. Ok. I don’t need any text initially so I remove it. Now lets see the script that helps to control everything. It’s Plant script which is pretty simple. Here I have tooltip text which will be assigned in inspector. OnmouseEnter method fires up when the mouse pointer is above an object. When it happens tooltip text shows a name of that game object. When the mouse leaves an object (OnmouseExit method is invoked) tooltip text shows nothing. I select all of my plants and add this script to them. Now I need to assign tooltip text. Make sure all of plants are selected and D&D tooltip into this slot. Now I can hit play and see how it works. No text initially. Once mouse pointer is over an object tooltip appears and shows its name.






