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

I am attempting to load a KeyFrameSequence into the player's humanoid, how to fix the error?

Asked by 4 years ago
local animation = workspace["animation"]
local track = workspace.Dummy.Humanoid:LoadAnimation(animation)
while true do wait(1.05)
    track:Play()
    end

The error i get is

  17:05:01.728 - LoadAnimation requires an Animation object
17:05:01.774 - Stack Begin
17:05:01.775 - Script 'Workspace.Script', Line 2
17:05:01.776 - Stack End

This is because im using a keyframesequence instead of a normal animation. and i dont wanna export the animation to roblox.

1 answer

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


-- create the keyframesequence local keyframeSequence = Instance.new("KeyframeSequence") keyframeSequence.Loop = false keyframeSequence.Priority = Enum.AnimationPriority.Action -- create a keyframe local keyframe = Instance.new("Keyframe") keyframe.Time = 0 -- create sample poses local rootPose = Instance.new("Pose") rootPose.Name = "HumanoidRootPart" rootPose.Weight = 0 local lowerTorsoPose = Instance.new("Pose") lowerTorsoPose.Name = "LowerTorso" lowerTorsoPose.Weight = 1 -- set the sequence hierarchy rootPose:AddSubPose(lowerTorsoPose) -- lowerTorsoPose.Parent = rootPose keyframe:AddPose(rootPose) -- rootPose.Parent = keyframe keyframeSequence:AddKeyframe(keyframe) -- keyframe.Parent = keyframeSequence -- parent the sequence keyframeSequence.Parent = workspace
0
No I'm trying to play a animation thats already existing in workspace. Not create it! antoniorigo4 117 — 4y
Ad

Answer this question