function sort(tablevar)
local sorted = {}
for i, v in pairs(tablevar) do
table.insert(sorted, i, v)
v = nil
end
tablevar = sorted
end
anims.animations = {}
function anims.init()
local debounce = true
for i, animation:Instance in script.Parent.Parent.animations:GetChildren() do
local keyframes = animation:GetChildren()
local list = anims.animations
list[animation.Name] = {}
list[animation.Name]["keys"] = {}
list[animation.Name]["keys"]["times"] = {}
warn("if repeating fix: anims loop")
for i,keyframe:Keyframe in keyframes do
local edits = keyframe:GetDescendants()
keyframe.Name = "keyframe"..i
list[animation.Name]["keys"][keyframe.Name] = {}
list[animation.Name]["keys"][keyframe.Name]["cframes"] = {}
list[animation.Name]["keys"][keyframe.Name]["motors"] = {}
for i, edit:Pose in edits do
debounce = false
if edit.Name == "HumanoidRootPart" then continue end
local motors = {}
for i,child in script.Parent.Parent:GetDescendants() do
if child:IsA("Motor6D") then
motors[child.Name] = child
end
end
local currentmotor = motors[edit.Name]
local cframe = edit.CFrame
table.insert(list[animation.Name]["keys"][keyframe.Name]["cframes"], cframe)
table.insert(list[animation.Name]["keys"][keyframe.Name]["motors"], currentmotor)
task.wait()
end
table.insert(list[animation.Name]["keys"]["times"], keyframe.Time)
end
end
script.Parent.Parent.animations:ClearAllChildren()
return anims.animations
end
return anims```
#is it possible to play the anims
1 messages · Page 1 of 1 (latest)
why arent you just playing the animations
to move head it moves motor6d but anim resets the motor
so im doing this'
how to play the animations'
you dont know how to play it???
animator:LoadAnimation()??
bro look at the script up there as im trying to make it so when an animation is playing if im controlling motor6ds they wont snap back into place
** You are now Level 4! **