title: How do I make an object move to a certain position after being hit by the player?
body: <p>I'm trying to make a maze and I want an invisible block to move to a certain position and to turn visible after the player collides with it, however even though I thought I had the right coordinates in my code the object keeps moving to (30,90,8.75) and those aren't the right coordinates I input. Please help. I am a beginner. Many thanks :)</p>
  <pre><code>MeshRenderer visibility;
  
  void Start()
  {
      visibility = GetComponent&lt;MeshRenderer&gt;();
      visibility.enabled = false;
  
  }
  void OnCollisionEnter(Collision other)
  {
      if (other.gameObject.tag == &quot;Player&quot; &amp;&amp; gameObject.tag == &quot;Invisible&quot;)
      {
          movePlayer();
          visibility.enabled = true;
      }
  }
  void movePlayer()
  {
      transform.position = new Vector3(19.5f, 45.478f, 11f);
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/OP4aT.png" rel="nofollow noreferrer">Image</a></p>