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

(solved) Inverse Kinematics in a script?

Asked by 4 years ago
Edited 4 years ago

I want to know if roblox allows for animations to be generated using a script in order to give walking a realistic feel. Right now I'm just using separate leg raising animations but they are very glitchy.

game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
game.Workspace[game.Players.LocalPlayer.Name]:WaitForChild("Humanoid")
local rleg = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.rleg)
rleg.Priority = Enum.AnimationPriority.Action
local lleg = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.lleg)
lleg.Priority = Enum.AnimationPriority.Action
character = game.Players.LocalPlayer.Character
character.Humanoid.HipHeight = 2.5

game:GetService("RunService").Heartbeat:Connect(function(frame)
    character.LeftFoot.Touched:Connect(function(part)
        lleg:Play()
    end)
    character.LeftFoot.TouchEnded:Connect(function(part)
        lleg:AdjustSpeed(0)
    end)
    character.RightFoot.Touched:Connect(function(part)
        rleg:Play()
    end)
    character.RightFoot.TouchEnded:Connect(function(part)
        rleg:AdjustSpeed(0)
    end)
end)

Example Here

1 answer

Log in to vote
0
Answered by 4 years ago

yes, it does.. using the KeyframeSequenceProvider, KeyFrames, and Pose objects.. learn more here.

Pose.CFrame allows is a property that tells you the CFrame that will be applied to a limb.. you can change it too..

0
Didn't know this existed, thank you. boomthefist 6 — 4y
Ad

Answer this question