+1
Answered

Can't Access GameObject in scene hierarchy

Ian Marshall 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 1

Hi


Please see the screenshots below which I think illustrate my issue.


In short, I have 2 GameObjects each with a State Machine.  In the the transition I have a custom event unit, when I try to change the GameObject (using the little circle next to the GameObject field) in one case I get the option to pick an asset or look at objects in the scene hierarchy.  On the other I ONLY get the option to look at the assets ???

I need to access the GameObjects in the Scene Hierarchy

Could anyone explain top me why the 2 are different please?

Thanks in advance

cheers

Ian


Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED

thankyou, yes.

Obvious when you put it like that, I just couldn't see it until you pointed it out.

Cheers

Ian

Satisfaction mark by Ian Marshall 3 years ago
+2
Answered

Hi there!

It seems that your graph is stored on a macro. Macros cannot access scene objects, because they do not belong to a scene. The solution is to use an object variable and assign your scene object to it, then get the content of that variable in your graph.