Issue with state execution when game objects appear. Conflicts with save file reading

I created a one-time animation sequence for the controllable character to play only at the very start of the game (similar to a “first awakening”). In VS, I set this animation to be the [Initial State].

In theory, once this animation sequence finishes, the character should never appear in this state again within the scene (game_scene), unless the game is completely restarted.

However, I’m encountering a small issue. Because I set the character’s “Execute State on Spawn” to [Initial State]:

This causes a 1-frame glitch of the [Initial State] animation to appear and triggers an error every time the game is saved and then loaded. This is likely a BUG.

Regarding the “Keep Animation Before Transition” option:

I find this feature very useful for certain actions, but I’ve also noticed that… if the save point falls on that action, the animation for that object defaults to “None” after loading the save file, instead of retaining the last frame of the transition animation. Is this a bug?

Since this is an action game, the character might perform various actions when interacting with save points. To prevent the character from resuming previous actions after loading, I usually set the “Execute State on Spawn” to [Idle].

However, if I choose [Idle] as the spawn state, I can’t execute the awakening animation sequence at the beginning of the scene (game_scene). How can I solve this problem? :rofl:

This sounds very similar to a recent post about objects briefly appearing for a frame after scene transitions: シーン遷移後にオブジェクトが見えてしまう - Baz の #2

The likely cause is the same. The initial state takes a couple frames to run after loading, so what shows during that brief moment is whatever the object itself is set to in the scene, not what’s defined in the initial state. That would also explain the inconsistency across your objects. The ones that match their initial state closely don’t flicker, and the ones that differ do.

As a workaround, you can try matching the object’s base scene setup to what you want the initial loaded state to look like (visibility, animation frame, etc.), so there’s no visible mismatch during that load window.

That said, I think this is becoming an interesting pattern worth raising. Having to mirror the initial state on the object itself isn’t great, especially for save/load and scene transitions, where you’d expect the initial state to just apply instantly. I’m going to bring this up with the developers to see if the load behavior here can be improved.

1 Like

In theory, as Mr. Baz mentioned, the usual approach is to set the initial state of objects in the scene to match their state at load time.

However, since I added a [revive] action at the start of the scene for the controllable player—a tutorial step that prompts the player with a key press to trigger the character’s awakening animation—

once the [revive] action completes, it immediately transitions to the [idle] state, meaning [revive] no longer needs to appear in the scene afterward.

The issue now is that after loading a saved game, a single frame of the [revive] animation still appears, which looks very poor visually.