- Home /
how to obtain collider extents?
I have some box colliders and I need to know the min and max Vector3 positions that define each cube in world coordinates. Is there a ready made function or must I make my own by calculating the extents from the transform.position and the collider.size?
thanks
Answer by Wolfram · Jan 24, 2011 at 12:18 PM
According to the docs, Collider.bounds already is in world space, so you can access min and max with Collider.bounds.min and Collider.bounds.max.
Actually, that's $$anonymous$$esh.bounds. Renderer.bounds is also in world space.
Your answer
Follow this Question
Related Questions
Internal collisions 1 Answer
Vault Over Collider Based Mesh 3 Answers
Capsule Collider on Cylinder Doesn't Work 2 Answers
Referencing a specific collider in a game object 1 Answer
Problem with melee collision 3 Answers