Hello!
I’m making my Placement System for models and I need to detect if model is not collisioning with another model but I need to ignore parts of that model player want to place, I’m using primary part that look like this
But I don’t know how to ignore parts in that model, My script
local PlaceObject = game.ReplicatedStorage.PlaceObject
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TransparencyDelta = 0.5
local Player = game.Players.LocalPlayer
local Mouse = game.Players.LocalPlayer:GetMouse()
local goodToPlace = false
local isPlacing = false
local StartKey = Enum.KeyCode.P
local RotateKey = Enum.KeyCode.R
local TerminateKey = Enum.KeyCode.X
function FindPlot(plrname)
for _,s in pairs(game.Workspace.Plots:GetChildren()) do
if s.owner.Value == plrname then
return s
end
end
end
UIS.InputBegan:Connect(function(input)
if input.KeyCode == StartKey and isPlacing == false then
isPlacing = true
local ClientStructure = game.ReplicatedStorage.TESTPART:Clone()
ClientStructure.Parent = workspace
for _,obj in pairs(ClientStructure:GetChildren()) do
if obj:IsA("Part") or obj:IsA("MeshPart") or obj:IsA("UnionOperation") then
obj.Transparency = TransparencyDelta
end
end
for _,desc in pairs(ClientStructure:GetDescendants()) do
if desc:IsA("Part") or desc:IsA("MeshPart") or desc:IsA("UnionOperation") then
desc.Transparency = TransparencyDelta
end
end
ClientStructure.PrimaryPart.BrickColor = BrickColor.new("Forest green")
RunService.RenderStepped:Connect(function()
local connectiton = ClientStructure.PrimaryPart.Touched:Connect(function(hit) end)
Mouse.TargetFilter = ClientStructure.PrimaryPart
if Mouse.Target == FindPlot(Player.Name) then
local AnyColisions = false
ClientStructure:SetPrimaryPartCFrame(CFrame.new(Mouse.Hit.X,ClientStructure.PrimaryPart.Size.Y + FindPlot(Player.Name).Size.Y,Mouse.Hit.Z))
end
end)
end
end)
Thanks for any help!
