Killing tween breaks multiplayer sync?

Question

I just replaced a node reposition function that was based on lerp and super complicated and also had inconsistent timing with a very simple and intuitive tween. With that said, sometimes I need to kill the tween early. But, whenever I call to kill the tween, it breaks the multiplayer sync!

Here is the function I’m using:

@rpc("any_peer", "call_local", "unreliable")
func stop_recovery():
	if recovery1Tween != null:
		recovery1Tween.kill()
	if recovery2Tween != null:
		recovery2Tween.kill()

I’m making the variables global at the top of the script with:

var recovery1Tween : Tween
var recovery2Tween : Tween

The function that kills the tweens is being called (with the .rpc function) in an area_entered signal.

Is there a good way to kill tweens in a way that won’t break the multiplayer sync? The tweens themselves are synced perfectly, and nothing happens when the animation ends naturally. The multiplayer sync only breaks if I manually kill the tweens.

I’m not sure that is possible. A MultiplayerSynchronizer communicates in one direction. Only one tween is required, and the tweened property should be synchronized.

Let’s say the tween modifies position and position is synced.
The authority tween will change the position and sync the new position to the remote peers.

Since you make both authority and remote play the same tween. The authority MultiplayerSynchronizer will override the remote tween.

And if the authority tween is killed, the syncing position will override the active remote tween. Making it look like it broke the tween. (If the remote tween is killed it will not stop the authority from syncing it’s active tween.

I believe what your are saying is that it should work as long as the tween is synced, correct?

Is there a good way to synchronize the tween? Since the tween is being created in the script, I can’t select it as a synchronize target in the MultiplayerSynchronizer.

You don’t sync the tween itself but the property that is being tweened.

Oh okay, I get it now, I think I misread your initial post. Okay, so the property being tweened is the position. It is interesting that the tweening itself is fine.

I’m unfortunately not home right now, but when I get home I’m going to try having only the server kill the tween, and if that doesn’t work have only the server handle the whole tween process.