Action/Core animations mix with Idle animations

I almost strictly do programming on Roblox Studio, and I do not do much else. My friend created an idle animation and celebration animation for a basketball game we are creating. However, when the celebration animations play, it seems to mix with the idle animation. In the idle animation, the player sort of crouches, but the player stays crouched when the celebration plays. Here is the code I am using to make the default animations:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		--wait(3)
		char.Animate.run.RunAnim.AnimationId = "rbxassetid://90962892840508"
		char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://90962892840508"
		char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://113305951586062"
		char.Animate.fall.FallAnim.AnimationId = "rbxassetid://85935941782856"
		char.Animate.idle.Animation1.AnimationId = "rbxassetid://86473550369129"
		end)
end)

And here is the code I am using to play a random celebration when a team scores (every player on the team that scores will do a celebration):

local function playCellys(team)
	local rng = Random.new()
	-- print(team)
	for _, player in players:GetPlayers() do
		print(player.Name, player.Team.Name, "emoting")
		if player.Team.Name == team then
			local character = player.Character
			local humanoid = character:FindFirstChild("Humanoid")
			if humanoid then
				local celly = nil
				local rand = rng:NextInteger(1, 4)
				print(rand)
				if rand == 1 then
					celly = script.appropriat
				elseif rand == 2 then
					celly = script.bow
				elseif rand == 3 then
					celly = script.helicopter
				elseif rand == 4 then
					celly = script.dive
				end

				if celly ~= nil then
					local animationTrack = humanoid:LoadAnimation(celly)
					animationTrack:Play()
				end
			end
		end
	end
end

Just to clarify, the celebrations have no problem playing, but can look incorrect. Please help, as I cannot find any other instances of this happening.

1 Like