How would I create a wall system like this?

I recently came across a post by @Imaginze which showcased an amazing building system with a unique wall system that I haven’t seen in many games on Roblox.

Currently I have a simple placement system that allows the user to place models but all it does it calculate the position based on the mouse and move the model to that position until it’s ready to be placed there forever.
image

Can someone point my in the right direction as to how I can achieve this wall system?

4 Likes

This is not a place to ask for code.


What you will have to do is find the position of the mouse when they click, instance in a part, and then find the position of the mouse with RunService.RenderStepped, or you can use Mouse.Move. Then, everytime the mouse moves, it will update the part’s position, and when the mouse button is down again, you clone the part to the workspace and disconnect all the functions with :Disconnect()

1 Like

They weren’t asking for the code, simply on help on how to script the above which is what the DevForum is for…

I asked something similar, someone gave me an Open Sourced system, which is not fully completed, but you can build walls.

Do I really have to point this out… OP is not asking for code, just some advice.

For OP, I believe The Conquerors has implemented this wall system (it’s been several years from now). You would need to update a part’s size and position, but that’s tricky because it seems like the wall has two anchored points and can only move in two dimensions.

Since you have a height Y that is constant, you can use some basic trig to calculate what the position should be in the XZ plane. The position depends on the mouse’s position on the part you are placing the wall post on top of. When you find what that position is, you can calculate the distance between the wall posts and the length of the wall, and can then set the orientation knowing tan(R) = Z/X, which is the rotation you apply in the XZ plane. You might need to play around with the angle in order to rotate about the pivot wall post, and to make sure it doesn’t rotate the opposite direction. The Y orientation is constant.

If you don’t understand, I suggest reading up on some trigonometry. If you know trig and still don’t understand, I would also suggest to read up on CFrames and orientation in general, as this is the tricky part of the coding process.

Hope this helps

5 Likes

Again, I am not asking for code just advice as @tralalah said.

I also already have the system you mentioned in place, please read my post.

Currently learning advanced trig in school so this is really helpful to me thanks, I will update you if I can get it to work.

1 Like

I managed to achieve a system like the one you show here. Basically break it down into what’s going on.

  • Beginning of placement starts with 1 pole. Have that pole move with the players mouse (snap to grid as well if you want that)
  • Once they click, place that original pole down, create a new pole and have the new people follow the mouse. Then while that’s happening, create a wall to fill between the original pole and the new poles positions.

Without diverging too much of my code, here’s just a chunk for how I generated the wall between the two poles:

GenerateWall = RunService.RenderStepped:Connect(function()
	if Pole1 and Pole2 then	
		WallPart.Size = Vector3.new((Pole1.Position - Pole2.Position).Magnitude, 12, 0.4)
		WallPart.CFrame = CFrame.new(
			Pole1.Position + 0.5 * (Pole2.Position - Pole1.Position),
			Pole1.Position + 0.5 * (Pole2.Position - Pole1.Position) + (Pole1.Position - Pole2.Position).Unit:Cross(Vector3.new(0, 1, 0))
		)
	end
end)

I also used this. Really good place to get started with, gives you all the code you need. Can easily be taken and reworked to your liking! :smiley:

4 Likes

I just want to point out that more often than not, you would want a boundary in which you can place your objects (a pole in this case). In that instance, you need to get the orientation of a surface’s normal then clamp this surface to get the size of which your model can move within.

I’m going to drop this article here, by the lord and saviour EgoMoose.
Btw, once you’ve taken any of his knowledge, you’re obliged to join the cult and pay a fee which is quite frankly astronomic but it is WORTH IT!

1 Like