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

Why isn't my tween service union changing at all?

Asked by 4 years ago

I am trying to make a simple union change oirentation and position but when I run the code I get the error "Attempt to call a userdata value,line 9". Any ideas?

local TweenService = game:GetService("TweenService")

local debounce = false

local MovingDoor = script.Parent.Parent.MovingDoor

local TweenOpen = TweenService:Create(MovingDoor,

     TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)

    {Position = Vector3.new(410.859, 74.142, 19.051),
     Orientation = Vector3.new(0, 135, 90)}
)

TweenOpen:Play()

1 answer

Log in to vote
0
Answered by 4 years ago

Try something like this, I split the position and orientation into separate tweens and tweaked a bit of the tweens.

local TweenService = game:GetService("TweenService")

local debounce = false

local MovingDoor = script.Parent.Parent.MovingDoor

local TweenPosition = TweenService:Create(MovingDoor, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {Position = Vector3.new(410.859, 74.142, 19.051)})
local TweenOrientation = TweenService:Create(MovingDoor, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {Orientation = Vector3.new(0, 135, 90)})

TweenPosition:Play()
TweenOrientation:Play()
Ad

Answer this question