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

how to prevent overlapping parts in roblox with Anchored on ?

Asked by 4 years ago

Hello, Thank you for your time and effort to solve my problem I appreciate your help :)

I have a problem I have made a script to create parts when clicked and it works fine but the parts are always overlapping in anchored is there a way to not overlapping the parts when anchored is True here is my code.

Local Script --
    local remoteevent=game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

    local Players = game:GetService("Players")
    local localPlayer = Players.LocalPlayer
    local mouse = localPlayer:GetMouse()

    local mouse = localPlayer:GetMouse()
    local position = mouse.Hit
    mouse.Button1Down:Connect(function()
        position=mouse.Hit
        remoteevent:FireServer(position)

        end)

Script --
    local remoteevent=game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
    local mous
    remoteevent.OnServerEvent:connect(function(plr,mousepos)
        local ClickDetector=script.Parent:WaitForChild("ClickDetector")
        local part=Instance.new("Part")
        part.Anchored=true
        part.Parent=script.Parent
        part.CFrame=mousepos
        part.Size=Vector3.new(2,2,2)
        part.Rotation = Vector3.new(0, 0, 0)
    end)

Thanks for your time.

0
like z fighting? GAMER_64T 32 — 4y

Answer this question