I am having a bit of problem with changing the object animation. I have this interaction/animation working in my earlier build, but now it is behaving weirdly. Here’s the snapshot of the same. Action/events in screen shot marked 1 is giving me problem, while animation in screenshot marked 2 is working fine.
- Not sure what is happening to animation “Open_Full”. I tried adding “Wait for x seconds” after the animation is complete to delay/see the state for a while, but that only introduced delay without changing the animation.
- Chest animation is not setting to “Open_Empty”.
- The Repat events are triggering multiple times, while it is marked as “Trigger once”. Probably because Chest animation is not setting.
- I tried deleting the "“Change scene variable” events, but no improvement in the output.
- I tried breaking the actions with “Wait” action, but that wasn’t helpful.
- I tried removing the “While… Repeat” and clubbed all three conditions in one. Didn’t work either.
- Sometimes the scene freezes the moment player interacts with the chest; sometimes, it changes the score and coin count, but keeps the chest animation to “Closed” and allow multiple interactions with the chest.
My goal is to have Chest animation in “Closed” state switch to “Open_Full” and then deactivate player control for few seconds, and then change the Chest animation to “Open_Empty” and ignore any further player interaction with it. (Animation state flow: Closed > Open_Full > Open_Empty). To debug the issue, I tried this:
which freezes the scene. While the below two changes (with or without “Trigger Once”) opens and shuts the chest.
There are multiple instances of chest in the scene and all three of its animation states have just a single frame each. Not sure if having a single frame for each state is the cause of the problem, but then chest object in screenshot 2 is also having a single screenshot for each animation and it is working fine.