Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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()

This discussion is preserved as it was. New answers, comments, and votes are closed.