Answers for "unity get components in children"

C#
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

C# Answers by Framework

Browse Popular Code Answers by Language