Left Down and Left Pressed Events are not working

T

thegabba

Guest
Hi guys, sorry for the noob question but I'm new to GameMaker. As I say in the title, my left down and left pressed event do not work. I've read the official documentation and I've seen several tutorials online but when I 'click' an object in my game nothing happens (I'm trying to do some simple actions like "draw text" or "debug message" to test it as you can see in the screenshot attached).
Thank you
 

Attachments

FoxyOfJungle

Kazan Games
To draw the text, use it in the "Draw Event".
Change the mouse event to "Global Mouse Pressed", not "Left Pressed" << Because this function checks for the collision on the object, not the global click of the mouse.
 
T

thegabba

Guest
Hi Foxy, thanks for the answer. I need to use Left Pressed (or Down) because want the game to do stuff only when I click on my object.
 

TheouAegis

Member
Then you need to have your left pressed and left down events set a variable and then in the draw event check if that variable is set so you can do the drawing inside the draw event properly. Alternatively, instead of using the mouse events, you can check the state of the mouse inside the draw event using the appropriate actions (or Test Expression).

In any case, you should be seeing that debug message somewhere within the output window.
 
T

thegabba

Guest
Then you need to have your left pressed and left down events set a variable and then in the draw event check if that variable is set so you can do the drawing inside the draw event properly. Alternatively, instead of using the mouse events, you can check the state of the mouse inside the draw event using the appropriate actions (or Test Expression).

In any case, you should be seeing that debug message somewhere within the output window.
Hi TheouAegis, thanks for the reply. The problem is that even if I set a variable as a consequence to my Left Pressed (or Down), this variable does not change. It's like the event does not work at all...
 

TheouAegis

Member
In the sprite properties, is the collision mask set to Full?

Do you have any other objects using the same sprite that you might have accidentally put in the room instead?

Is this in GMS2.3 (beta)? If so, maybe the object data is corrupted. Try putting a Create Event and having it show a message (just a regular Show Message, not a Debug message). If the message pops up, try your mouse again. If the message doesn't pop up, GM is being stupid. lol
 
T

thegabba

Guest
In the sprite properties, is the collision mask set to Full?

Do you have any other objects using the same sprite that you might have accidentally put in the room instead?

Is this in GMS2.3 (beta)? If so, maybe the object data is corrupted. Try putting a Create Event and having it show a message (just a regular Show Message, not a Debug message). If the message pops up, try your mouse again. If the message doesn't pop up, GM is being stupid. lol
The collision mask is now set to Full Image but nothing changed...

I double-checked the object in the room and it's the correct one...

According to the 'about' section, I'm using the version 2.3.0.529 (I updated the software yesterday). I also tried to show a message, as you suggested. It pops up...
Thanks again for your help guys
 
T

thegabba

Guest
Hi guys, I finally figured out the issue. As pointed out by TheouAegis, the problem was the collision mask set to automatic. Since all my objects have transparent sprites (without images), I had to set the collision mask to 'full' in order to make them work properly. Thanks TheouAegis and FoxyOfJungle for the help, much appreciated!
 
Top