Animation not working on player

i made a test animation script inside of startercharacterscripts and the animation only works on a rig but not my character.

local Players = game:GetService("Players")

-- Variables
local player = Players.LocalPlayer
local animation1 = game.ReplicatedStorage.fightidle
local rig = workspace.Rig
print(animation1)
-- Animation
if player.Character then
	local animator = player.Character.Humanoid.Animator
	local animationTrack:AnimationTrack = animator:LoadAnimation(animation1)
	animationTrack:Play()
	rig.Humanoid.Animator:LoadAnimation(animation1):Play()

	animationTrack.DidLoop:Connect(function()
		print("looped")
	end)
end

nvm i figured it out. the character wasnt loaded before teh script started

1 Like

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