So I'm working on a small placement system, their isn't much to the code. But I am having a hard time figuring out how to detect collision with other parts they they place down. As well as how to make it so they can't place within like 1-2 studs of another part.
Here is my code so far:
local model = workspace.Brick;
game:GetService("RunService").RenderStepped:connect(function()
if mouse.Target then
if mouse.Target.Name == "Baseplate" then
model.CFrame = CFrame.new(mouse.Hit.p.X, mouse.Hit.p.Y, mouse.Hit.p.Z);
else
print('not good');
end
end
end)
Any help would be appreciated, thanks.
