Page 1 of 1

Best Way to Hide Proximity Selector

Posted: Fri May 28, 2021 8:20 pm
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!

Re: Best Way to Hide Proximity Selector

Posted: Fri May 28, 2021 8:27 pm
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.

Re: Best Way to Hide Proximity Selector

Posted: Fri May 28, 2021 8:48 pm
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.

Re: Best Way to Hide Proximity Selector

Posted: Fri May 28, 2021 8:50 pm
by Tony Li
If the player isn't intersecting a usable object, the Proximity Selector should automatically hide the "use message" UI.

Re: Best Way to Hide Proximity Selector

Posted: Fri May 28, 2021 8:59 pm
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?

Re: Best Way to Hide Proximity Selector

Posted: Fri May 28, 2021 9:14 pm
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?

Re: Best Way to Hide Proximity Selector

Posted: Thu Jun 03, 2021 10:18 am
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.