- Home /
Extents of a Compound GameObject (C#)
My third-person character picks up objects of various sizes.
These objects are composed of a GameObject with an attached Rigidbody, and a number of child objects with attached Colliders.
My goal is to calculate the furthest extents of a compound GameObject so that when the object is picked up, it may be held a set distance from my character.
My question, in summary: Is there a simple or a pre-existing C# solution to determining the extends of a compound GameObject?
Thank you in advance for all of your help!
Answer by S_Darkwell · Sep 19, 2014 at 03:12 AM
I had posted a previous "answer" to my question, but have since found a much-superior solution. This is precisely what I was looking for:
http://answers.unity3d.com/questions/17968/finding-the-bounds-of-a-grouped-model.html
Much credit to Eric5h5 for a fantastic solution!
Answer by NeverEndingPrjct · Aug 24, 2014 at 10:41 PM
use LINQ probably helps ... put the variables into an array and use .Max()
Your answer
Follow this Question
Related Questions
How to highlight only one face of a Cube from script? 0 Answers
Distribute terrain in zones 3 Answers
Game object with animations 0 Answers
Multiple Cars not working 1 Answer
Mesh.CombineMeshes does not work when mergeSubMeshes=false 2 Answers