Can anyone help me please with an accessed none error?

The error occurs at a branch after a macro. In the macro I am checking for left or right hand collisions from any one of three different characters player one chooses.

I have tried two different ways. One with a sequence.

And one coming out of a characters is not valid into the other get actors of class like a sequence.

Can anyone look at this and tell me if they something wrong or how to not have an error here? Thanks.

The issue comes from the fact that when your return value is used, then anything hooked to that OR is evaluated.
So basically if your first Get Actor Of Class returns something, then it will move on to the end of the macro and when fetching the return value if will get everything connected to the OR node, so basically everything in your graph including things that have not yet been executed.
You should look into function that would allow for multiple return node, or store in a local variable first and then return this local variable.

1 Like

Tried it with a function. The front is identical to the macro diagrams just multiple boolean outputs.
And placed an OR outside of the function.

Now the error seems localized to the return node of the function.

Any help or guidance here is appreciated, thank you.

What you should have is multiple Return Node, with a single boolean return.

The first Return Node hit will stop the function and return the right value without calling nodes from your other branches.

1 Like

The issue is you’re creating a function that returns values based on classes that may or may not exist. Currently, if all your valid checks fail, the function is still required to return a bool value based on values that are derived from an object that doesn’t exist. You can fix it by adding in local variables and only returning their resulting information. These local values are defaulted to false and will only return to true if your evaluation passes. Now, this exact node graph may not be what you want to do depending on your usecase but this will stop your issue.

2 Likes

Thanks @Sly.Sk and thanks @Mep_Joss for making that pic. You have the solution.

1 Like