• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

On mobile, how to detect an mouse input while it is being held down elsewhere?

guinub

Member
Hello guys!

I dont know if my title is clear, but I'm making a mobile game where the player follows wherever the "mouse" is being held down. The problem is that he needs to press a button to pick up items, and I cant seem to make it work on mobile. The game is something like this:

1612830260447.png

And the code is something like this:
GML:
//Player movement
if(mouse_check_button(mb_left) && position_meeting(mouse_x, mouse_y, obj_floor)){ //Floor is the grey area
    //Move
}


//Pick up items
if(mouse_check_button_released(mb_left) && position_meeting(mouse_x, mouse_y, obj_button)){
    //Pick up
}
Thanks in advance!
 
Top