Proximity Selector World Canvas?

Announcements, support questions, and discussion for the Dialogue System.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Proximity Selector World Canvas?

Post 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? :)
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Proximity Selector World Canvas?

Post 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
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Proximity Selector World Canvas?

Post 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 :)
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Proximity Selector World Canvas?

Post by Tony Li »

Hi,

Is it possible that the Proximity Selector is actually selecting NPC1 since they're close to each other?
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Proximity Selector World Canvas?

Post 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
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Proximity Selector World Canvas?

Post 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.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Proximity Selector World Canvas?

Post 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...
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Proximity Selector World Canvas?

Post 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.)
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Proximity Selector World Canvas?

Post 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...
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Proximity Selector World Canvas?

Post 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.
Post Reply