This script builds a model by tweening, however, when I run it, the brick's rotations are fine, but the parts all go to position (0,0,0). How do I fix this? Am I doing something wrong? Here's the script:
wait (5)
for index, child in pairs(workspace.ItemF.Model:GetChildren()) do
local TweenService = game:GetService("TweenService")
local Part = child
local Position = child.Position
local info = TweenInfo.new(
0.5,
Enum.EasingStyle.Back,
Enum.EasingDirection.Out,
0,
false,
0
)
script.Parent.Value.Value = Vector3.new(Position.X,Position.Y+0.5,Position.Z)
local Goals =
{
Transparency = 0;
CFrame = CFrame.fromEulerAnglesXYZ(Part.Orientation.X,Part.Orientation.Y,Part.Orientation.Z, CFrame.new(script.Parent.Value.Value.X,script.Parent.Value.Value.Y,script.Parent.Value.Value.Z));
}
local Tween = TweenService:Create(Part,info,Goals)
Tween:Play()
wait (0.1)
end

1 comment
It worked! Thanks!