Hi,
I got a stupid error which I can’t resolve. I am trying to deactivate the rigidbodies (the ragdoll hierarchy) of multiple enemies at start:
function ActivateRagdoll( logicValue : boolean ) {
var colliders : Collider[];
colliders = gameObject.GetComponentsInChildren(Collider);
for ( var object : Collider in colliders ) {
object.attachedRigidbody.detectCollisions = logicValue;
object.attachedRigidbody.isKinematic = !logicValue;
object.enabled = logicValue;
}
}// ActivateRagdoll() End
However I get the following error message: “InvalidCastException: Cannot cast from source type to destination type.” The line “colliders = gameObject.GetComponentsInChildren(Collider);” causes the errors.
Regarding this error I only stumbled upon others which had issues while instanciating.
Any clues?