Page 1 of 2

Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 12:44 pm
by HawkX
Since this is more of a followup question (because the other one was answered fully), I thought it best to make a new separate topic in case someone eventually search for something similar...

While the proximity selector is nice and all, I would like to put the "Press "X" to talk/loot/etc" Directly above the character or object as a little popup bubble... kinda like the bark/bubble system itself...

something like this :
https://dk135eecbplh9.cloudfront.net/as ... Button.jpg
(random image grabbed on google image)

Is there anyway to do that? :)

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 2:02 pm
by HawkX
I actually found this thread that "seems" to be asking the same thing! :)

I'll be reading and trying what is suggested over there...

https://www.pixelcrushers.com/phpbb/vie ... ity#p24480

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 2:29 pm
by HawkX
LOL sorry for the 3rd reply in a row... But I figured it was better than editing my post over and over...

Based on the previous thread, I was able to figure it out and get it to work... "mostly"

I made a duplicate of Basic Standard Usable UI,
Then removed all the TEXT i no longer needed,
The new prefab is basically just "Selector > Main Panel > Selection Panel"
The image to be displayed is in "Selection Panel"
Added the "Always Face Camera" which is awesome too...

I put this new prefab as a Child of my NPC, and it works, it displays the bubble above its "head"

HOWEVER, I tried having 2 NPC next to each other... each having a copy of the prefab...

And somehow, when I move to NPC2, its still NPC1 child/selector that gets enabled...

Isnt the proximity selector / selector use std elements supposed to check its own child first?

as Always, THANKS for your time :)

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 2:32 pm
by Tony Li
Hi,

Is it possible that the Proximity Selector is actually selecting NPC1 since they're close to each other?

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 2:41 pm
by HawkX
They both have very separate box collider trigger...

Unless the proximity is NOT using the box collider trigger?

I also noticed I made my prefab using a copy of "Basic Standard UI Selector Elements" instead of "Basic Standard Usable UI"

Not quite sure how it worked and why it worked :P as I think i cleaned it up too much now nothing shows up again! LOL

I'll delete it all and start again from scratch

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 2:51 pm
by Tony Li
HawkX wrote: Tue Apr 05, 2022 2:41 pmI also noticed I made my prefab using a copy of "Basic Standard UI Selector Elements" instead of "Basic Standard Usable UI"
That was probably the issue. The Proximity Selector may have found that instance of Standard UI Selector Elements and decided to use it for all Usable NPCs that don't have their own Standard Usable UIs.

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 3:20 pm
by HawkX
Yeah it working fine now :)

However, got a new "weird" issue... it seems like its using the camera gameobject position to determine if its "in the trigger zone" and not the character controller from the character...

If i rotate the camera upwards, the bubble prompt disappear...

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 4:05 pm
by Tony Li
Is the issue with the Always Face Camera component?

Did you add the Proximity Selector to your player character or to the camera? (It should be on the player character.)

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 4:45 pm
by HawkX
I actually added it to the NPCs like you suggested somewhere I think ;)

I just tried and removed the proximity selector AND selector use std assets from both NPC and put it on my character model itself...

Same thing...

Also tried disabling the "follow camera" script and it does the same thing...

If i move the camera from horizontal all the way to vertical, it shows up from 0 to 20 degree, then is hidden from 20 to about 70 ... and from 70 to 90 it displays again...

Re: Proximity Selector World Canvas?

Posted: Tue Apr 05, 2022 5:08 pm
by Tony Li
Try this setup:

- Player GameObject: regular collider, Proximity Selector, Selector Use Standard UI Elements

- NPC GameObject: trigger collider (a smaller regular collider is fine, too), Usable; child with Standard Usable UI component

As a test, on the Standard Usable UI GameObject try disabling the Always Face Camera component so we can eliminate that as the possibility of what's causing the strange appearance.