Happy new Year!
Thank you for your advice. It worked nicely.
Just one thing I could't figure out. The image now stays on the canvas where it is placed.
Is there a way to let the image stick with the npc. As it was with the text from the proximity selector I used before?
Many thanks
OnTriggerEnter combined with Button Press
-
- Posts: 106
- Joined: Tue Apr 05, 2016 9:37 am
Re: OnTriggerEnter combined with Button Press
Happy New Year!
Add a Usable Unity UI component to the NPC.
Look at Examples > Unity UI Examples > SF Example Scene for an example. The NPC named "Sergeant Graves" has a Usable Unity UI:
By using this component, you can place the NPC's world space canvas exactly where you want, and you can make each one unique. For example, the image for an NPC might be a chat bubble, while the image for a door might be a hand.
Add a Usable Unity UI component to the NPC.
Look at Examples > Unity UI Examples > SF Example Scene for an example. The NPC named "Sergeant Graves" has a Usable Unity UI:
By using this component, you can place the NPC's world space canvas exactly where you want, and you can make each one unique. For example, the image for an NPC might be a chat bubble, while the image for a door might be a hand.
-
- Posts: 106
- Joined: Tue Apr 05, 2016 9:37 am
Re: OnTriggerEnter combined with Button Press
Thank you. I ended up adding a button with a standard script, was easier then figuring out out to use the proper solution.
Re: OnTriggerEnter combined with Button Press
Fair enough. Those scripts are in a folder named "Supplemental" because they're not core scripts. It's not a case of proper vs. not-proper. They're just included as bonus content in case people find them helpful. But for a lot of cases it's just easier to write a simple script.