title: How to apply the collider of a prefab to an entity?
body: <p>I am using C# in unity and am attempting to apply the sprites and collider of different prefab's to my player entity throughout the game. </p>
  
  <p>The sprite will successfully change, however using a similar script with the collider returns the error "<code>The left hand side of an assignment must be a variable, property or indexer</code>" (line 4 here) evoSprite is a Sprite and evoCollider is currently a Collider2D, but I don't think that's right.</p>
  
  <p>Need a way to fix this or an alternative way to do what I want.</p>
  
  <p>Below is the code:</p>
  
  <pre><code>    evoSprite = (GameObject.FindGameObjectsWithTag("Evo0")[0]).GetComponent&lt;SpriteRenderer&gt;().sprite;
      (GameObject.FindGameObjectsWithTag("Player")[0]).GetComponent&lt;SpriteRenderer&gt;().sprite = evoSprite;
      evoCollider = (GameObject.FindGameObjectsWithTag("Evo0")[0]).GetComponent&lt;PolygonCollider2D&gt;();
      (GameObject.FindGameObjectsWithTag("Player")[0]).GetComponent&lt;PolygonCollider2D&gt;() = evoCollider;
  </code></pre>