Answers for "how to limit the amount of children that are in a parent in unity"

C#
0

how to limit the amount of children that are in a parent in unity

int childMax = 1;
 
    void Update()
    {
        childMax = transform.childCount;
       
        for (int chCnt = 1; chCnt > childMax; chCnt--)
        {
            transform.DetachChildren();
        }
 
        Debug.Log (childMax);
    }
Posted by: Guest on September-18-2021

Code answers related to "how to limit the amount of children that are in a parent in unity"

C# Answers by Framework

Browse Popular Code Answers by Language