What I did wrong with loading player's character here?

I wanted to do tutorial, which uses copy of player’s character, and got this in a LocalScript:

local TutorialFolder = Instance.new("Folder")
TutorialFolder.Name = "TutorialFolder"
TutorialFolder.Parent = workspace

local Island = Assets.TutorialIsland1:Clone()
Island:PivotTo(CFrame.identity)
Island.Parent = TutorialFolder

local Appearence = Players:GetHumanoidDescriptionFromUserId(Player.UserId)
local Character = Assets.BaseCharacter:Clone()
Character:PivotTo(Island.SpawnPad:GetPivot() * CFrame.new(0, Character:GetExtentsSize().Y/2, 0))
Character.Parent = TutorialFolder
Character:WaitForChild("Humanoid"):ApplyDescription(Appearence)

print(Appearence)
print(Appearence.IdleAnimation)

local Animation = Instance.new("Animation")
Animation.AnimationId = Appearence.IdleAnimation
local Track:AnimationTrack = Character.Humanoid.Animator:LoadAnimation(Animation)
Track:Play(0.1, 1, 1)

But when I print IdleAnimation, or check manually, all Ids are equal to 0. How I can fix that?

1 Like

A few flags stick out to me, one could be your spacing of “local Track:AnimationTrack”, Roblox might be thinking you’re trying to call some sort of function like :Connect. Instead you should add a space like so:

local Track : AnimationTrack =...

Spaces don’t matter in this context, and made only for typechecking. Almost entire code can be written without spaces, separating only words.

Right, understood the typechecking just so used to seeing a space so I wasn’t sure if it caused any issues. Speaking of which does anything appear on your console when you run this program?


Issue comes from animation id’s being zeroes:
image
I can manually change them to something valid and it will work, but I want to use player’s selected animations.

1 Like

It would probably be better to get all the animations from the players animate script. The animate script has child string values with the animations under those string values, and you could use those animations instead

2 Likes

That’s what I’m thinking about now too. Cuz even normally created Player.character has same zeroes issue.

1 Like

Yea so try that and see if it works… Are you copying all the animations or just the idle

1 Like

It works. Unsure what will occur if some player paid animations will be used though, cuz I can’t check that myself cuz I have no any.

Idle, and a couple more.

1 Like

I think that the Animations ID are 0 because the user (you?) do not have a special animation equipped. The animate script store all default animations, which are then replaced if the user have another set of animation equipped

What do you mean by “player paid animations”?

Those which you buy from Roblox avatar shop, and equip later.

That’s may be the issue, but in this case I expected to have some specific IDs of default animations, and not zeroes.

I dont think it will matter either way since the player you’re referring to will own them, unless I’m understanding this wrong.

Due to me using pre-created dummy avatar, there’s possibility that this animation id’s from Animate script are pre-generated and won’t change when humanoid description gets applied.

Yep, if you check on your Roblox profile > avatar > animation > ‘any’… you can have no animation equipped, so the HumanoidDescription return 0 instead. The Animate script provide the default animations in this case. But i’m pretty sure that the animation ID of the values inside this animate script change whenever the user have other animations equipped, so you may use that.

try to get the animation id from the original character’s animate script. i highly doubt the dummy’s animate script would change based on the humanoid description. i have provided images on where to find the idle animation. i have a paid animation and it successfully gets the correct animation id


Screenshot 2025-03-25 134335
hope this helps

1 Like

actually yk what, just clone the entire animation instance for the idle animation. so you can do character > animate > idle > animation1 and then clone it animation1:Clone()

1 Like