GameObject.GetComponents Manual     Reference     Scripting  
Scripting > Runtime Classes > GameObject
GameObject.GetComponents

function GetComponents (type : Type) : Component[]

Description

Returns all components of Type type in the GameObject.

// Disable the spring on all HingeJoints
// in this game object
var hingeJoints = gameObject.GetComponents (HingeJoint);
for (var joint : HingeJoint in hingeJoints) {
joint.useSpring = false;
}