title: Open door when more than 20 coins
body: <p>Im trying to make it so a door in unity opens when you have collected 20 coins. and then it opens when you touch it. but for some reason. when i touch it with 0, 1, 2 etc coins it still opens. how do i prevent this? </p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using UnityEngine.UI;
  
  
  public class Player_Controller : MonoBehaviour {
  public float speed;
  public Text countText;
  private Rigidbody rb;
  private int count;
  public float volume;
  public Text eye;
  
  
  
  AudioSource audio;
  void Start()
  {
  
      audio = GetComponent&lt;AudioSource&gt;();
      rb = GetComponent&lt;Rigidbody&gt;();
      count = 0;
      SetCountText();
      eye.text = "";
  }
  
  
  void FixedUpdate()
  {
  
      float moveHorizonal = Input.GetAxis("Horizontal");
      float moveVertical = Input.GetAxis("Vertical");
  
      Vector3 movement = new Vector3(moveHorizonal, 0.0f, moveVertical);
  
      rb.AddForce(movement * speed);
  
  }
  void OnTriggerEnter(Collider other)
  {
      if (other.gameObject.CompareTag("pickup"))
      {
          audio.Play(); //Play it
  
          other.gameObject.SetActive(false);
          count = count + 1;
          SetCountText();
      }
      else if (other.gameObject.CompareTag("pickup2"))
      {
          audio.Play(); //Play it
  
          other.gameObject.SetActive(false);
          count = count + 10;
          SetCountText();
      }
      else if (other.gameObject.CompareTag("eye"))
      {
          audio.Play(); //Play it
  
          other.gameObject.SetActive(false);
          count = count + 9999999;
          SetCountText();
      }
      else if (other.gameObject.CompareTag("door") &amp;&amp; count &lt;= 20)
      {
          other.gameObject.SetActive(false);
          count = 0;
      }
  
  
  }
  
  void SetCountText()
  {
      countText.text = "Count: " + count.ToString();
      if (count &gt;= 9001)
      {
          eye.text = "You hit the bull's eye! ALL THE POINTS!";
      }
  }
  }
  </code></pre>
  
  <p>Update: I used the wrong character here. the &lt; is supposed to be >. but the problem now is that, since its a trigger, you roll right through. how can i make it solid, but still a trigger?</p>