I want to tween parts or models like the referenced videos below, but how would I go about doing it? I did hear there was a module or whatever for something like this but what module and how could you do it without it?
You could try something like this:
local Model : Model = nil -- Set to model
local Info = TweenInfo.new(0.3, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local TweenService = game:GetService("TweenService")
local function OnePartAtATime(Part : BasePart)
local GoalSize = Part.Size
Part.Size = Vector3.new(0,0,0)
Part.Transparency = 0
local MainTween = TweenService:Create(Part, Info, {["Size"] = GoalSize})
MainTween:Play()
MainTween.Completed:Wait()
end
for i, v in Model:GetDescendants() do
if v:IsA("BasePart") then
v.Transparency = 1
end
end
for i, v in Model:GetDescendants() do
if v:IsA("BasePart") then
OnePartAtATime(v)
end
end
This is a start, but you might need to fit it to your needs!
Edit:
Made an edit to the example above with Transparency
Thanks, any chance you also know how to do that little color outline thingy as well?
It appears like they used a Highlight Instance and tweened the transparency of it at the same time, starting at 0, ending at 1.
It worked and all but it doesn’t do it like in order like in those videos.
Greetings, what you could do in order to reach the Tweening with the correct order:
local TS = game:GetService("TweenService")
local TI = TweenInfo.new(1) --// Edit the TweenInfo to your liking;
local Model = workspace.Model --// Set your Model Pathway;
local function TweenElement(Element, Props)
local ElementAnim = TS:Create(Element, TI, Props)
ElementAnim:Play()
ElementAnim.Completed:Wait()
end
for Index, Part in pairs(Model:GetDescendants()) do
local Element = Model:FindFirstChild(tostring(Index), true)
if Element then
if Element:FindFirstChild("Highlight") then
task.delay(.25, TweenElement, Element.Highlight, {OutlineTransparency = 1, FillTransparency = 1})
end
TweenElement(Element, {Size = Vector3.new(2, 2, 2); Transparency = 0;})
else
break
end
end
This will make the Elements in your Model Tween by a specific Order which is controlled by the Index. Please make sure to rename your Parts / Elements in the correct Order for example: 1, 2, 3, 4
Result:
I hope I could help you with the provided code / Information.