Detecting Certain Parts in a Sphere

I am talking about parts with cancollided on false.

Haha, no. The script activity might increase beyond 3% which is a bad practise.

My point is, it’s just a wastage of resources.

Woah, that’s going to be laggy.
You should first reduce the number of parts you need to search over with an efficient method such as Region3, then do the magnitude checks.
You can do this by using a Region3 which encases the sphere. It’s dimensions will be 2r x 2r x 2r where r is the radius of the sphere where the region3 has the same centre position as the sphere’s centre.
Finally, after you get all parts in that region, magnitude test which parts lie within a distance r from the centre of the sphere.

1 Like