- Home /
Using Physics2D.BoxCast to find closest point NOT colliding?
I'm trying to use Physics2D.BoxCast for movement collision detection where I simply pass a player's BoxCollider2D's center/size to it. The RaycastHit2D returned gives a centroid variable of the closest point where the collider intersects, but I want the closest point that DOESN'T intersect. If I simply set the player's position to the centroid, they're now inside the collider rather than outside. It seems to be a very small but not constant amount that the boxcast needs to be away from a collider for it not to be detected as a collision.
Any ideas?
Your answer
Follow this Question
Related Questions
Drag rigid body based on touch in 2D 0 Answers
how polygon collider 2d calculates center of mass? 2 Answers
Game not working on Tizen 0 Answers
LayerMask help 2 Answers
Help reading Profiler 1 Answer