Timeline for How to create a box collider that surrounds an object and its children?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 10, 2021 at 16:00 | comment | added | jhocking | I've been using this for a while and just had to modify it to fix a bug, here's the code now (along with links in the comments explaining the problem) gist.github.com/jhocking/e64a5abdcae9b294f02cec56e26fb14b | |
| Jun 3, 2020 at 13:41 | comment | added | jhocking |
This approach does assume the root object has a Renderer, which may not be true. It's pretty common to have an empty root to contain the meshes, so everything from thisRenderer outside the loop should be inside code like if (transform.TryGetComponent<Renderer>(out var thisRenderer)){ }
|
|
| Jun 27, 2019 at 19:40 | comment | added | JalalJaberi | @user1566515 Instead of offset you can use BoxCollider.center I suppose | |
| Aug 31, 2018 at 2:30 | comment | added | user1566515 | It seems that now there's no BoxCollider.offset in Unity. | |
| S Jan 8, 2018 at 14:32 | history | suggested | Ivan Castellanos | CC BY-SA 3.0 |
BoxCollider2D.center has been deprecated. Use BoxCollider2D.offset instead
|
| Jan 8, 2018 at 8:07 | review | Suggested edits | |||
| S Jan 8, 2018 at 14:32 | |||||
| Aug 30, 2016 at 15:11 | history | edited | OC_RaizW | CC BY-SA 3.0 |
added 403 characters in body
|
| Aug 30, 2016 at 13:42 | history | answered | OC_RaizW | CC BY-SA 3.0 |