Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Dec 07, 2012 at 03:33 PM by code-blep for the following reason:

Found link to a similar problem.

avatar image
0
Question by code-blep · Dec 07, 2012 at 02:02 PM · childrenbounds

Encapsulate Bounds Problem [SOLVED]

Hi,

I am trying to get the total dimensions for an object and all it's children. I am very close but can't quite seem to get over the last hurdle.

I am able to iterate through the children and see all objects in the array.

I am also able to see the individual children Bounds sizes.

But I cannot get it to give me the total dimensions of them all. From what I can tell I need to encapsulate them, but my total encapsulation only gives me the bounds size for the parent object.

[Edit] Problem solved as I eventually found this post (Eric5h5 to the rescue . . . again!):

http://answers.unity3d.com/questions/17968/finding-the-bounds-of-a-grouped-model.html

Thanks

Paul

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
1

Answer by zyzyx · Dec 07, 2012 at 03:00 PM

Since Encapsulate only encapsulates a point (Vector3) in space r.bounds seems not to be a valid argument.

Wrong, it encapsulates with a point, or bounds - check the doco page

.

You could try (not testet):

 for(r in renderers){
    totalBounds.Encapsulate(r.min);
    totalBounds.Encapsulate(r.max);
 }


Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image code-blep · Dec 07, 2012 at 03:31 PM 0
Share

Thanks zyzyx , that never worked for me but I found exactly what I was looking for here:

http://answers.unity3d.com/questions/17968/finding-the-bounds-of-a-grouped-model.html

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How does Bounds.Encapsulate() work? 2 Answers

Calculating BoxCollider bounds and center in runtime 1 Answer

Dynamically creating a box collider for an object with multiple, rotated, and scaled mesh renderers 0 Answers

Are my bounds right world position in this case ? 1 Answer

True scale of a visible GameObject with many childs 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges