I want to make my custom pathfinding system understand it can walk through some parts of unions and wedges.
But I’m using GetPartsInBoundBox to check if a position/node is inside of a part and it doesn’t work well with unions.
I’ve looked for any way to check if a position is inside of a part and cant find anything other than GetPartsInBoundBox or something that makes another part of the system not work.
What can I do other than GetPartsInBoundBox (cant use GetTouchingParts).
In case anyone else is doing anything similar and have no answers then I just added this to my script
for i,a in pairs(workspace:GetPartBoundsInBox(CFrame.new(NewNode),Vector3.new(Sizaa-0.1,Sizaa-0.1,Sizaa-0.1),nil)) do
if a:IsA("UnionOperation") then
local Repan = RaycastParams.new()
Repan.FilterDescendantsInstances = Ignore
Repan.FilterType = Enum.RaycastFilterType.Exclude
local Reeya = workspace:Blockcast(CFrame.new(Start),Vector3.new(Sizaa-0.1,Sizaa-0.1,Sizaa-0.1),Origion - Start, Repan)--Blockcast just abit smaller than the node
if Reeya and (Reeya.Position - NewNode).Magnitude < (Start- NewNode).Magnitude and Reeya.Instance == a then --If the distance of the result is closer to the node than the new node being made then
table.insert(Nwo,NewNode) --list of solid parts that cant be walked through
end
end
end