Copy link to clipboard
Copied
Hi
I have created a simple slide in slide out menu. But for some reason the script only run once. I have tried to used variables to "reset" the script but no luck. What am I missing? One script are on one open button and the other on another close button.
Copy link to clipboard
Copied
I suspect you are using the default motion effects, and the issue may be there. It is really necessary to use custom motion paths instead of those canned ones. Maybe have a look at the example in this blog post:
https://blog.lilybiri.com/sliding-menu
It is not easy to explain the reason for this change. But Fly in from and Fly out both set up the motion path from the location of the object which is on the end position for Fly in, and on the start position for Fly out. Whereas you need a relative motion path from the eact situation the object has before moving.
You need to prevent also that the same button is clicked twice in sequence. That could be done by disabling the Open button when the menu is open, and similar for the Close button.
Copy link to clipboard
Copied
I suspect this is because of the effect you selected. I recorded a video on how I would have handled this particular challenge: https://youtu.be/u-QmKt3SPdI
Copy link to clipboard
Copied
Wow. This must be the best respond in my internet career 🙂
Thank you for taking the time. I think I forgot to reset the variable to 0 in the else part. Thank you