Clickable object events not working correctly

I am making a point and click game where the player opens a drawer to take a box of matches. The events are almost working but the matches are added to the inventory before the player actually clicks them although I added a condition that the left mouse button should be pressed.

My events

A video showing what I mean

Any help appreciated.

It’s rather hard to work out what’s happened because there’s no mouse pointer or click indicator in the video.

What I do notice, and will be what’s causing the issue, is that when you open the drawer, it creates the matches and there is a good possibility that the cursor is already on the matches, in which case they are will be collected.

Also, the create object matches will be getting actioned every frame the mouse is down and the cursor is on the Middle_Drawert object because you are not ensuring it happens just once.


So I have the following suggestions to fix the issue (excuse the bad editing…):

Note, the Matches touch must be done before the drawer open to avoid the reason explained at the start of this reply.

1 Like

Thank you it solved the problem.