Page 1 of 1

Image/Icon above object for Proximity Selector

Posted: Fri Apr 16, 2021 4:39 pm
by RetroVertigo
I wanted to see if I could have an icon or image above an NPCs head when close enough to talk to them. I know I can have a Use Message with Proximity Selector, but is there a way to use that to have an image or icon above the GO/NPCs head? I appreciate any help or insight I can get on this.

Re: Image/Icon above object for Proximity Selector

Posted: Fri Apr 16, 2021 5:39 pm
by Tony Li
Hi,

Yes. Add an instance of the 'Basic Standard Usable UI' prefab to the NPC. Then customize its appearance.

Re: Image/Icon above object for Proximity Selector

Posted: Fri Apr 16, 2021 9:18 pm
by RetroVertigo
Thanks for the reply! Do I just need to add the Basic Standard UI prefab as a child? Is there any documentation on the prefab or usage like this?

Re: Image/Icon above object for Proximity Selector

Posted: Fri Apr 16, 2021 9:26 pm
by Tony Li
Hi,

Set up everything else as before, where it shows the use message at the top of the screen.

Then add an instance of the 'Basic Standard Usable UI' as a child of the NPC. You don't need to do anything else. The Proximity Selector will check if the NPC's hierarchy has a (Basic) Standard Usable UI. If so, it will show it instead of showing the use message at the top of the screen.

Re: Image/Icon above object for Proximity Selector

Posted: Sat Apr 17, 2021 2:29 pm
by RetroVertigo
OK, so I tried that and it is still only showing the message at the top of the screen, BUT if I enable the Canvas on the Basic Standard Usable UI prefab, then it appears. Should this be enabling automatically or should I be adding something in my code for it? I do have that message that the scene is missing an event system. Maybe that is the issue?

Image

Re: Image/Icon above object for Proximity Selector

Posted: Sat Apr 17, 2021 2:54 pm
by Tony Li
Hi,

Add a 'Selector Use Standard UI Elements' component to the GameObject with the Proximity Selector if it doesn't already have one.

The EventSystem warning isn't the issue. That's just letting you know that the Dialogue System is adding an EventSystem because the scene doesn't have one. The dialogue UI uses Unity UI, which requires an EventSystem for interaction.

Re: Image/Icon above object for Proximity Selector

Posted: Sat Apr 17, 2021 4:24 pm
by RetroVertigo
That did the trick. Thanks SO MUCH! this asset is really awesome. I am still working through some other stuff, so I might have other questions. Again, thanks for sticking with me through this!

Re: Image/Icon above object for Proximity Selector

Posted: Sat Apr 17, 2021 4:52 pm
by Tony Li
Glad to help! :-)