Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

(solved) Inverse Kinematics in a script?

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

✓ Accepted answer

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..

1 comment

0

Didn't know this existed, thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.