Answers for "how to do something for every children in a gameobject unity"

C#
8

unity get all children

foreach (Transform child in transform)
Posted by: Guest on March-22-2020
1

unity get components in children

using UnityEngine;

public class GetComponentsInChildrenExample : MonoBehaviour
{
    public Component[] hingeJoints;

    void Start()
    {
        hingeJoints = GetComponentsInChildren<HingeJoint>();

        foreach (HingeJoint joint in hingeJoints)
            joint.useSpring = false;
    }
}
Posted by: Guest on July-30-2021

Code answers related to "how to do something for every children in a gameobject unity"

C# Answers by Framework

Browse Popular Code Answers by Language