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

How to make a placement system have block collisions?

Asked by 3 years ago

Hello! I've been recently working in a block placement system using mouse.Hit, and I'm stuck with a problem; I don't know how to make the blocks not go through others.

This is the code I have:

01local player = game.Players.LocalPlayer
02local mouse = player:GetMouse()
03local runservice = game:GetService("RunService")
04local ts = game:GetService("TweenService")
05 
06 
07local part = Instance.new("Part", workspace)
08part.Size = Vector3.new(4,4,4)
09 
10mouse.TargetFilter = part
11part.CanCollide = false
12part.Anchored = true
13part.Material = Enum.Material.SmoothPlastic
14 
15mouse.Move:Connect(function()
View all 22 lines...

I don't really know how to explain, but when you try to place a block on a wall, the block goes inside the wall and it does z-fighting. The thing I'm trying to do is making the blocks not collide with each other while being placed.

Answer this question