Applying 'Selector Follow Target' to one of the Multiple selector UIs

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ryu
Posts: 7
Joined: Fri Nov 13, 2020 4:10 am

Applying 'Selector Follow Target' to one of the Multiple selector UIs

Post by ryu »

Hi,

In my game, there is three type of selector UI - for usable, talkable npc, and others(default). Each one is identified by a tag, so I set up Selector Use Standard UI Elements component like this:
SelectorUseStandardUI.png
SelectorUseStandardUI.png (30.89 KiB) Viewed 343 times
And also I want to "USE" Selector UI is showing on the top of the object, adding Selector follow target component to PlayerObject which has proximity selector. All selector UIs are drawn on the Screen space overray canvas.


When I ran game, the main panel of the selector UI for 'USE' is activated when the player character move to near an object tagged 'USE' was active, but the UI did not follow the target object. It is fixed in the center of the screen. When I checked up the Rect transform position of each Selector UI in the hierarchy, only the position of the 'NPC' Selector main panel (disabled at this time) was changed, and for the other two, 'USE' and 'DEFAULT' did not change. It looks like Selector follow target is updating position of first instance of selector UI Element only.

Is there a good way to apply a 'selector following target' to only one of multiple UI elements? I need help.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Applying 'Selector Follow Target' to one of the Multiple selector UIs

Post by Tony Li »

Hi,
ryu wrote: Mon Aug 02, 2021 5:21 amIs there a good way to apply a 'selector following target' to only one of multiple UI elements? I need help.
Not currently. In version 2.2.19, I'll update SelectorFollowTarget to make sure it updates the current graphic, not just the main graphic, in case it's using a tag-specific or layer-specific graphic.

To only follow the usable for one type of UI element, you could turn the "USE" UI into a world-space Standard Usable UI prefab (see the 'Basic Standard Usable UI' prefab for an example) and add an instance of the prefab to the usable. That will work right now, without having to wait for 2.2.19.
ryu
Posts: 7
Joined: Fri Nov 13, 2020 4:10 am

Re: Applying 'Selector Follow Target' to one of the Multiple selector UIs

Post by ryu »

Hi,

Basic Standard Usable UI works nicely. I'm also looking forward to next patch.

Thank for help!
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Applying 'Selector Follow Target' to one of the Multiple selector UIs

Post by Tony Li »

Glad to help!
Post Reply