Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Apply Tweening To An Entire Model?

Asked by 6 years ago

So I am working on an elevator using Tweening. It works fine with this script however I want to use as few scripts as possible to move the entire elevator. I could just put this in every part in the elevator but how can I apply one script to all the parts in the elevator model?

platform = script.Parent

local TweenService = game:GetService("TweenService")

local TweenInfo = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)

local platformMove = {CFrame = platform.CFrame + platform.CFrame.upVector * 11}

local openFunction = TweenService:Create(platform,TweenInfo,platformMove)


openFunction:Play()
0
Set a PrimaryPart to your model and modify it using SetPrimaryCFrame and GetPrimaryCFrame: http://wiki.roblox.com/index.php?title=API:Class/Model/PrimaryPart ScriptGuider 5640 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You could use a

for i, v in pairs () do

loop, but bear in mind that each objects CFrame can be affected in different ways when using this.

You can find a link about this type of loop here.

Ad

Answer this question