+1
Answered

How to get Gameobjects from other live scenes

yulaw2k 2 years ago updated 2 years ago 2

How do you get Gameobjects from other live scenes? 

I have 2 scenes. One for Code/Gameplay, another artist on the team use for the environment.

I want to access gameobjects from that scene from a stateMachine.

I thought I could create SceneVariables for that environment Scene. I drag and drop it into the variables under the tab Scene, then Environment Tab. 

When I run the statemachine it says "Variable Not Found"

This new multi scene view is somewhat new to the Unity workflow. If that does not work, how do you guys get variables from other scenes without finding gameobject by string.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+1
Answered

Hi Yulaw2k!

Sorry for the very late reply on this, I missed your thread. You can use Application Variables, which are shared across scenes. Or you can, indeed, find the Game Object with the Scene Variables component in your other scene, and use Get/Set Object Variable with this object as the target.

Thanks!!! So simple....I cant believe i missed that