So I’ve got this tool that deploys a barricade. I want to make it so that whenever or wherever the player is, and they deploy the barricade, the barricade model will spawn directly in front of them instead of depending on the direction the player is standing. I don’t really know how to do that, so help?
local fRay = Ray.new(character.HumanoidRootPart.Position, character.HumanoidRootPart.CFrame:vectorToWorldSpace(Vector3.new(0, 0, -6)))
local hit, position = game.Workspace:FindPartOnRay(fRay, character)
local ray = Ray.new(position, Vector3.new(0, 0, 0))
local hit, pos = game.Workspace:FindPartOnRay(ray, character)
local turret = game.ReplicatedStorage.Barricade:Clone()
turret.Name = ""
turret.Creator.Value = player
turret:SetPrimaryPartCFrame(CFrame.new(pos + Vector3.new(0, 0, 0)))
turret.Parent = game.Workspace