Hey there…
I have implemented a menu for my game now. So, when the menu gets loaded my level scene is suspended. When I leave my menu the level is resumed. Logic and and movement and so on works fine, but my animations break. Animations that are on the ground still work(running and idle), but all animations in the air do not work anymore(jumping, falling, walljump and more…)
Does someone know what may be the problem? There is no error message in the console.
Edit
Just checked with some prints. I still do come into the loop where the animations functions are called.
@Monster
nope, I don’t have a sharable demofile yet.
I have figured out that this problem only occurs when play_mode ist set to PLAY and not to LOOP.
So every Action that has the playmode LOOP works fine after resuming the scene. Animations with mode PLAY do not work anymore.
Strange.
Ok… I can reconstruct the problem.
Here is a blend which shows exactly my problem. With space the scene can be suspended and resumed again. You see after resuming the scene the action does not run anymore!
If you uncomment the other line and let it run via loop everything works.
Note. I have set the Always sensor to pulse mode. So even the play mode runs over and over again.
According to the demo file you start playing the action at each frame (True Pulse). I would assume this restarts the action at frame one. But it does not. I guess the additional starts are simply ignored until the animation completes or gets stopped.
Anyway this is not the issue you describe.
I can confirm, suspending and resuming a scene breaks the animation. It can continue an already running action but you can not restart it or another one.
More worse if you start the action after the scene resumed, the action plays the last pose and stops without the ability to play another action.
I think this is clearly a bug.
BTW. This does not happen with the ActionActuator.
Just checked it out myself, and it seems that there is indeed no way to start an action set to Play with the Python command after resuming the scene. Hopefully a dev’ll see this post.
Could you please post this to the BGE bug tracker for now? That way I can keep better track of it. I get the feeling one problem might be time. Animations are updated on the difference in time since their last update. So, if you suspend a scene for 20 seconds on a 10 second animation, the animation will have “finished,” and it will probably be set to it’s end frame. As for why it won’t restart, I’d have to do more digging.