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

How to make tweens right orientation?

I have a simple tween sliding door but when I play it, it turns 90 degrees which is not what it is meant to do.

Here is the code:

local TweenService = game:GetService("TweenService")
local door = script.Parent:WaitForChild("Door")

local tweeningInformation = TweenInfo.new(
    7,   
    Enum.EasingStyle.Quad,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
local door1Open = {CFrame = CFrame.new(-210.651, 4.164, 158.961)}
local door1Close = {CFrame = CFrame.new(-210.651, 4.164, 155.536)}
local tween1open = TweenService:Create(door,tweeningInformation,door1Open)
local tween1close = TweenService:Create(door,tweeningInformation,door1Close)

script.Parent.Entrance.ClickDetector.MouseClick:Connect(function()
    tween1open:Play()
    wait(10)
    tween1close:Play()
end)

script.Parent.Exit.ClickDetector.MouseClick:Connect(function()
	tween1open:Play()
	wait(10)
	tween1close:Play()
end)

Thanks

1 answer

Maybe you'll want to try adding Position?

-- p means position. You can use it if you want to be more specific when you're getting CFrame
local tween1open = TweenService:Create(door,tweeningInformation,door1Open.p)
local tween1close = TweenService:Create(door,tweeningInformation,door1Close.p)

1 comment

0

Hi!, when I add that it just doesnt work at all, its strange.

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