Variable doesnt set

What I want to do is set a variable in a other blueprint and then print it on the screen
But it just keeps printing its default value instead of the value it should be set to

I would be very glad if someone could help me with this problem

  • you do not need to cast, you already know the object type

Think of the order of operation here:

  1. Spawn object
  2. Print in the Construction Script
  3. Set the variable

Essentially, you Print it too early, before the variable is set. But the variable is set correctly judging by the script, so everything should work OK later on anyway.


If you want to update the ID var earlier and use it in the Construction Script, flag the ID var as Instance Editable and Expose on Spawn in the Details panel. Refresh the Spawn Actor from Class node (right click) and you’ll see an extra pin that can be used to pipe the data in before the Construction Script executes:

That made it work
Thanks