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

how to add 2 Values on Variable using tweenservice?

Asked by 4 years ago
Edited 4 years ago

i'm trying to put 2 things on tween but idk the problem with my script

its unable to cast value to object is the error..

local TweenService = game:GetService("TweenService")
local part = {LeftHand,RightHand}

local TweeningInformation = TweenInfo.new(
 1,
 Enum.EasingStyle.Quad,
 Enum.EasingDirection.Out,
 0,
 false,
 0
)

local PartProperties = {
 Color = Color3.fromRGB(0,0,0)
}

local Tween = TweenService:Create(part,TweeningInformation,PartProperties)

Tween:Play()

1 answer

Log in to vote
0
Answered by 4 years ago

You cannot use :Create() to tween more than one part at a time. You could create a custom function to do it for you but the easiest way around this is to just make two different tweening variables and play them separately.

local Tween1 = TweenService:Create(LeftHand,TweeningInformation,PartProperties)
local Tween2 = TweenService:Create(RightHand,TweeningInformation,PartProperties)

Tween1:Play()
Tween2:Play()

Info on the Create function

Ad

Answer this question