Search Unity

NEED RESPAWN HELP QUICK!

Discussion in 'Scripting' started by MoonlightMage, May 29, 2015.

  1. MoonlightMage

    MoonlightMage

    Joined:
    May 8, 2015
    Posts:
    1
    Hey people I'm trying to make 2 games, 1 in 3D and other in 2D and I want the characters to be able to respawn at a certain point when I press the R key.
    Is there any way to do this?

    Also this is due in by midnight so please help quick!
     
    Last edited: May 29, 2015
  2. chubbspet

    chubbspet

    Joined:
    Feb 18, 2010
    Posts:
    1,220
    2D and 3D works the same. You are not giving good info, but here is the idea:


    Code (CSharp):
    1. if (Input.GetKeyUp("R"))
    2.         {
    3.             GameObject g = (GameObject)Instantiate(Resources.Load("Prefabs"), new Vector3(0, 0, 0), Quaternion.identity);
    4.         }