Proximity selector question

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chrislow19
Posts: 34
Joined: Mon Dec 30, 2019 4:26 pm

Proximity selector question

Post by chrislow19 »

Hi Tony, quick question. My proximity selector is showing up in inconsistent spots on my NPC's, my human NPC's seem to have it in the right place (on top of their heads), but my critters seem to have them extremely far above their heads. I've adjusted colliders and pivot points on individual sprites, but adjusting the canvas position rearranges the selector for everyone, which is what I don't want.

So what's the universal point the proximity selector is looking at to decide where it will place itself? And is there a way to adjust the selector placement individually on a character if I'm not happy with it?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Proximity selector question

Post by Tony Li »

There's a component called SelectorFollowTarget -- but I don't think it fits your case. It positions the selector UI a fixed offset above the NPC's origin (e.g., 2 units up from the origin).

Since your NPCs are different heights, use a StandardUsableUI instead. The quickest way to get started is to locate the prefab Plugins / Pixel Crushers / Dialogue System / Prefabs / Standard UI Prefabs / Templates / Basic / Basic Standard Usable UI. Add it as a child GameObject to the NPC. Then play your scene to make sure it appears. In the screenshot below, I added it to Private Hart in DemoScene1:

standardUsableUI.png
standardUsableUI.png (227.79 KiB) Viewed 555 times

Then position it where you want it (e.g., move it up so it doesn't overlap Private Hart) and customize its appearance. After you customize its appearance, you can save it as a new prefab to make it easier to add to other NPCs.
chrislow19
Posts: 34
Joined: Mon Dec 30, 2019 4:26 pm

Re: Proximity selector question

Post by chrislow19 »

Hi Tony, that seemed to do the trick! It took some tuning to match it with the selector I use on everything else, and I turned it into an original prefab to use on NPC's. Thanks for the help!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Proximity selector question

Post by Tony Li »

Happy to help!
Post Reply