Hey everyone, I am yet again asking for your assistance.

Here is the script:

local tool = script.Parent
local player = game.Players.LocalPlayer

tool.Activated:Connect(function()
	
	local part = game.Workspace:FindFirstChild("BariWall")
	local ClonedPart = part:Clone()
	part.Parent = workspace
	part.Position = player.Character:WaitForChild("UpperTorso").Position 
	
end)

What this script does:

In this script, every time the tool is activated, it spawns a wall directly on the side of the UpperTorso. I am wondering if it is posible to change the position(Last line), to something that spawns it in the position + 5 studs(or so) 

Any help is appreciated

3 comments

1

Use the HRP's CFrame as it will respect the current orientation and direction of your character. As for offsetting the placement, multiply the HRP's CFrame by another with your desired padding.

1

If you do not want your part's orientation to align with the character's, set its Position to the HRP's LookVector and offset it by adding another vector with your desired padding.

1

If you want to disrespect both orientation and direction, simply perform the last step of #2 on your current code.