// Start is called before the first frame update void Start() { int i = 0; while (i < clothColliderCount) { i++; cC = new clothColliders(); clothCapsuleColliders.Add(cC.capsuleCollider); if (i >= clothColliderCount) { //Once we have all of the capsules in the scene //We'll convert them to an array clothColliders = clothCapsuleColliders.ToArray(); //Then instantiate our cloth object and pass along our colliders cloth = new clothObject(clothColliders); } } //Let's also change the gravity that impacts cloth in the scene //Physics.clothGravity = new Vector3(0f, .01f, 0f); Physics.gravity = new Vector3(0f, .1f, 0f); }
private void Start() { foreach (weapon child in GetComponentsInChildren <weapon>()) { weapons.Add(child); Components(child.transform, false); } clothCol = GameObject.Find("cloth").GetComponent <clothColliders>(); }