Hi! I'm a bit confused about what to use: there's Standard Usable UI that comes with a prefab and there's also Standard UI Selector Elements that is mentioned in the documentation.
What I want to achieve: I want a UI showing above a usable NPC when Player gets close to it.
Player has Proximity Selector and Selector Use Standard UI Elements and NPC has Usable component but what's next?
Standard Usable UI and Standard UI Selector Elements
Re: Standard Usable UI and Standard UI Selector Elements
Hi,
Now duplicate the Basic Standard Usable UI and move the duplicate into your own folder.
Then add an instance of the duplicate as a child of your NPC. When the Player gets close, the Proximity Selector will activate this GameObject.
Once you've confirmed that this works, you can customize your duplicate prefab and add instances to other NPCs.
Now duplicate the Basic Standard Usable UI and move the duplicate into your own folder.
Then add an instance of the duplicate as a child of your NPC. When the Player gets close, the Proximity Selector will activate this GameObject.
Once you've confirmed that this works, you can customize your duplicate prefab and add instances to other NPCs.
Re: Standard Usable UI and Standard UI Selector Elements
Hi!
For some reason it doesn't work. On play start the canvas of the Usable UI gets disabled and doesn't enable on approaching it. I see that in the Standard Usable UI there's Show() method where the canvas enables but maybe it doesn't get called for some reason. Probably worth mentioning that if I select Use Default GUI bool on Proximity Selector it indeed shows the sign on top of the screen so the problem is not in Proximity Selector but somewhere else.
For some reason it doesn't work. On play start the canvas of the Usable UI gets disabled and doesn't enable on approaching it. I see that in the Standard Usable UI there's Show() method where the canvas enables but maybe it doesn't get called for some reason. Probably worth mentioning that if I select Use Default GUI bool on Proximity Selector it indeed shows the sign on top of the screen so the problem is not in Proximity Selector but somewhere else.
Re: Standard Usable UI and Standard UI Selector Elements
Hi,
Does your player GameObject still have Proximity Selector and Selector Use Standard UI Elements components on the same GameObject (e.g., the player's top-level GameObject), and is the Selector Use Standard UI Elements enabled? The Selector Use Standard UI Elements is what tells the Standard Usable UI to show its canvas.
If you want to see a Standard Usable UI in action, open DemoScene1 and add the Basic Standard Usable UI prefab to Private Hart. Then play and run up to Private Hart.
Does your player GameObject still have Proximity Selector and Selector Use Standard UI Elements components on the same GameObject (e.g., the player's top-level GameObject), and is the Selector Use Standard UI Elements enabled? The Selector Use Standard UI Elements is what tells the Standard Usable UI to show its canvas.
If you want to see a Standard Usable UI in action, open DemoScene1 and add the Basic Standard Usable UI prefab to Private Hart. Then play and run up to Private Hart.
Re: Standard Usable UI and Standard UI Selector Elements
I finally got it to work! The thing was that I didn't include Standard UI Selector Elements in Instantiate Prefabs component.
Re: Standard Usable UI and Standard UI Selector Elements
Glad you got it working. Thanks for the update!