I have an animation that I made and published. I try to load it in, but for some reason its length is zero? I decided to open it in AnimationEditor, and the animation is here. I am loading the Animation via LocalScript, that may be the issue.
...
if hum then --hum is defined above
local animator:Animator = hum:FindFirstChildWhichIsA("Animator")
if animator then
local sitTrack = animator:LoadAnimation(script:WaitForChild("ChairSit"))
sitTrack.Looped = true
sitTrack:AdjustSpeed(0.5)
sitTrack:Play()
end
end
Could be that the animation hasn’t fully loaded yet. To test this out could you print(sitTrack.Length) after you load the animation then wait like 10 seconds to print again.
If it’s a loading issue then I recommend either yielding till .Length exist/~= 0 or the more preferred method of preloading the animation way before u actually need to use it.
Well, I found the issue… My first rig is R15 instead of R6. I use Players:CreateHumanoidModelFromUserId() to create a copy of the player on local side, and it is R15.
Can I somehow turn this rig from R15 to R6?
Oh, I can simply replace it with Players:CreateHumanoidModelFromDescription(<description>, Enum.HumanoidRigType.R6).
Thanks for helping me realise why this happens though.