Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Spawn object 10 blocks up and in front of the players torso?

I have a script that is supposed to place a brick above and in front from the player's torso. I believe I can achieve this with LookVectors, but I every attempt doesn't work. Any help is appreciated.

2 comments

0

This is not a request site. Please provide us code so we can make changes and point out errors to help you

0

I didn't realise my post was requesting code. Just asked how to modify CFrames using LookVectors.

1 answer

✓ Accepted answer

You can reference a parts "front" side by using cframe look vector like this:

local studsForward = 10
local createdPart = Instance.new("Part", workspace)
createdPart.CFrame = Part.CFrame + Part.CFrame.LookVector * studsForward

-- add 10 studs above with Vector3
createdPart.Position = createdPart.Position + Vector3.new(0,10, 0)

This discussion is preserved as it was. New answers, comments, and votes are closed.