Trouble with modifying a CFrame with Vector3

I need help with modifying a CFrame to move it back by a specific position.

I attempted to do this by creating a new CFrame with the CFrame of a players head and multiplying it by a Vector 3, then setting the combination of both CFrames in the Property table.

Instead, it just returns an error saying that a Vector3 is expected? Error location happens at the PTable variable.

Ive tried looking around, but solutions I’ve tried are too far or not related to my problem.
Sorry if this is a dumb question, I appreciate any help!

local TS = game:GetService("TweenService")

TSinfo = TweenInfo.new(1.5, Enum.EasingStyle.Circular, Enum.EasingDirection.In, 0, false, 0)
Head = plr.Character:WaitForChild("Head").CFrame
Modifier = Vector3.new(0, 0, -5)
Final = CFrame.new(Head * Modifier)
PTable = {CFrame = CFrame.new(Final)}
--//-----------------//--
local Tween = TS:Create(camera, TSinfo, PTable)
	Tween:Play()
	wait(1.5)

When constructing a new CFrame, a Vector3 (position) is expected.

You also can’t multiply a CFrame by a Vector3. You should instead do:

Final = Head * CFrame.new(Modifer)

Note, however, that this will be a relative offset. If you want to offset using world position, you’ll need to add instead:

Final = Head + Modifier

Try this instead, since Final is already a CFrame.
CFrame = Final

Thank you so much! Im so sorry for making such a dumb mistake. I appreciate it a lot!

1 Like

Thanks for telling me, about the relative offset, Ill keep in mind when making new tweens. Appreciate the help a lot!

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