Animation not Looping when it Should Be

I’m trying to make an emote for my game that plays when the player presses “1”. I am experiencing one problem however, the animation does not loop, and I have no clue why. This started happening after I used RemoteEvents to play the emote on the server.

This is the LocalScript that detects when the player presses “1”.

--Player variables
local emotePlay = game.ReplicatedStorage:WaitForChild("EmotePlay")
local uis = game:GetService("UserInputService")
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
--Emote variables
local dab = char:WaitForChild("Dab")
local dabAnim = humanoid:LoadAnimation(dab)
dabAnim.Looped = true

--When the player presses a key
uis.InputBegan:Connect(function(input, gpe)
	if input.KeyCode == Enum.KeyCode.One and not gpe then
		emotePlay:FireServer(dab)
		print(dabAnim.Looped)
	end
end)

This is the server script that plays the emote.

local emotePlay = game.ReplicatedStorage.EmotePlay

emotePlay.OnServerEvent:Connect(function(player, anim)
	local char = player.Character or player.CharacterAdded:Wait()
	local humanoid = char:WaitForChild("Humanoid")
	local emote = humanoid:LoadAnimation(anim)
	emote.Looped = true
	print(emote.Looped)
	emote.Priority = Enum.AnimationPriority.Action
	emote:Play()
end)
  1. What do you want to achieve? I want to make an emote that will play when the player presses “1”.

  2. What is the issue? The emote isn’t looped.

  3. What solutions have you tried so far? I found a similar post about my issue, however, I checked, and the Looped property is true for both the Client and the Server.

There are no errors, and everything seems correct, so I ave no clue why the emote isn’t looped.

2 Likes

This is happening for me as well.
Did you end up finding a solution?

1 Like

I learned that it was probably because AnimationTrack.Looped doesn’t replicate to clients sometimes. I did find a solution, which was to just play the animation on the client, or “manually” loop it, like play it when it ends like so:

anim.Stopped:Connect(function()
    anim:Play()
end)
2 Likes

I also just realized that mine wasn’t working because the animation was for a R6 character, and I somehow forgot R15 was a thing. :laughing:

1 Like