Slate brush array (image array in UI widget) overlapping elements?

Hi there. I tried to find a solution to this for a long time before I decided to ask in the forums. I am trying to achieve a very basic UI image switch upon keypress: for example, when 1 is pressed I want to show an element of an image array in my UI. This is how I am trying to do it:

ss1

It is basically a weapon crosshair switch that I am trying to do. The above code works, however my crosshairs overlap with each other, and do not disappear. This might have a very simple solution but I am still a beginner and I could not figure a way out. How can I fix this? Appreciate all the help and tips!

Bump, help please!

I think it might be unclear what the intention here is. Hence no answers.

What’s the overall idea behind this? We select a weapon and the crosshair changes?

If you’re after a solution that fits right into your existing script, you may need to explain how the crosshair is drawn. The pure function at the top is bound to an image?

however my crosshairs overlap with each other, and do not disappear.

How many images are used for this then?

Hi! I’ve actually figured a method out. Instead of using the array I added multiple Images into the widget and started calling Set Visibility of the images when a key is pressed, not so efficient I believe however it works. Thanks for trying to help tho!

1 Like

It’s much more efficient actually! If you bind a function, it runs every frame instead… :eyes:

Good job!

Appreciate it mate. I actually didn’t know that it ran every frame! Good to know… Have a nice one.

1 Like