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

How to make animations i make (ex. walking, crouching, crawling) work?

Asked by 7 years ago

OK, i know how to use the animator by getting the plugin, but i don't know how to make them work when, for example, i walk around my game. Any ideas?

0
There is a wiki page that explains how to use animations, http://wiki.roblox.com/index.php?title=Animations User#5423 17 — 7y
0
^^ that. Also use the default animation script as reference. Meltdown81 309 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

You can modify the Character's Animate script by copying the Character's Animate Script and placing it in the StarterPlayer>StarterCharacterScripts Folder

From there you can plugin your own Walk Animation

Here's the Animate Script found in the Character by default.

function   waitForChild(parent, childName)
    local child = parent:findFirstChild(childName)
    if child then return child end
    while true do
        child = parent.ChildAdded:wait()
        if child.Name==childName then return child end
    end
end

local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "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 }
            },

------------------ Right here you Delete the Default Animation URL and Insert your Custom Walk Animation URL In Here
    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 } 
            },

Ta-Da! That's All. It's ready to work, just don't change the Animate Script's Name to anything else, keep it as it is.

Ad

Answer this question