Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

get centerpoint of points transforms

public Vector3 FindCenterOfTransforms(List<Transform> transforms)
{
    var bound = new Bounds(transforms[0].position, Vector3.zero);
    for(int i = 1; i < transforms.Count; i++)
    {
        bound.Encapsulate(transforms[i].position);
    }
    return bound.center;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #centerpoint #points #transforms
ADD COMMENT
Topic
Name
6+8 =