Answers for "Find Center Of Transforms, Points, Multiple Objects"

C#
0

Find Center Of Transforms, Points, Multiple Objects

public Vector3 FindCenterOfTransforms(List<Transform> transforms)
{
    var bound = new Bounds(transforms[0].position, Vector3.zero);
    for(int i = 1; i < transforms.length; i++)
    {
        bound.Encapsulate(transforms[i].position);
    }
    return bound.center;
}
Posted by: Guest on December-05-2021

Code answers related to "Find Center Of Transforms, Points, Multiple Objects"

C# Answers by Framework

Browse Popular Code Answers by Language