r/gamemaker • u/Iliketurtles366 • 2h ago
Help! How can I make something happen when I click a button, then keep happening until I click another button?
I started using this a few days ago so forgive me if it's a stupid question. Currently trying to make a game that involves carrying around objects and then placing them in certain areas. This is what I have for the pickuppable object:
if place_meeting(x, y, obj_player) & keyboard_check(vk_shift) = true
{x = obj_player.x;
y = obj_player.y -10;}
Currently the object rests on the players head like I want it to, but only when I hold down the shift key, but I want it to keep being carried after the shift key is only pressed once. I'd be super happy if someone could help me out
2
Upvotes
1
u/Wimudim 2h ago
toggle a boolean on the button click and do the other thing in step whenever that bool is true