wait(5)
local humanoid = workspace:WaitForChild("Stage"):WaitForChild("Stager").Humanoid
local description = humanoid:GetAppliedDescription()
if not description then
print("there wasn't any")
description = Instance.new("HumanoidDescription")
description.Parent = humanoid
end
local id = game:GetService("Players").DanyaMashkov.UserId
local desc = game.Players:GetHumanoidDescriptionFromUserId(id)
desc.RunAnimation = 133634333373686
desc.FallAnimation = 126396377269749
desc.JumpAnimation = 71605594299144
desc.IdleAnimation = 125676663911834
humanoid:ApplyDescription(desc)
print("done")
Hello everyone. I faced a problem: I wanted npc to have an idle animation, so I thought the simplest method to do it will be just to apply description to the npc. I wrote this script, but it doesn’t work. When I use the same script with humanoid of the player, it works. Is it true that I basically can’t set animations for NPCs using :ApplyDescription() or the problem is deeper?
1 Like
when I look into the description, it tells me that everything is ok, but if I use MoveTo to test running animation of the npc or I just do nothing to see the idle animation of npc, there is nothing
any errors? the npcs need to be parented to workspace before applying description
also is this for animations or applying description?
if the problem is the idle animation a humanoiddescription just identifies the idle animation that the players have equipped so if i have elder idle it will set the elder idle id to the idle animation property for the humanoiddescription
No, there is not any errors.
I am not sure that I correctly understood second paragraph, but I wanted to set outfit + animations, so I used ApplyDescription for that.
Outfits sets, but npc doesn’t play animations that I set in description.
But when I set this description to myself, I get all animations
so the animations dont appear when you apply description for a different user id?
It is not connected with a user id.
I can paste any id, and animations will be applied, but only if I do it on the character that is controlled by a player. When I do it with just an npc and it’s humanoid, it doesn’t work.
show the code for the npcs because you only showed the code you used for your user id
I provided a code for the npc, but took my humanoid description. In general, the code looks like this.
wait(5)
local humanoid = workspace:WaitForChild("Stage"):WaitForChild("Stager").Humanoid
local description = humanoid:GetAppliedDescription()
if not description then
print("there wasn't any")
description = Instance.new("HumanoidDescription")
description.Parent = humanoid
end
local desc = game.Players:GetHumanoidDescriptionFromUserId(ANY_ID)
desc.RunAnimation = 133634333373686
desc.FallAnimation = 126396377269749
desc.JumpAnimation = 71605594299144
desc.IdleAnimation = 125676663911834
humanoid:ApplyDescription(desc)
for myself, I use this
local humanoid = workspace:WaitForChild("DanyaMashkov").Humanoid
local id = game:GetService("Players").DanyaMashkov.UserId
local desc = game.Players:GetHumanoidDescriptionFromUserId(id)
desc.RunAnimation = 133634333373686
desc.FallAnimation = 126396377269749
desc.JumpAnimation = 71605594299144
desc.IdleAnimation = 125676663911834
humanoid:ApplyDescription(desc)
print(humanoid:GetState())
print("done")
the problem is that it’s not even loaded with the animator, Applying animations that were meant to be for player doesn’t immediately play it cuz the ID is linked to a bundle from catalog, you’ll need to find it’s actual animation ID rather than from the bundle directly
I didn’t take the id from the bundle directly. I took the id of the animation (Idle, for example), inserted it into my workspace in studio.
Got an R15Anim folder. After it I published this folder by myself and used the id of this particular asset.
Or you talk about something else?
studio says ApplyDescription can only be called by the server change it to a server script
local humanoid = workspace.Rig.Humanoid
local Description = humanoid:FindFirstChild("HumanoidDescription")
if not Description then
Description = Instance.new("HumanoidDescription")
Description.Parent = humanoid
end
local desc = game:GetService("Players"):GetHumanoidDescriptionFromUserId(1)
desc.RunAnimation = 133634333373686
desc.FallAnimation = 126396377269749
desc.JumpAnimation = 71605594299144
desc.IdleAnimation = 125676663911834
humanoid:ApplyDescription(desc)
this works for me if i have it as a server script
No, it is not.
Several years ago they put into the production the feature that allows you to do it from the Client, but in this case your humanoid should be created locally.
By the way, I am doing it from the server script, so the fact that I said two lines earlier doesn’t really matter.
so why are you using waitforchild on the server thats never needed
i dont understand how it doesn’t work for you but it works for me

You can make :ApplyDescription() from the client with the Client-maded humanoid and see that it really works.
I just in the beginning started in the local script and after switcher to the server script and copy-pasted the code, sorry for that stupid WaitForChild().
ohh okay i didnt know that good to know (i think)
I believe this is a great thing if you want to create, for example, some locker room where you can choose the character, so you will clone current character from the client and after you can do any customization with it
I see the appearance, but not the animations