Display GameObject on Hover? [SOLVED]

I am creating a Start menu for my game, and I am wondering if there is a way I can display a Text object when hovering over a UI Button? If so, how would I go about doing this?

Much appreciated.

1.) Add Event Trigger to UI Component
2.) Click Add New
3.) Add PointerEnter
4.) Drag the UI Text and set the function for SetActive and pass true

Expand upon this and add also the PointerExit to deactivate it aswell if this is what you are aiming for.

Hope this helps.

2 Likes

This is really helpful, thank you. I am very new to this, but what do you mean by “pass true?” That’s the only part I am stuck on. Thank you!

edit: Just because the dropdown gives me the GameObject.SetAvtive(bool) option - how do I set that to true?

A Toggle should pop up check the box for “True” leave it unchecked for “False”

1 Like

Oh, that’s the check box. Totally works. Thank you!!!

1 Like

Glad it helped :slight_smile:

1 Like

You can also do this via script by implementing the various interfaces on your own MonoBehaviour.

Yeah you could or just use what Unity UI team has already built. I think its much easier and possibly more optimized. But hey to each his own.

Optimisation is identical, or better. This is the same method Unity uses inside the EventTrigger. Its just a matter of preference.

The EventSystem is very powerful, and has been somewhat overlooked in the UI hype.