Hi there!
I have a problem and can’t find any solution on internet.
I have a workaround but dont really want to use it.
I’m making pathfinding script and i’m taking map for grid marking as empty tile or not empty.
Found this great method from Physics called CheckSphere returning bool when it detects any colliders from given layers. Y, it’s really cool. But the thing is, it does not work for 2D colliders.
And I can’t find any method that gives bool in Physics2D only returning colliders. Now I do not want collection of colliders, I just wanna know if there is any of those that Im interested in. Just flag, yes or no.
I can write by myself something like that:
Collider2D[] colliders = Physics2D.OverlapAreaAll(bottomLeftPoint, bottomRightPoint, obstacleMasks);//If i understand those two vectors right
if(colliders.lenght > 0)
return true;
return false;
But as I know life, libraries made by others are usually better optimized.
So I can use this code (make it compilable) or add 3d colliders to 2d sprites (worst scenario).