CapsuleCollider2D offset

Instead of lerping the offset, I merely halved collider.size.x. Seems to come out with the same result.

Probably just different ways of doing the same thing, but are there any appreciable performance differences between a lerp calculation against a property lookup and floating point division?

Actually, I did the same thing. I would say that’s more efficient than Lerp in this case, and we’ve already done the hard work of actually Lerping when we set the capsule’s size.

1 Like

If you use the collider extents (collider.bounds.extents.x) the math has already been done for you, too.

1 Like

Oh, hadn’t even throught of that one

Privacy & Terms