Animations replicating incorrectly for other players

When using a custom animation script, a mismatch is being created between the animation playing on the client and the animation being shown to other players. This mismatch is occurring both in Studio and during actual gameplay

Example of the issue:
The client does not move their character, thus the idle animation will start playing. For the client, the idle animation will play as to be expected, but somehow other players will see the client playing the Dance2 animation instead of the idle animation

From the information I’ve currently received, this issue started happening to my custom animation script only since the latest Roblox update was released. I haven’t made any changes to the animation script that could cause an issue like this to occur, and haven’t received any reports of this problem beforehand

Steps to recreate this issue:

  • In a new baseplate, retrieve a custom animation script such as my Animate 2 script from the Toolbox and place the script inside of StarterCharacterScripts. Alternatively, you can use this place file: AnimationReplicationBug.rbxl (54.7 KB)
  • Enter a 2 or more player local server
  • The mismatch between the animations being perceived by the client and other players should be immediately noticeable

This issue encountered by @Faustollol involving the AdjustSpeed method might be related to the replication problem mentioned above:

Using AdjustSpeed(0) in-order to pause the animation works on the client, but other players will instead see the animation stopping completely. A workaround to this issue was found:

local timePosition = animationTrack.TimePosition
animationTrack:Play(0, 1, 0)
animationTrack.TimePosition = timePosition

which stores the track’s time position in a variable, then replays the animation with the speed set to 0, then sets the track’s time position to the one stored in the variable

2 Likes

Thanks for the report! I filed a ticket in our internal database.

3 Likes

I found a way to fix this issue by replacing:

do
	local animator = humanoid:WaitForChild("Animator"):: Animator

	local animation = Instance.new("Animation")

	local animationData: {[string]: {any}} = {
		Cheer = {"rbxassetid://507770677", Enum.AnimationPriority.Idle},
		Climb = {"rbxassetid://507765644", Enum.AnimationPriority.Core},
		Dance = {"rbxassetid://507772104", Enum.AnimationPriority.Core},
		Dance2 = {"rbxassetid://507776879", Enum.AnimationPriority.Core},
		Dance3 = {"rbxassetid://507777623", Enum.AnimationPriority.Core},
		Fall = {"rbxassetid://507767968", Enum.AnimationPriority.Core},
		Idle = {"rbxassetid://507766388", Enum.AnimationPriority.Core},
		Laugh = {"rbxassetid://507770818", Enum.AnimationPriority.Idle},
		Lunge = {"rbxassetid://522638767", Enum.AnimationPriority.Movement},
		Point = {"rbxassetid://507770453", Enum.AnimationPriority.Idle},
		Run = {"rbxassetid://913376220", Enum.AnimationPriority.Core},
		Sit = {"rbxassetid://2506281703", Enum.AnimationPriority.Core},
		Slash = {"rbxassetid://522635514", Enum.AnimationPriority.Movement},
		Swim = {"rbxassetid://913384386", Enum.AnimationPriority.Core},
		SwimIdle = {"rbxassetid://913389285", Enum.AnimationPriority.Core},
		Tool = {"rbxassetid://507768375", Enum.AnimationPriority.Idle},
		Wave = {"rbxassetid://507770239", Enum.AnimationPriority.Idle}}

	for name, data in animationData do
		animation.AnimationId = data[1]

		local animationTrack = animator:LoadAnimation(animation)
		animationTrack.Priority = data[2]

		animationTracks[name] = animationTrack
	end

	animation:Destroy()
end

with:

do
	local animator = humanoid:WaitForChild("Animator"):: Animator

	local animationData: {[string]: {any}} = {
		Cheer = {"rbxassetid://507770677", Enum.AnimationPriority.Idle},
		Climb = {"rbxassetid://507765644", Enum.AnimationPriority.Core},
		Dance = {"rbxassetid://507772104", Enum.AnimationPriority.Core},
		Dance2 = {"rbxassetid://507776879", Enum.AnimationPriority.Core},
		Dance3 = {"rbxassetid://507777623", Enum.AnimationPriority.Core},
		Fall = {"rbxassetid://507767968", Enum.AnimationPriority.Core},
		Idle = {"rbxassetid://507766388", Enum.AnimationPriority.Core},
		Laugh = {"rbxassetid://507770818", Enum.AnimationPriority.Idle},
		Lunge = {"rbxassetid://522638767", Enum.AnimationPriority.Movement},
		Point = {"rbxassetid://507770453", Enum.AnimationPriority.Idle},
		Run = {"rbxassetid://913376220", Enum.AnimationPriority.Core},
		Sit = {"rbxassetid://2506281703", Enum.AnimationPriority.Core},
		Slash = {"rbxassetid://522635514", Enum.AnimationPriority.Movement},
		Swim = {"rbxassetid://913384386", Enum.AnimationPriority.Core},
		SwimIdle = {"rbxassetid://913389285", Enum.AnimationPriority.Core},
		Tool = {"rbxassetid://507768375", Enum.AnimationPriority.Idle},
		Wave = {"rbxassetid://507770239", Enum.AnimationPriority.Idle}}

	for name, data in animationData do
		local animation = Instance.new("Animation")
		animation.AnimationId = data[1]

		local animationTrack = animator:LoadAnimation(animation)
		animationTrack.Priority = data[2]

		animationTracks[name] = animationTrack

		animation:Destroy()
	end
end

If anyone knows why the original version was causing replication to break, please let me know so I can avoid it in the future :slight_smile::+1:

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