Same button press triggering two variables at the same time

thanks for reading!;D

hey everyone, i’m trying to remake the undertale fight buttons system, and it consists on 3 variables, btnHovered, btnPressed and btnClicked. basically, if btnHovered is active (= 0-3, for the four action buttons) and Z was just pressed, the btnPressed variable is triggered to the same value as btnHovered.

i want to make it so if btnPressed is active (= 0-3, for the four action buttons) and Z was just pressed, then the btnClicked variable gets activated, BUT what happens is that when btnHovered is active and i press Z, both btnPressed AND btnClicked get triggered. how could i solve this?

le code

any help is appreciated!!

Read my and Keith’s response to your earlier thread. It explains why this is happening.

What are the values of btnHovered, btnSelected and btnClicked before the events in your scree shot?

1 Like

OHH so, i fixed that other issue by programming it a little differently, and here’s the other part:

Well, you have set it up, this way :wink:

If you want a solution without understanding or changing your setup (which could be condensed and easier), just put the “Selected to Clicked” event block above the “Hovered to Selected” events.

But it would be advisable you read MrMen’s and Keith’s answers again, and feel free to ask, if any of it is unclear. You will understand the concept, and write events that make sense :wink:

2 Likes

alright!! for now i used this solution and it worked, but i’m def gonna try learning it better, srry everyone and TYALL SO MUCH​:face_holding_back_tears::+1:

1 Like