Connect placed walls at corners

Here we have walls a player has placed in game. They are split in half, so 1 half is yellow, other half is blue (this is for visual aid)


As you can see, the blue side connects fine, cause of the angle, however, the 2 yellow walls needed to be connected at the corner to make a flush edge

(example from Bloxburg of what I am after)

Now when placing walls, poles are created as guides. When the server places the walls, the poles are stored in a seperate folder and made invisible, so their CFrames can be saved.

local function checkPreviousPoles(poles, wall, pole1, pole2)
	for _, v in pairs(poles:GetChildren()) do
		if v.CFrame == pole1.CFrame or v.CFrame == pole2.CFrame then
			print('attaching needed')
			-- walls need to be attached at corners
		end
	end
end

poles > Folder where all poles are stored
wall > the actual wall being created
pole1 > The first pole
pole2 > The second pole

This fires whenever a wall being placed needs to have one of its edges resized, as a wall has been placed with 2 poles in the same spot (like in the first image) So this works, it prints when the walls need to be attached, but I’m not sure where to go from here. I’ve tried looking at the GapFill plugin to no avail.


This shows how the Poles are stored. They also contain an ObjectValue so I can do v.PolesWall.Value to find which wall also needs moving.

2 Likes

Couldn’t you just add the thickness of the yellow portion to the length of it?

1 Like

5 years… do you have the solution lol?

1 Like

This may be of use :slight_smile: