How do I prevent freezing the my Rig on other Clients when Welding a part to my Character?

When I Weld a part to my character and play an animation, it works fine on my client but not others. How the script works is the animation is played on my end, an event is fired to the server to then tell the clients to replicate it on their end. All the clients run the same script each with the original client’s character as a parameter.

The Part used for animation is Massless, Unanchored, and CanCollide is turned off. It welded to the Character’s Right Arm and I have tried using a Weld, WeldConstraint, and Motor6D but the result was the same.

Basically when the Part is welded on other player’s Clients. The rig is frozen until the weld is broken and the rig teleports its actual position on the player’s client. The Server actually detects hits from the frozen rig’s position.

Video:
https://i.gyazo.com/38c0a8f01981fdebbf6690d5066a1226.mp4

function Move.Animation(Character)
	if Character.Head:FindFirstChild("Sound") then Debris:AddItem(Character.Head.Sound, 0) end
	local Sound = script.Sound:Clone()
	Sound.Parent = Character.Head
	Sound:Play()
	Sound.TimePosition = 1 / 3 * Sound.TimeLength
	
	local AnimAttack = Assets["Fire Magic"]["Exploding Fireball"]:Clone()
	
	-- Position
	local AnimAttackPosition = Character["Right Arm"].CFrame + 
		Character["Right Arm"].CFrame.upVector * (-Character["Right Arm"].Size.Y / 2 - AnimAttack.PrimaryPart.Size.Y * AttackSize / 2 - 2)
	AnimAttack:SetPrimaryPartCFrame(AnimAttackPosition)
	ScaleModel(AnimAttack, AnimSize)
	
	local Weld = Instance.new("Weld")
	Weld.Part0 = Character["Right Arm"]
	Weld.Part1 = AnimAttack.PrimaryPart
	Weld.C0 = Character["Right Arm"].CFrame:inverse()
	Weld.C1 = AnimAttack.PrimaryPart.CFrame:inverse()
	Weld.Parent = AnimAttack.PrimaryPart

	AnimAttack.Parent = workspace.Terrain.Debris
	
	wait()
	
	-- Play Animation
	local AnimationTrack = Character.Humanoid:LoadAnimation(Animation)
	AnimationTrack.Priority = Enum.AnimationPriority.Action
	AnimationTrack.Looped = false
	repeat wait() until AnimationTrack.Length > 0
	local SlowAnimationSpeed = (1 / 3) / (Sound.TimeLength / 2)
	spawn(function()
		TweenModelSize(AnimAttack, AnimationTrack.Length / SlowAnimationSpeed / 2, AttackSize / AnimSize, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
	end)
	AnimationTrack:Play(_, _, SlowAnimationSpeed)
	wait(1 / SlowAnimationSpeed * 1 / 3)
	AnimationTrack:Play(_, _, AnimationSpeed)
	AnimationTrack.TimePosition = 1 / 3
	-- End Animation
	Debris:AddItem(AnimAttack, AnimationTrack.Length / AnimationSpeed - AnimationTrack.Length / SlowAnimationSpeed)
	wait(AnimationTrack.Length / AnimationSpeed - AnimationTrack.Length / SlowAnimationSpeed)
end
1 Like