How would I add to position relative to lookvector of it?

as the title says how do i add to a CFrame position relative to lookvector?

this is my code

viewmodelHead.CFrame = CFrame.new(Camera.CFrame.Position + Vector3.new(0, 0, 0 + blockPositioning)) * Camera.CFrame.Rotation * CFrame.Angles(math.rad(TurnX), math.rad(TurnY), 0)

for example, when doing this, Camera.CFrame.Position + Vector3.new(0, 0, 3.2). i want the 3.2 offset to add like the picture shown

You multiply it with a cframe rather than adding it as a vector

viewmodelHead.CFrame = CFrame.new(Camera.CFrame.Position) * CFrame.new(0, 0, -blockPositioning) * Camera.CFrame.Rotation * CFrame.Angles(math.rad(TurnX), math.rad(TurnY), 0)

it still does the same thing, it didnt work

From the code i see that you are trying to position it infront of the camera am i right?

if so then do this

viewmodelHead.CFrame = Camera.CFrame * CFrame.new(0, 0, -blockPositioning) * CFrame.Angles(math.rad(TurnX), math.rad(TurnY), 0)
1 Like

yeah i forgot about that, thank you

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