Is there any way of ignoring vertices or edges that are all ready inside the sphere prior to casting?
I only need to know what the sphere hits outside of the sphere from its initial position.
Any help will be greatfull, thanks!
Is there any way of ignoring vertices or edges that are all ready inside the sphere prior to casting?
I only need to know what the sphere hits outside of the sphere from its initial position.
Any help will be greatfull, thanks!
A brute force method would be to do a Physics.OverlapSphere to see which ones to ignore, then do a Physics.SphereCastAll which you'd pick the first item that isn't in the array obtained by Physics.OverlapSphere.
I don't know if the result from Physics.SphereCastAll is sorted by distance, in that case you need to sort it first.
This won't ignore vertices, it will ignore everything that is inside the overlap, even if it just touches it a bit.