0
\$\begingroup\$

Below, on event tick, I am initializing a map of images once, which works fine (remember we are in a graph for a widget blueprint here).

enter image description here

Z Cursor Images is the map of the images. The keys in the map are an enum, and I am adding first an image for the default cursor, and then an image for when the player is targeting an object that she can pick up.

Now, when I do the same in the construction script (Event Construct), it does not throw an error but later I cannot access the textures from the map. IsValid returns false for them...

So why is the map filled on tick but not on Event Construct? And how do I solve this?

\$\endgroup\$
1
\$\begingroup\$

In case you are running into a limitation that's specific to the Construction Script, you can also try other approaches. Either:

  • doing the initialization in Event Begin Play instead of the Construction script
  • providing the Z Cursor Images variable with default values that suits your needs instead of programmatically setting them at start

Cheers!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.