I wanted to include roofs in the build mode system I’ve been working on. Everything ran smoothly. Up until I ran into a significant issue.
In this video, you can see that nodes are a little higher than anticipated. They are therefore not in contact with the baseplate. And that’s the issue.
My code is easy to understand. When the button is activated, it toggles a boolean which allows me to move two nodes, that should create a roof. Here’s the part where I activate the movement of the two parts:
Mouse.Move:Connect(function()
if Mouse.Target then
if Toggle then
if Counter == 1 then
PointA.Parent = workspace
PosA = Vector3.new(Round(Mouse.Hit.p.X, Grid), 0, Round(Mouse.Hit.p.Z, Grid))
PointA.CFrame = CFrame.new(PosA)
elseif Counter == 2 then
PointB.Parent = workspace
PosB = Vector3.new(Round(Mouse.Hit.p.X, Grid), 0, Round(Mouse.Hit.p.Z, Grid))
PointB.CFrame = CFrame.new(PosB)
end
end
end
end)
If you are wondering, PosA
and PosB
are found in this code:
local pos1 = PointA.Position
local pos2 = PointB.Position
local diff = pos2-pos1
part.Position = (pos1+pos2)/2
PosA = pos1
PosB = PosB
Any help is appreciated! Thank you.