Changing default animation

i want to make every player that joins the game, will have the walking,running animation that i want, i first tried to put a script named “animate” in StarterCharacterScripts and just use the regular animate script but just change the ids, it didn’t worked so i tried another way with this script:

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)

local humanoid = char:findFirstChild("Humanoid")

if (humanoid) then 

    local Run = 658830056 
    local Walk = 658831143  
    local Fall = 658831500 
    local Jump = 658832070 
    local Idle = 658832408 
    local Swim = 658832807 
    local Climb = 658833139

    local anim = char.Animate

    local animation = anim:FindFirstChild("walk")

    local children = animation:GetChildren()
    for index, child in pairs(children) do
        child:Remove()
    end
    local newanim = Instance.new("Animation")
    newanim.Parent = animation
    newanim.Name = 'Anim'
    newanim.AnimationId = 'http://www.roblox.com/asset/?id='..Walk

end 
end)
end)

and it still won’t work, is there a easier and working way to do this?

2 Likes

Could you show/put the animate script your modifying here? You’re probably changing/altering something wrong.

There is something called a humanoid description that you could use, I’d provide a link to the page but I’m on mobile right now. Should be somewhere on the api reference.

in the character why not try editing the animation values instead, for example under run you would have runAnim just change the animation ID through a local script

I don’t think thats possible, you’ll have to change the animation Id directly from where its playing the animation at which is essentially the animate script.

@RealJayDev Was referring to this: HumanoidDescription | Documentation - Roblox Creator Hub

1 Like

it’s exactly like animate script but i just changed ids, should i post the whole script anyway?

yea post it for us to see so we can verify

There a intvalues/numbervalues and inside that are the animations which are inside the script aswell that you’ll have to change to the same ID I’m pretty sure.

this seems like it would work try using the humanoid description

oh wait do i have to copy all the childrens of the script too , and place them with the script in StarterCharacterScripts?

Yes but there is an alternative which is Humanoid Description though if you want it to do the OG way (Animate script) then yes.

nvm didn’t worked xD, so how i do the humanoid Description thing?

local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
if humanoid then
	local descriptionClone = humanoid:GetAppliedDescription()
	descriptionClone.IdleAnimation = 754637456
	-- Apply modified "descriptionClone" to humanoid
	humanoid:ApplyDescription(descriptionClone)
end

This is an example from the humanoiddescription page: HumanoidDescription | Documentation - Roblox Creator Hub

It checks if there’s a humanoid, and if there is, it’ll get the description and change the idle animation to whatever that id is,
You can read more about it on the actual page.

where i suppose to place the script? and if i’m placing it inside ServerScriptService, why is that won’t work?

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)

local humanoid = char and char:FindFirstChild("Humanoid")
if humanoid then

local descriptionClone = humanoid:GetAppliedDescription()

descriptionClone.WalkAnimation = 734326330
-- Apply modified "descriptionClone" to humanoid
humanoid:ApplyDescription(descriptionClone)

end
end)
end)

I do it this way,
I went in a play solo and grabbed the Animate Script from out of my character.
I edited values that I wanted to change, pretty simple.


REMEMBER TO MOVE YOUR COPY INTO STARTER CHARACTER SCRIPTS


image
Copy paste it into starter character scripts
image
Open it up
image
Scroll down till you find the one you want then open it and click the animation!
image
image


Hope this helps! :smile:

1 Like

it’s still won’t work, wait is there a possability that if i don’t own the animation then i can’t use it for my game?

You have to own the animation to be able to use it in the first place. If you don’t own it or its not by roblox, you cannot use it.

oh so it’s by roblox then it’s not the reason

Are you sure its by roblox? Try playing it on a humanoid in workspace to see if it plays.