This is the MOST easiest way out there, and it requires NO WELDING or some other complicated method.
This also won’t require you to tween every single property of the model.
This uses i,v in pairs.
Without further ado, let’s get started.
First off, you will have to insert a ServerScript
, a.k.a a Script
in your model.
This is basically how it’s going to work:
Basically mass-selects all the movable properties of the model and moves their position. Yep. Easy as that, nothing as stupid as welding.
Paste this to your script:
local waittime = 10 -- How long will this tween(animation) last?
local moveXstuds = 0 -- How many studs in X axis should it move?
local moveYstuds = 27 -- How many studs in Y axis should it move?
local moveYstuds2 = 0 -- How many studs in Z axis should it move?
local TweenService = game:GetService("TweenService") -- Referencing the TweenService
local tweenInfo = TweenInfo.new(
waittime, -- Time
Enum.EasingStyle.Sine, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching its goal)
0 -- DelayTime
)
function ascend()
for i,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Union") or v:IsA("MeshPart") or v:IsA("Part") or v:IsA("CornerWedgePart") or v:IsA("WedgePart") or v:IsA("TrussPart") then
local tween = TweenService:Create(v, tweenInfo, {Position = v.Position + Vector3.new(moveXstuds,moveYstuds,moveZstuds)})
tween:Play()
end
end
end
function descend()
for i,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Union") or v:IsA("MeshPart") or v:IsA("Part") or v:IsA("CornerWedgePart") or v:IsA("WedgePart") or v:IsA("TrussPart") then
local tween = TweenService:Create(v, tweenInfo, {Position = v.Position - Vector3.new(moveXstuds,moveYstuds,moveZstuds)})
tween:Play()
end
end
end
wait(1)
ascend()
wait(waittime)
descend()
Customize the script and you should be able to successfully tween a model.
This was my first tutorial on the DevForum, please let me know if I made any mistakes.