Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my character's walk animation not working?

Asked by 3 years ago

Hi, i'm trying to override the animations of the player, but the walk animation does not work, it just comes as the legs and arms straight together. Here is my script - it is a normal script located in Server Script Service:

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        warn("forcing out regular anims, replacing...")
        wait(3)
        char.Animate:WaitForChild("jump"):WaitForChild("JumpAnim").AnimationId = "http://www.roblox.com/asset/?id=507765000"
        print("jump")
        wait(0.2)
        char.Animate:WaitForChild("fall"):WaitForChild("FallAnim").AnimationId = "http://www.roblox.com/asset/?id=507767968"
        print("fall")
        wait(0.2)
        char.Animate:WaitForChild("walk"):WaitForChild("WalkAnim").AnimationId = "http://www.roblox.com/asset/?id=507777826"
        wait(0.2)
        print("walk")
        char.Animate:WaitForChild("run"):WaitForChild("RunAnim").AnimationId = "http://www.roblox.com/asset/?id=5077677142"
        print("run")
        wait(0.2)
        char.Animate:WaitForChild("idle"):WaitForChild("Animation1").AnimationId = "http://www.roblox.com/asset/?id=507766388"
        char.Animate:WaitForChild("idle"):WaitForChild("Animation1"):WaitForChild("Weight").Value = 9
        wait(0.075)
        char.Animate:WaitForChild("idle"):WaitForChild("Animation2").AnimationId = "http://www.roblox.com/asset/?id=507766666"
        char.Animate:WaitForChild("idle"):WaitForChild("Animation2"):WaitForChild("Weight").Value = 1
        print("idle")
        wait(1)
    end)
end)

Line 11 is my target that i'm confused on. It is the default animation for moving, yet, as i said, the player comes out as it's legs and arms straight. This script is for r15 character only.

Could i have some help please?

Thanks in advance, DarxMasterX

0
For some reason the lines were too long, so line 11 which is my target spills a little bit onto line 12 User#34345 0 — 3y
0
did you check the animation priorities? Dovydas1118 1495 — 3y
0
yes, they are exactly as they are meant to be User#34345 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Press play in studio on your game and then go into your character in the workspace. Press the dropdown and find the local script "Animate". Copy this script and stop playing. Paste the script into StarterPlayer > StarterCharacterScripts. Edit the script and replace something like this:

(Change the animation ids to the ones you want to change!)

local Figure = script.Parent
local Torso = Figure:WaitForChild("Torso")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightHip = Torso:WaitForChild("Right Hip")
local LeftHip = Torso:WaitForChild("Left Hip")
local Neck = Torso:WaitForChild("Neck")
local Humanoid = Figure:WaitForChild("Humanoid")
local pose = "Standing"

local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0
local animTable = {}
local animNames = { 
    idle =  {   
                { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
                { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
            },
    walk =  {   
                { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } 
            }, 
    run =   {
                { id = "run.xml", weight = 10 } 
            }, 
    jump =  {
                { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 } 
            }, 
    fall =  {
                { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 } 
            }, 
    climb = {
                { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } 
            }, 
    sit =   {
                { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 } 
            },  
    toolnone = {
                { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 } 
            },
    toolslash = {
                { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 } 
--              { id = "slash.xml", weight = 10 } 
            },
    toollunge = {
                { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 } 
            },
    wave = {
                { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 } 
            },
    point = {
                { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 } 
            },
    dance1 = {
                { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 }, 
                { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 }, 
                { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 } 
            },
    dance2 = {
                { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 }, 
                { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 }, 
                { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 } 
            },
    dance3 = {
                { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 }, 
                { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 }, 
                { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 } 
            },
    laugh = {
                { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 } 
            },
    cheer = {
                { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 } 
            },
}

And it should work. Reply if it doesn't work.

Ad

Answer this question