YouHello, I wonder how you would go about passing the frames of an animation so that what is inside the animsaves folder passes the keyframes (the CFrame) to a dictionary to reproduce the frames by code
Are you looking to pass the CFrame values of keyframes from the animsaves folder to a dictionary for reproducing frames through code?
1 Like
Yes this is correct, help me p
lease
Try this.
-- Assuming 'animsaves' is a folder containing keyframes
local keyframesDictionary = {}
-- Access the 'animsaves' folder
local animSavesFolder = game.Workspace.animsaves
-- Populate the dictionary with CFrame values
for _, keyframe in pairs(animSavesFolder:GetChildren()) do
-- Check if the child is a Keyframe (adjust the condition based on your implementation)
if keyframe:IsA("Keyframe") then
-- Store the CFrame value in the dictionary using the keyframe's name as the key
keyframesDictionary[keyframe.Name] = keyframe.CFrame
end
end
-- Access the model or part where you want to apply the keyframes
local targetModel = game.Workspace.YourTargetModel
-- Reproduce frames using the dictionary
for keyframeName, cframe in pairs(keyframesDictionary) do
-- Find the part or object in the target model with the same name as the keyframe
local targetPart = targetModel:FindFirstChild(keyframeName)
-- Apply the CFrame if the part exists
if targetPart then
targetPart.CFrame = cframe
end
end