Variable goes dead btwn one function and another??

  1. Set a variable from the “Hit Actor” output
  2. print the variable afterwards in the same function
  3. use, and print, the same variable in the next function

Print variable from first function ‘select box’ - shows it has what I want ( box1, box2, etc. )

Print variable from the second function ‘move box’ ; blank with the error “Accessed None trying to read property (same variable)”

Am I insane or are non-local variables supposed to be usable in different functions of the same BP. It’s bad enough trying to get variables from one BP to another, but this is even more ridiculous.

Trying to move different instances of the same BP ( game pieces on a board ) should not be such an abject nightmare. Everything I try has some problem that makes it impossible.

Tried “Hit Component”, “Hit Item” and “Element index”, searched poured thru hours of yt videos, maybe BP is just BS

This works fine. Attach script if you need help with something specific. Once you’ve assigned a valid value to a reference variable:

You’re free to use this (Hit Actor) variable in any functions / macros / graphs / events of this actor - until you dereference Hit Actor yourself or it becomes Destroyed, which you’d need to do manually, too (or play with object lifespan).


It’s bad enough trying to get variables from one BP to another, but this is even more ridiculous.

Passing data between objects is the very core of OOP; consider:

For all your comm needs!

1 Like

1 Like