Announcements, support questions, and discussion for the Dialogue System.
PayasoPrince
Posts: 104 Joined: Thu Jan 27, 2022 6:47 pm
Post
by PayasoPrince » Sun Jan 30, 2022 9:42 pm
Hello,
I need to be able to hide the ProximitySelectors "Name Text" & "Use Message Text" through script.
How can I do this through my Player GameObject that contains the ProximitySelector?
Is it something like this?
Code: Select all
"ProximitySelector" ..transform.GetChild(1).GetChild(0)
or is there a simpler way?
Tony Li
Posts: 21981 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Sun Jan 30, 2022 9:47 pm
If you disable the ProximitySelector component, it should automatically hide its UI elements.
PayasoPrince
Posts: 104 Joined: Thu Jan 27, 2022 6:47 pm
Post
by PayasoPrince » Sun Jan 30, 2022 9:56 pm
Hmm, the ProximitySelector script that is on my player?
Disabling it doesn't seem to also disable the UI
Unless you meant the ProximitySelector Prefab that is on my DialogueManager. If so, can you assist with how I can syntactically disable it?
Tony Li
Posts: 21981 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Sun Jan 30, 2022 10:32 pm
Disabling the ProximitySelector on your player should tell the SelectorUseStandardUIElements component on your player to hide the StandardUISelectorElements in your canvas.
PayasoPrince
Posts: 104 Joined: Thu Jan 27, 2022 6:47 pm
Post
by PayasoPrince » Mon Jan 31, 2022 11:35 am
Hello Tony,
That doesn't appear to be the case for me.
Code: Select all
"this(Player)".GetComponent<ProximitySelector>().enabled = false;
This is successfully disabling my ProximitySelector component but is not removing the UI.
Please see example below:
[removed]
Any assistance would be greatly appreciated.
Last edited by
PayasoPrince on Mon Jan 31, 2022 3:41 pm, edited 1 time in total.
Tony Li
Posts: 21981 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Mon Jan 31, 2022 12:07 pm
Sorry, I miswrote. To hide it, you can use:
Code: Select all
"this(Player)".GetComponent<SelectorUseStandardUIElements>().elements.mainGraphic.gameObject.SetActive(false);