Page 1 of 1

Choice enables gameobject in next scene

Posted: Wed Oct 02, 2024 4:47 am
by Trashrat
Hi there,

I'm trying to impliment a system where a choice made in the dialogue will enable/disable a gameobject in the next scene, or even three/four plus scenes in advance. So far I have a boolean variable for what choice was made but now am trying to think what would be the best way to have the decision carry over to the next loaded scene. Any help in this woul dbe greatly appreciated.

Thank you

Re: Choice enables gameobject in next scene

Posted: Wed Oct 02, 2024 8:27 am
by Tony Li
Hi,

In the next scene, add a Dialogue System Trigger. Set its Trigger dropdown to OnSavedDataApplied. (OnSaveDataApplied works just like OnStart, except if you're coming from another scene or loading a saved game it also waits until any save data has been applied to the scene.)

Set Conditions > Lua Conditions to check the Boolean variable.

Then select Add Action > Set GameObjects Active/Inactive or OnExecute() UnityEvent (either is fine), and configure the action to activate/deactivate your GameObject.

Re: Choice enables gameobject in next scene

Posted: Wed Oct 02, 2024 1:03 pm
by Trashrat
Perfect thank you, that seems to be working great!

Re: Choice enables gameobject in next scene

Posted: Wed Oct 02, 2024 3:44 pm
by Tony Li
Glad to help!