0

Enhanced Object Variable Window

Marshall Brooks 4 years ago updated 4 years ago 0

This is kind of an interesting usage of the Object Variables that I could find useful. This can also be a kind of advanced setting in Bolt editor preferences.


If you were to take the Hierarchy view of a Scene and it's GameObjects, but whenever scoped to a particular GameObject, reduce the Hierarchy down to purely nuclear connections (Parent-Child, no branches or leaves) that will be the base for what I'm referring to.

Another way to think of it is the breadcrumbs navigator, but purely as a scope specifier, not a navigation/GameObject selector.


Take the Object Variables panel in the Variables window, and along, say, the left edge of the panel, have the view of nesting from the GameObject that is selected in the hierarchy (for which the Object Variables panel would be showing it's variables typically), all the way back to the root GameObject.


You can then, by selecting a GameObject from the simplified hierarchy (the one suggested in the prior paragraph, I'll refer to it as the browser), view, edit, and use those variables in your graph. (Can be implemented without any changes to the Get/Set/Define Object Variable nodes by simply auto-populating the Object reference field on the node with whichever GameObject is selected in the browser).


I really feel like this could be a useful tool for scoping purposes (Kinda like cascading public variable access via Object Variable utilization, if that makes sense)


While I understand I can do this by setting the parent, grandparent ... etc, as GameObject variables for the Object wanting access to that object's variables, it feels clunky and bloated going that route, and provides more surface area for bugs to be introduced. 


Additionally, it's kind of intuitive to imagine a child having access to it's parent's variables, so this would be used by others if implemented, I figure. Having the browser tool there is to constrain Object variables, so that the window isn't cluttered with the parented variables, as well as retain the ability to have variables named the same thing with different values, attached to different GameObjects.


And a final note, a feature that is already implemented, but I don't imagine utilized often, is the ability to add the Variables component to any GameObject, even if it doesn't have a Machine component. It's a useful feature! And one I imagine could be showcased via the feature I suggest above.



Thanks for reading!

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