How do I know a vector3 in front of a lookvector

Hello! I want to make a part that is in front of the player. But I don’t know how to set the position. Is the script like this?

local part = Instance.new("Part",game.Players.LocalPlayer.Character)
part.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.LookVector * 2
1 Like

You’re setting the part’s position to the “offset” that you want, to correct the code you can do something like this:

local Character = game.Players.LocalPlayer.Character
local part = Instance.new("Part", Character)
part.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2)

for this i used CFrame instead of LookVector since it’s tied directly to the orientation of a part

Well, i didn’t add that since he just asked how to place it in front of the player, nothing else

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