How to change image in the widget based on the player integer variable?

I have an integer variable that represents the number of limbs the player have. When player loses a limb, the number in the integer decreases by 1, and with each new number i want a picture on the widget change too, so if integer is at 5, then the little person on the pic has all limbs; if the number is 4, then the image widget should pick up the next image with one limb missing an show that instead, and so on and so forth.

How would i go about implementing it?

You can set the image in the widget. First make your image a variable by ticking the box right top corner in the design tab:

This is an image button. Using a simple image will be similar.

Now you can use the image in the graph tab of the widget. I made a simple node system for it. It may look a bit different for a normal image but the principle is the same.

  • Get your character and the variable from it

  • The Select node can choose an image based on the INT value. You can add pins if you have more than 2 images.

  • Set the style of the image.

This is just one of many ways to do it. Hope it gives you the right direction.

1 Like

Thank you so much, you’re a life saver!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.