Hi! Sorry to bother you guys yet again. I was just wondering how would you anchor an AC menu (or UGUI), which is not for subtitles, over an NPCs head? like a small button and/or label which would just show up when you get near the NPC with an image of a button or a text with the word "
Talk", to let the player know they can talk to the NPC if they press said button?
I thought I should ask here first because, Ive seen AC has the option to position menus above the player or over the speaker, usually for subtitles, but I want this to happen regardless if the player doesn't speak to the NPC or if he doesn't have a hotspot or trigger, just like a bark, which can follow the NPC around if needed. So, I imagined there's some code already in AC which I can be used to do it. I already got covered the way to get things to run/happen on proximity but I'm unsure how I would reposition the AC menu to be above the NPC.
I've also thought of using a world space canvas as a prefab and put it in all NPCs, but that just feels a little less elegant, I would prefer it if the process was more dynamic (not to mention I may still have to connect the menus to AC somehow...).
Anyways, as usual, any advice would be greatly appreciated.
Comments
This can be an icon or a label (e.g. "Talk") that should correspond with whatever interactions are available on the NPC's Hotspot. The 2D Demo uses something similar when Hotspots are clicked on.
Failing that, you could also use a custom event to display your own Unity UI whenever you mouse-over a Hotspot. The OnHotspotSelect event is what you want - have a look at this tutorial on how to trigger it.