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
1local animation = workspace["animation"]
2local track = workspace.Dummy.Humanoid:LoadAnimation(animation)
3while true do wait(1.05)
4    track:Play()
5    end

The error i get is

1  17:05:01.728 - LoadAnimation requires an Animation object
217:05:01.774 - Stack Begin
317:05:01.775 - Script 'Workspace.Script', Line 2
417: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
01-- create the keyframesequence
02local keyframeSequence = Instance.new("KeyframeSequence")
03keyframeSequence.Loop = false
04keyframeSequence.Priority = Enum.AnimationPriority.Action
05 
06--  create a keyframe
07local keyframe = Instance.new("Keyframe")
08keyframe.Time = 0
09 
10-- create sample poses
11local rootPose = Instance.new("Pose")
12rootPose.Name = "HumanoidRootPart"
13rootPose.Weight = 0
14 
15local lowerTorsoPose = Instance.new("Pose")
View all 25 lines...
0
No I'm trying to play a animation thats already existing in workspace. Not create it! antoniorigo4 117 — 4y
Ad

Answer this question