1
\$\begingroup\$

In Unity Visual Scripting, I'd like to check to check if a Scriptable Object has data in it or not. So to do that, I tried using a Null Check node on the data directly:

enter image description here

You can clearly see that there's a Scriptable Object in there, but the Null Check is triggering the Null branch.

I then cast the Scriptable Object into a variable before I ran the Null Check, to make sure that wasn't the issue:

enter image description here

That still seemed to trigger the wrong branch. So I added a "Wait Until Next Frame" node, but got the same result.

I then wrote a subgraph called "Null Check Using Equality" which passed in an Object input and used an Equal node to check it against null. enter image description here

Again, the wrong branch was triggered.

I think I must be misunderstanding something fundamental here. Any ideas on what it could be?

\$\endgroup\$
1
  • \$\begingroup\$ A followup note: I ended up adding an enum to my Scriptable Object to specify whether or not one of the variables had a Scriptable Object assigned to it or not. So then I can just check the enum instead of directly referencing the variable and checking if it's null or not. A kludge and unrelable, but I couldn't figure out a way to solve this issue! \$\endgroup\$ Commented Oct 11, 2024 at 0:39

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.