Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a brick spawn in front of another brick based on LookVector?

Asked by 5 years ago
function summonBrick()
local brick = instance.new("Part")
brick.name = 'Bricc'
brick.Size = Vector3.new(1,1,1)
brick.brickcolor = BrickColor.new("White")
brick.Parent = game.Workspace
brick.Anchored = true
brick.Position = Vector3.new(0,0,0)
wait(1)
local brick2 = instance.new("Part")
brick2.name = 'Bricc2'
brick2.Size = Vector3.new(1,1,1)
brick2.Anchored = true
brick2.brickcolor = BrickColor.new("White")
brick2.Parent = game.Workspace
brick2.Cframe = birck.Cframe + Vector3.new(0,0,3) -- I can make the brick spawn 3 studs away from "brick" in accordance with the "z" axis.
end

I cannot figure out how to make the brick spawn 3 studs out based off the LookVector

1
brick2.Cframe = birck.Cframe * CFrame.new(0, 0, -3) Artallous 2 — 5y
1
dude please! Please indent your code! My eyes are burning just looking at this mess! User#21908 42 — 5y
0
OMG User#19524 175 — 5y
0
post the answer i n the answer section for credit EliteRayGawnX2 124 — 5y

Answer this question