Hello!
Here's the deal: I want to find center of group of some meshes (for example: tk2dSprite + tkd2TextMesh), what i do:
MeshRenderer[] mr = objWithMeshes.GetComponentsInChildren<MeshRenderer>(true);
Bounds bound = new Bounds(Vector3.zero, Vector3.zero);
foreach(MeshRenderer m in mr)
{
bound.Encapsulate(m.bounds);
}
return bound.center;
On the exit I have totally wrong coordinates (maybe it only works for usual 3d models or some, don't know). I've try to put this coord to local and world positions, but it's still totally wrong. And coords not changes if I add some symbols to textMesh. What I did wrong? How can I find center of group tk2dsprites/textMeshes?