Using Widget buttons to set Integer values

Hi there! I am expecting some problems trying to changing the current static mesh of an actor.

Changing static Mesh in an actor UE4 Blueprint

I followed this tutorial which worked perfectly for me, but in my case, I need to change the Integer value from my Widget buttons. Every button has to set an specific value of the integer, but the thing is that I can not find how to set the specific value for every button and send it to my actor blueprint.

This is the actor Bp with the integer id same as the video

Have any idea how to do this?

1 Like

The Construction Script runs following the Components list when an instance of a Blueprint Class is created. It contains a node graph that is executed allowing the Blueprint Class instance to perform initialization operations.

Try to use a function and pass the values to a variable and call the function which would update the values.

Hi, Wer! I really appreciate your reply, but I am still kind of confused about it. Do you have any documentation about how to do that?

A basic documentation about Construction Script:

You need create a Custom Event in Event Graph and call it like: “UpdateMesh”. After get a value for ObjectID and call Set Static Mesh with you new value. When you click at Button with Index in Widget, call your UpdateMesh.

Sorry for English, I attach images for understanding.


I hope I understood your problem correctly. :slight_smile:

1 Like

Wow! Now I understand. I will try that and I will keep you updated, thank you so much!

IT WORKED PERFECTLY! Thank you, thank you, thank you! :grin:

You’re welcome! Congratulations! :slight_smile: