title: Unity3d - Collision detection and position inaccuracy
body: <p>I'm a beginner on Unity3D and I decided to create a 3D Tetris to start learning. Everything was fine so far, but I have a problem with collision detection.</p>
  
  <p><a href="https://gyazo.com/49fbf5798dc67a546c5e187fde8f6096" rel="nofollow noreferrer">https://gyazo.com/49fbf5798dc67a546c5e187fde8f6096</a></p>
  
  <p>As you can see on this screen, the blue tetromino is not at the good place. This is due to the fact that the orange tetromino position in X is not precise (-2.9999). </p>
  
  <p>Each block that makes up a tetromino has the tag "Block". The ground has the tag "Ground".
  This is how I detect collisions in my OnCollisionEnter method.</p>
  
  <pre><code>    if (collision.collider.tag == "Block" &amp;&amp; !detectedBefore)
      {
          for (int k = 0; k &lt; collision.contacts.Length; k++)
          {
              if (Vector3.Angle(collision.contacts[k].normal, validDirection) &lt;= contactThreshold)
              {
                  GetComponent&lt;TetrominoMovement&gt;().Snap();
                  GetComponent&lt;TetrominoMovement&gt;().enabled = false;
                  FindObjectOfType&lt;Tetromino&gt;().GenTetromino();
                  detectedBefore = true;
                  break;
              }
          }
      }
  
      if (collision.collider.tag == "Ground" &amp;&amp; !detectedBefore)
      {
          GetComponent&lt;TetrominoMovement&gt;().Snap();
          GetComponent&lt;TetrominoMovement&gt;().enabled = false;
          FindObjectOfType&lt;Tetromino&gt;().GenTetromino();
          detectedBefore = true;
      }
  </code></pre>
  
  <p>Do you know how to get around this problem? Thank you in advance.</p>