Page 1 of 1

Proximity selector question

Posted: Sun Jan 26, 2020 10:14 pm
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?

Re: Proximity selector question

Posted: Mon Jan 27, 2020 9:31 am
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 558 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.

Re: Proximity selector question

Posted: Mon Jan 27, 2020 5:18 pm
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!

Re: Proximity selector question

Posted: Mon Jan 27, 2020 7:21 pm
by Tony Li
Happy to help!