Same button to do different things at once

I couldn’t find an answer on the forums as I’m not sure how to search for this, but I’ve run into a bit of a problem.

I have a system that changes the images on a widget to display which character you’re playing as when you hit E or Q (three characters, cycle one way or the other). That’s all working just fine.

But then I went to set up physically switching characters (I did have to follow a tutorial), and it wasn’t working. After some messing around I found that the problem is that using the E or Q keys weren’t working because they were switching the widget images at the same time. Setting it to another button (say, R) the script worked fine and I could switch between characters but of course the images of which character would not change given they’re set to different keys.

How would I set it up so that pressing E or Q switched characters and images at the same time?

Hey @AmaiTrick!

This is doable, but knowing that you’ve done so much already any advice would be hard to give as there are so many ways to go about it. The main thing is that you need to trigger the UI swap as part of the same button press as the character, on the same execution line. If you bring us some code we will likely be able to help more accurately!

Thank you, this actually helped me figure it out when you mentioned it being off the same button press rather than triggering it in two separate places!

I had to use a sequence in the widget blueprint and then cast to the player controller (where I have the code to swap player) and now it works!

Dunno why I didn’t think of that but thank you for the reply, it helped!