Animation won't play

Hey, so I want my script to play an animation on the person’s character once they spawn in
But I’ve run into issues with playing the animation

local plrs = game:GetService("Players")

local rp = game:GetService("ReplicatedStorage")

local cam = workspace.CurrentCamera
plrs.PlayerAdded:Connect(function(plr)
	print("waitig")
	repeat wait() until plr.Character
	print("running")
	print(plr.Character:GetFullName())
	plr.Character:WaitForChild("Humanoid"):LoadAnimation(script.startingcut)
end)

waiting and running do print, as well as the character, so I’m sure that line is being reached
But the animation just doesn’t play

I’ve tried;

  1. Reuploading the animation 3 times
  2. Changed the avatar type to R6 (the animation is R6)
  3. Changed the location of the animation
  4. Tried doing it both on server and client side
  5. I’ve tried removing the debug stuff
  6. Changing games entirely
  7. Making sure the animation is uploaded to my account (the game is on my account)
  8. Changing the location of the script
  9. Loading the animation to the Animator directly
  10. Tried using FindFirstChild instead of WaitForChild

Everything I came up with didn’t change the outcome. I’m honestly out of ideas

It’d be nice if anybody could find a solution to my problem or at least tell me if I’m doing anything wrong

and before anybody asks, yes the animation object is set up correctly as far as I am aware

What I’d do is try checking for the animation controller or the animator and instead of saying .Character add or .CharacterAdded:Wait() since sometimes the character doesn’t load on time

P.S. make sure the script the animation plays on runs on the server so everyone can see the animation

local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChild("Humanoid")

local AnimationController = Humanoid.Parent:FindFirstChildOfClass("Humanoid") or Humanoid.Parent:FindFirstChildOfClass("AnimationController") 

local Animator = AnimationController and AnimationController:FindFirstChildOfClass("Animator")
local Animation 

if not AnimationController or not Animator then return end 

Animation = AnimationController:LoadAnimation(animation)
Animation:Play() 
1 Like

It’s been a while since I’ve worked with animation stuff, so I just forgot to play the animation afterwards.

You still fixed the issue practically by reminding me.

Thanks

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