Override Selector UI per object

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
muffinsAKA
Posts: 1
Joined: Mon Aug 21, 2023 6:28 pm

Override Selector UI per object

Post by muffinsAKA »

Hello! Really loving this plugin so far. I'm fairly new to Unity but have figured most of it out at this point.

The one thing I'm struggling with is figuring out how to change the selector ui based on the object.

I've tried a lot of things I've googled and read here but nothing seems to work.

I've attached my default setup that works which is a player controller with a Selector + Selector Use Standard UI Elements and a sewer grate object that has a Dialogue System Trigger and a Usable component.

As you can see in the screenshot I modified the default selector UI and that works, but then I duplicated the prefab and edited a few things and have tried many things to get it to be used but I am not sure what the right way is.

I've tried:
  • Adding a "Tag specific elements" under the Player Controller's "Selector Use Standard UI Elements" and putting the duplicated prefab into it. I put it under the tag "interactable" and added that tag to the sewer grate object.
  • Doing the same as above, but making the duplicated selection ui prefab a child of the sewer grate object, as I saw this on a forum post
  • Tried the same idea but using layers instead of tags, but no avail.
I feel like I'm missing something fundamental here.

The one thing I can note is that even though it's failing to show up on screen when I use these methods, if I look in the hierarchy I can see the elements enabling and disabling when I'm in the interaction space vs leaving it so it seems to understand what I'm trying to get it to do.
Attachments
Selector Use Standard UI + Tags
Selector Use Standard UI + Tags
Unity_71hq09wQ1I.png (22.56 KiB) Viewed 140 times
default interaction before trying to use duplicated prefab selector ui
default interaction before trying to use duplicated prefab selector ui
Unity_ZzTP5JJINz.png (179.47 KiB) Viewed 140 times
sewer grate object
sewer grate object
chrome_kDHqprzNQ4.png (77.02 KiB) Viewed 140 times
Player Controller inspector
Player Controller inspector
Unity_CE85LR42SC.png (102.19 KiB) Viewed 140 times
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Override Selector UI per object

Post by Tony Li »

Add an instance to the scene. The Selector Use Standard UI Elements component doesn't automatically instantiate prefabs.

Here's an example scene:

DS_TagSpecificSelectorUI_2023-08-21.unitypackage

It's DemoScene1 except the computer terminal in the center of the room is now tagged "Respawn", and the Selector Use Standard UI Elements points to a different selector UI for the Respawn tag.
Post Reply