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

How do i make the Tween accept CFrame instead of Vector3?

I am building a gate that needs to fall down once the loading screen is done. And since it needs to fall trough something I need to use CFrame however, it does not accept CFrame information. Is there any way I can change that? Btw. I would also like to be able to change the duration of the tween, how would I do that?

local Gate = game.Workspace.Castle.GATE
local TweenSevice = game:GetService("TweenService")

Gate.Position = CFrame.new(260.528, 121.642, 541.052)
Gate.Anchored = true

local goal = {}
goal.Position = CFrame.new(260.528, 108.642, 541.052)

local tweenInfo = TweenInfo.new(5)

local tween = TweenSevice:Create(Gate,tweenInfo,goal)

1 answer

✓ Accepted answer

Position is a Vector3 value, you cannot turn that into a CFrame.

EDIT:

Just turn goal.Position into goal.CFrame

2 comments

0

But Vector3 does not allow parts to go through each other.

0

Thanks.

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