title: Unity how to get position from objects that has collided with another object?
body: <p>Currently im trying to get a T square to lock its position with lines that i have created but im not sure how to get the x position of a line. And right now my T square is able to detect thats it colliding with the lines. Heres my current code.</p>
  
  <pre><code>void LockPostion(float x)
  {
      gObjTmp.transform.position = new Vector3 (x, this.transform.position.y, this.transform.position.z);
  }
  
  void OnCollisionEnter(Collision col)
  {
      if (col.gameObject.tag == "Lines") 
      {
          Debug.Log ("Collision with line");
          LockPostion (minlockXPos);
      } 
  
  }
  </code></pre>