Best Way to Hide Proximity Selector

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Best Way to Hide Proximity Selector

Post by cptscrimshaw »

Hi Tony,

I have a bunch of instances where I want to hide the proximity selector, which I'm using extensively (i.e., when a UI menu is opened, during a conversation, during a timeline cutscene, etc.). The selector is in a higher layer than most other things for a variety of reasons, so I can't just put it in a lower layer for UI stuff. I have tried a few ideas, like disabling the component on my player, but none of them seem to work consistently, and I'm running into an issue where the selector will often just stay on the screen and follow my player around :)

Hoping you can offer a best practice here; I searched the forum pretty extensively and didn't find a good solution.

Thanks!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Way to Hide Proximity Selector

Post by Tony Li »

Hi,

Disabling the Proximity Selector component should do it. Are you sure it's staying disabled?

Does the Proximity Selector's GameObject have a Selector Use Standard UI Elements component? If not, try adding one.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Best Way to Hide Proximity Selector

Post by cptscrimshaw »

Yeah, it has a Standard UI Selector Elements component. Maybe I'm just re-enabling it through garbage code :) I'll look into it.

Is there a way to code something like "If the player isn't next to a usable object -> hide selector" type of thing I could do? I'm turning it on and off so frequently that a catchall would be helpful.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Way to Hide Proximity Selector

Post by Tony Li »

If the player isn't intersecting a usable object, the Proximity Selector should automatically hide the "use message" UI.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Best Way to Hide Proximity Selector

Post by cptscrimshaw »

Hmmm - that's the issue I'm running into with it staying on screen in certain circumstances and following the player around. I'm 99% confident I don't have anything running that would continue to enable it. Just checked my code, and I'm only enabling it in a few places that would never be called more than once.

Any ideas on what I could check?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Way to Hide Proximity Selector

Post by Tony Li »

You could try the Selector/ProximitySelector patch from April 18 -- or, for convenience, here's a fresh export:

DS_SelectorPatch_2021-05-28.unitypackage

(Future readers: If you're using DS 2.2.17 or above, don't use this patch. It's for DS 2.2.16 and earlier.)

If that doesn't help, can you send a reproduction project to tony (at) pixelcrushers.com?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Way to Hide Proximity Selector

Post by Tony Li »

Thanks for sending the reproduction project. I sent a follow-up email. The main thing to change is to set the selector UI's Animator's Update Mode to Unscaled Time so it can play the hide animation while Time.timeScale is zero.
Post Reply