[2.6.1] How to check if there is an object within a neighboorhood from some point

Hello,

say I have 50 prescribed locations Vector3[50] Pos. I want to check, preferably fast as possible (1-2 frames) , whether there is an object with collider in some neighboorhood epsilone from any of these points.

How can I easily do it? Just need general algorimth like tip

THanks

You may be able to use: Unity - Scripting API: Physics.SphereCast

or if you need all objects in the neighbourhood: Unity - Scripting API: Physics.SphereCastAll

FizixMan: Doesn’t SphereCast just fire a Capsuloid in a straight line, á la RayCast, but ‘thicker’?
Nikolay: I think this might be of help to you: Unity - Scripting API: Physics.OverlapSphere
That function will return a Collider[ ] with all GOs that contain a Collider Component. =) Not sure too sure on the speed though. Good luck!

ok thanks, I will try both solutions, we will see

Doh, you’re right. I suppose if all your objects are in the same plane (so distance against height isn’t an issue) then you could fire the cylinder vertical with a radius of the distance you’d want.

Regardless, I think OverlapSphere was what I was initially thinking about but I didn’t really read the documentation at the time I posted that. Thanks Senshi .