Godot multiplayer, animations stop working for the other player

I’m almost done with the Godot 4 Multiplayer course and there’s a weird issue I’m experiencing that hasn’t been addressed in the lessons so far (apologies if it does later). After a player jumps, their animations become frozen on the opposite players game. This happens for both the host and the client, the animations break on the OTHER players game instance.

Godot_v4.2.1-stable_win64_r8CKpwdZpD

here’s a gif of what’s happening, you can see the rightmost character’s idle and walking animation stop “playing” after a jump. The animations are synced perfectly fine until either player jumps, then they’re just frozen forever from that point on for other players.

These are the settings for the MultiplayerSynchronizer attached to the player scene. Everything works until a player jumps which makes me wonder it has to do with this part of the player script?

func _on_animated_sprite_2d_animation_finished():
	if state == PlayerState.JUMPING:
		player_sprite.play("jump")

It’s weird because the animations still change, it’s just that you only see like the first frames of the animations, they just become frozen.

@FossRyan Any ideas on this one?

after watching the videos aon speed play, the only thing I can recommend is the interpolation video might fix this issue, but I don’t see any reason as to why an animatino should break or de-sync from what I seen in the course.

The same issue exists in the course videos, if you watch the end of the -4.6 “Treasure Chest”- video, he jumps at around 13:41 and you can see that in the other client the idle animation is broken.

So it’s not just an issue on my end, I’ve seen a couple of people in the comments of some of the videos mention the same issue but haven’t found any solutions.

Looking ahead you can even see the issue in the last course video so I guess it never gets addressed or acknowledged.

It seems to happen when any non-looping animation plays, if i temporarily set jump, jump_start, and double_jump_start to loop then the animations never “break”.

If anyone else happens to stumble upon this I’ll share my best solution, it seems to work but I’m not sure if it will break anything down the line.

I created another MultiplayerSynchronizer on the player scene, and named it AnimationSynchronizer. I added the AnimatedSprite2d:Animation property to this synchronizer and removed it from the original, the original should only have the scale and position now. I also set the replicate setting on the new animation synchronizer to “On Change”.

1

I then connected the delta synchronized signal on the new animation synchronizer to the player script to a function that looks like this:

func _on_animation_synchronizer_delta_synchronized():
	player_sprite.play()

To summarize the issue, it seems like whenever a non-looping animation plays (jump, jump_start, double_jump_start) the animations stop “animating” on the other players client, they still CHANGE but do not ANIMATE, they just appear to be the first frozen frame of whatever animation they’re on from that point on. If you pay close attention you can see this behavior in pretty much all the course videos but you have to know what you’re looking for.

Since the animations still seem to change but appear as though they’re not “playing” I created a function that runs when the animation property changes that just contains “player_sprite.play()”. Without passing in an animation parameter this just seems to play whatever the current animation is?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms