Hello,
I am trying to activate a GameObject, part of my Canvas (RectTransform) after the value of a variable is equal to true.
First of all I set the new variable in my database.
Then I have a game objects which controls the game with the Dialogue System Trigger component attached. So, after the action "Start Conversation" with the actual dialogue, I place a "Set GameObject Active/Inactive". I put there my Canvas->Gameplay object, but the script just takes out the Rect Transform component and I suppose it activate/deactivate it.
I would like to enable/disable the whole GameObject, is it possible with this component?
Activate GameObject on variable condition
Re: Activate GameObject on variable condition
Hi,
The "Set GameObjects Active/Inactive" action should activate the entire GameObject (as long as the Condition is true).
Did you perhaps use the "Set Components Enabled/Disabled" action instead?
The "Set GameObjects Active/Inactive" action should activate the entire GameObject (as long as the Condition is true).
Did you perhaps use the "Set Components Enabled/Disabled" action instead?
Re: Activate GameObject on variable condition
Hello,
I used Set Game/Objects, pass you a screenshot: https://ibb.co/pK3QXS9
I used Set Game/Objects, pass you a screenshot: https://ibb.co/pK3QXS9
Re: Activate GameObject on variable condition
Thank you for posting the screenshot. The Dialogue System Trigger's Set GameObjects Active/Inactive action will only check the Condition once, when the trigger starts. It will not continuously check it during the conversation.
If you want to set the GameObject active at the point in the conversation that you set a variable true, use the SetActive() sequencer command in the dialogue entry node where you set the variable true.
However, I see that the variable is named "DialogueEnded". If you want to set "Gameplay" active when the conversation ends, add a Dialogue System Events component. Configure the OnConversationEnd event to activate Gameplay. This way you don't have to use any variables.
If you want to set the GameObject active at the point in the conversation that you set a variable true, use the SetActive() sequencer command in the dialogue entry node where you set the variable true.
However, I see that the variable is named "DialogueEnded". If you want to set "Gameplay" active when the conversation ends, add a Dialogue System Events component. Configure the OnConversationEnd event to activate Gameplay. This way you don't have to use any variables.
Re: Activate GameObject on variable condition
the last solution was the best, thank you very much! As always you are the best.
Re: Activate GameObject on variable condition
Happy to help!