Detect Union Part

I want to make parts of a certain folder to cancollide off including those union parts. My question is how can I detect if a part is a union part. Here is my code that works with normal parts but not with union parts(3-5 parts union together).

          for _, v in pairs(game.Workspace.Folder:GetDescendants()) do
             if v:IsA(“Part”) then
               v.CanCollide = false
             end
          end

v:IsA(“BasePart”) → All physical objects
v:IsA(“Part”) → All basic parts
v:IsA(“UnionOperation”) → All Unions

For your use case, you want v:IsA("BasePart").

7 Likes

v:IsA(“BasePart”) will detect if v is any of the following:

MeshPart, Terrain, UnionOperation, NegateOperation (negative parts), VehicleSeat, TrussPart, CornerWedges, Wedge, Part, SkateboardPlatform, FlagStand, Seat, SpawnLocation, Platform

1 Like