Getting integer value upon HUD button click (BP reference issue)

The reference needs to be set when the blueprint is spawned. For blueprint references setting the variable in the variable panel won’t work.

There are multiple ways to do this. A common way is this:

get all actors of class(puzzle block)> get a copy from array> set/promote to variable. Place this code in the beginplay or event construct or anywhere before you try to set the turn integer.

Now when you use the reference it should work, but if you have multiple puzzle blocks it might give you the wrong one. But that’s an easy fix if that is the case. If you have any issues I can make an example for you later.