TweenService debugging

Trying to make a elevator door tween that moves when the proximity prompt is triggered. I’ve been struggling with how the cframes work and no matter what I do, it goes to the debugging screen.

-- door original position = -140.075, -8.6, -481.725
-- door new position (cframe) = {-140.075, -23.35, -481.725}, {0, 90, 0}

local prompt = script.Parent
local keycardReader = script.Parent.Parent
local keycardReaderColor = script.Parent.Parent.ColorChange
local largeDoor = game.Workspace.largeElevatorDoor1
local largeElevatorDoorCurrentlyOpening = game.ReplicatedStorage.largeElevatorDoorCurrentlyOpening
local largeElevatorDoorOpen = game.ReplicatedStorage.largeElevatorDoorOpen
local TweenService = game:GetService("TweenService")
local function doorOpen()
	largeElevatorDoorCurrentlyOpening.Value = true
	keycardReaderColor.Color = Color3.fromRGB(255, 0, 0)
	TweenService:Create(
		largeDoor,
		TweenInfo.new(
			4,
			Enum.EasingStyle.Sine,
			Enum.EasingDirection.InOut,
			0,
			false,
			0
		),
		{CFrame = {-140.075, -23.35, -481.725}, {0, 90, 0}}
	):Play()
end

prompt.Triggered:Connect(function()
	doorOpen()
end)

Any help with this would be greatly appreciated.

1 Like

This line isn’t doing anything for you. You need to call a CFrame.new() constructor.

EX:

local NewCFrame = CFrame.new(-140.075, -23.35, -481.725)
{CFrame = NewCFrame * CFrame.Angles(0, math.rad(90), 0)}
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.