0
Not a Bug

Setting a graph variable of type transform w/o a reference doesn't seem to stick.

Joshua Galvin 2 years ago updated 2 years ago 2

I wanted a null transform variable on my graph but every time I set the type to transform it'd later become unset. 

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

Answer

Answer
Not a Bug

Hi Joshua,

That's normal and shouldn't be a problem. Let me explain:

Variables are not strongly typed. That means each of them is stored as only an "object". When you set the type to Transform but don't give it a reference, under the hood, this variable only has a "null" value of no particular type. The Bolt inspector will remember that you chose Transform for a little bit to allow you to assign a reference, but if you close it, it'll revert back to null. 

None of that explanation is important for you to understand really, because a "null transform" is just the same thing as a "null anything else". 

Let me know if that answers your question!

Answer
Not a Bug

Hi Joshua,

That's normal and shouldn't be a problem. Let me explain:

Variables are not strongly typed. That means each of them is stored as only an "object". When you set the type to Transform but don't give it a reference, under the hood, this variable only has a "null" value of no particular type. The Bolt inspector will remember that you chose Transform for a little bit to allow you to assign a reference, but if you close it, it'll revert back to null. 

None of that explanation is important for you to understand really, because a "null transform" is just the same thing as a "null anything else". 

Let me know if that answers your question!

+1

Cool, I'll try it out later today and get back to you if I encounter an issue.