#Animation Walking Script

1 messages · Page 1 of 1 (latest)

violet crag
#

Hello, so I'm pretty new to this world and I did a great walk animation, I saw a tutorial for giving my Walk animation to the players but it won't work, my question is how do I connect my animation to the player Character script ? Thx for the help.

#

btw idk which tag to take for ts one...

trail finch
#

you can replace default animate script

-- ServerScript in ServerScriptService
local Players = game:GetService("Players")

local WALK_ANIMATION_ID = "rbxassetid://YOUR_ANIMATION_ID" -- custom walk animation id

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character:WaitForChild("Humanoid")
        local animate = character:WaitForChild("Animate")
        
        -- replace the walk animation
        animate.walk.WalkAnim.AnimationId = WALK_ANIMATION_ID
        
        -- optional replace run animation too
        -- animate.run.RunAnim.AnimationId = WALK_ANIMATION_ID
    end)
end)

you can also do custom animation system

-- LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local player = Players.LocalPlayer

local WALK_ANIMATION_ID = "rbxassetid://YOUR_ANIMATION_ID"

player.CharacterAdded:Connect(function(character)
    local humanoid = character:WaitForChild("Humanoid")
    
    local walkAnimation = Instance.new("Animation")
    walkAnimation.AnimationId = WALK_ANIMATION_ID
    local walkTrack = humanoid.Animator:LoadAnimation(walkAnimation)
    
    humanoid.Running:Connect(function(speed)
        if speed > 0 then
            if not walkTrack.IsPlaying then
                walkTrack:Play()
            end
        else
            walkTrack:Stop()
        end
    end)
end)
violet crag
#

which script

#

mb its down ther

#

thx

trail finch
#

ServerScriptService> Server Script

violet crag
#

?

#

what do I need to do

#

I did the second thing you say but the first I don't understand

trail finch
#

ah

#

both things are different soulations

violet crag
#

the second do nothing when I launch

trail finch
#

you replaced the animation id?

violet crag
#

in the script yes

trail finch
#

use this one

proven talon
trail finch
#
-- ServerScript in ServerScriptService
local Players = game:GetService("Players")

local WALK_ANIMATION_ID = "rbxassetid://YOUR_ANIMATION_ID"

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character:WaitForChild("Humanoid")
        
        local animate = character:WaitForChild("Animate")
        
        animate.walk.WalkAnim.AnimationId = WALK_ANIMATION_ID
        
        animate.run.RunAnim.AnimationId = WALK_ANIMATION_ID
    end)
end)

make sure animation is uploaded by you + use correct rig type + use serverscript notlocal script

frail wharfBOT
#

studio** You are now Level 1! **studio

violet crag
trail finch
violet crag
#

just my skin Rig is R6 but when i join its automatically a R15

#

how do I change this

junior nebula
#

i had that exact same problem yesterday. i'm new to all this too but doing this took me all of yesterday

#

so basically all the tutorials are outdated because roblox just updated where the avatar changes are

violet crag
#

I think you just saved a long of my time

junior nebula
#

glad i could help because i was banging my head against a wall for hours yesterday

frail wharfBOT
#

studio** You are now Level 1! **studio

junior nebula
#

unless your script works. follow what this guy does starting at 2:25 https://www.youtube.com/watch?v=cOzAqBIKEFI

A simple tutorial to show you how to make custom walk/run animations in Roblox Studio. I Hope you enjoyed the video! If you are a bit confused what to do please ask your questions in the comments! 📩

☕ wanna support me? u can always buy me a coffee at: https://buymeacoffee.com/rxbldev
🚀 Join the discord server at: https://discord.gg/29UF...

▶ Play video
violet crag
junior nebula
#

hm

violet crag
#

do its a problem with my animation ?

junior nebula
#

that's what i'd think but idk

#

i'm not a scripting expert by any means that's what i'm trying to figure out today but it could be that the code just makes the animation play once. i honestly would just try replacing the default animations like the video showed

violet crag
#

like this

willow solstice
#

code?

frail wharfBOT
#

studio** You are now Level 23! **studio

violet crag
junior nebula
#

this is what chatgpt says cause i cant script

#

local Players = game:GetService("Players")

local WALK_ANIMATION_ID = "rbxassetid://YOUR_ANIMATION_ID"

Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")

    local walkAnim = Instance.new("Animation")
    walkAnim.AnimationId = WALK_ANIMATION_ID

    local track = humanoid:LoadAnimation(walkAnim)
    track.Looped = true
    track:Play()
end)

end)

violet crag
#

dang I just used your technic

junior nebula
#

oh does that not work

violet crag
#

I think its my animation

eternal goblet
#

you dont have to replace any scripts, i have a game with custom animations in it too

#

You just havent set a animation priority

#

or looped it in the animator

violet crag
#

omg

frail wharfBOT
#

studio** You are now Level 2! **studio

violet crag
#

bro

#

you just save my day

#

it work

eternal goblet
#

glad i could help!

violet crag
proven talon
eternal goblet
#

i love you too gang

frail wharfBOT
#

studio** You are now Level 9! **studio

violet crag
eternal goblet
#

are you using a custom characteR?

eternal goblet
#

it has to be on actual Roblox

violet crag
#

like in team play you mean in studio

violet crag
eternal goblet
#

that doesn’t work for animations

#

it has to be an actual Roblox game for the animations to work

#

they don’t work for everyone in studio

#

just you

violet crag
#

ok so its ok if they don't see it