- Home /
Question by
TruffelsAndOranges · Jul 14, 2015 at 10:09 PM ·
performancephysics2dperformance optimizationoverlap
OverlapCircle or OverlapArea best performance?
Which is most performant: Physics2D.OverlapCircle or Physics2D.OverlapArea?
Trying to decide which one to use. :-)
Comment
Best Answer
Answer by zach-r-d · Jul 14, 2015 at 10:44 PM
From an algorithmic standpoint, checking for circle overlap generally requires a couple fewer mathematical operations than an AABB ("area") overlap check, so it may have a very slight edge in performance.
Ultimately though, the performance of the two is comparable to the point that it almost certainly doesn't matter, meaning you should use whichever is easier or better suited to the use case.
Thanks zach.r.d! Then I'll stay with the circle overlap. From a gamepoint of view, circle or AABB didn't really matter. :)