How to make an object move "forward"?

Hello devs! I am trying to make a weaponised cube go forward in the direction the player is facing. I know how to use tweening, but I want to get the position that is, for example, 50 studs forward from where the player is facing.

Trouble is, I don’t know how to do that.

Any help?

To get a CFrame relative to another CFrame, just multiply them together.

-- 50 studs forward relative to HumanoidRootPart
local forwardPosition = humanoidRootPart.CFrame * CFrame.new(0, 0, -50)
1 Like

It was that simple? Thank you so much!

Vector3 and CFrame have their individual use cases.
CFrame for your case is better considering it is in localspace. so left is left from wherever said thing is aimed at.
Vector3 works in globalspace/worldspace, so left is left from north no matter the direction

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