Opening and Closing Drawer

Hi All,

I’m brand new at using Gdevelop. Maybe I’m missing something. I’m trying to make a point and click game and trying to figure out a couple mechanics. I just want to open and close a drawer. No animation needed. Literally when you click on the drawer, it switches to an open drawer, and then when you click on the handle of the drawer, it closes again.

I have the beginning of the scene show the closed drawer with the open drawer hidden and the handle (a separate object) hidden. I’ve been able to switch to the open drawer, but I can’t get it to go back to closed drawer image.

If anyone can help, I’d appreciate it. It’s such a simple thing, but it’s making me go crazy.


Hard to say without seeing your events, but it sounds like a classic beginner issue of:

if drawer is pressed:
 - if drawer is opened: close it
 - if drawer is closed: open it

The issue being that the two actions are run consecutively, so the drawer is closed and reopened at the same time.

Please read this: How to toggle states using Variables [GDevelop wiki]

And share a screenshot of your events if that wasn’t the issue.

That’s probably exactly the issue. I was confused about what variables are and everything. I’ll take a look at this. Thank you!

1 Like