title: Make something have a 1 percent chance of happening in Unity/C#
body: <p>I want a rare object in my game to spawn 1 out of 100 times. This is my code:</p>
  
  <pre><code>int random = Random.Range(0, 99);
  
  if (random &lt; 1)
  {
      //rare gameobject spawns
  }
  else
  {
      //common gameobject spawns
  }
  </code></pre>
  
  <p>This makes sense to me but it doesn´t seem to work correctly. I have seen this rare gameobject about 1 in 20-30 times. Why does it happen so often?</p>