Hello everyone, so I have made a button that looks like a light switch. I made the switch itself to work like a button as I want it to turn a light on and off. But I am currently having an issue with this. I currently only got two animations for this button, the switch going up and the switch going down. The animations aren’t working correctly as well. I seem to be having a hard time making this all work the way a normal light switch would work as in real life.
Simply, I want this button to work as the following:
Right click button
Animation change when clicked each time + Light on/off
Real light switch effect
As always, all help is highly appreciated.
I think I’ll mention all of the people who helped me make my game if they would like me to. (I’ll send all those who helped a PM asking)
I made a simple example: Switch.zip (32.3 KB)
Note 1: I don’t know the conditions you need, my conditions are mouse over switch and left click.
Note 2: “Mouse_pressed” variable to avoid turn on-off multiple times if mouse click get pressed.
Note 3: “check_sub” variable to avoid double sub_event running (if anim = 0 set anim = 1 ==>True then if anim = 1 set anim = 0 ==> True)
Thanks man, would this also possibly work like a mute button. Because currently I got a mute button on the main menu of my game. But you have to click M to mute and U to unmute. I have been trying to figure out how to make the mute button be properly clicked and work like an actual mute button.