Quick Question: Unions and GetPartBoundsInBox

Not sure if this is the right place for this…

I want to do a spatial query of parts with a model with GetPartBoundsInBox. The model doing the query has unions, and the models with parts it is querying around have unions as well.

Will there be any lack of detection due to GetPartBoundsInBox not considering unions for the querying model and or not detecting models which have unions?

Appreciate any answer.

It does consider unions, it just does not consider the physical shape of them. A good alternative for you would be game.Workspace:GetPartsInPart(); which is a common replacement to the now deprecated Region3.

Click here to learn more about :GetPartBoundsInBox()

1 Like

So just to confirm, I can use :GetPartsInPart() by iterating over all parts in my model, and calling :GetPartsInPart for each of these parts in the model, alongside excluding the whole model itself to see if the model is touching another model?

Btw thanks for the answer!

:GetPartsInPart() will return a table of any and all parts inside of the specified part.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.