title: Restart Button Unity 3d C#
body: <p>I am making a game. In my game, a ball is going around and if it hits a trap, it will die, and you will have to restart. My problem is: I can't figure out a way to make a button appear on the current scene when you hit the trap. Im scripting in C#.</p>
  
  <pre><code>using UnityEngine;
  
  public class PlayerCollision : MonoBehaviour{
  public Rigidbody rb;
  
  void OnCollisionEnter(Collision collisionInfo)
  {
      if (collisionInfo.collider.name == "Trap_Spike")
      {
  
          FindObjectOfType&lt;Gamemanager&gt;().RestartGame();
  
  
  
  
      }
  }
  
  }
  </code></pre>
  
  <p>The trap has the tag Trap_Spike on it.</p>
  
  <p>My RestartGame script looks like this:</p>
  
  <pre><code>using UnityEngine;
  
  public class Gamemanager : MonoBehaviour{
  
  public void RestartGame()
  {
  
  
  }
  
  }
  </code></pre>
  
  <p>So I'll be open for any help I can get</p>