title: Unity3D: Adding Sphere Collider to Cloth Component at Runtime Isn't Doing Anything
body: <p>I'm trying to have it so that the player walks through a cloth curtain. </p>
  
  <p>There's a sphere collider attached to my first person camera, and a cloth script attached to a prim plane. I'm trying to attach the FPS cam collider to the cloth object at runtime. </p>
  
  <p>I wrote a script that seems like it should work, but it doesn't. No errors or nothing. The script compiles and works, but the sphere collider just doesn't connect to the cloth component. what gives?</p>
  
  <pre><code>    public class ClothTest : MonoBehaviour {
  
            private void Start() {
  
      Cloth a = GetComponent&lt;Cloth&gt;();
  
      var ClothColliders = new ClothSphereColliderPair[1];
      ClothColliders[0] = new ClothSphereColliderPair(GameObject.Find("First Person Camera").GetComponent&lt;SphereCollider&gt;());
  
      ClothColliders[0] = a.sphereColliders[0];
  
  }
  </code></pre>
  
  <p>Here is a screenshot of the cloth component in the inspector:</p>
  
  <p><a href="https://i.stack.imgur.com/6Ffc3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Ffc3.png" alt="Here is a screenshot of the cloth component in the inspector"></a></p>