Start Menu For A 2D Game

I Put A Picture that saids Play but I don’t know how to make it so that when I click on it will go to a level I made and its called Level_1

Start here

https://unity3d.com/learn/tutorials

Go to your Hierarchy panel and choose create->UI->Button.Then click on the button object and name it whatever you like(eg. level1),then find the ImageScript component on the button and drag the picture you want into the SourceImage box.After that, add a new script(named LoadLevel1) and paste in this :

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class LoadLevel1 : MonoBehaviour {

public void OnClick() {
   Application.loadlevel("Level_1");
  }
}

Finally, find on the button the OnClick() Component and click the “+” icon to add an new method.A box will apear and inside that drag and drop your Level1 button,then on the dropdown button next to the box you dropped your Level1 Button, choose LoadLevel1 and then “OnClick”. There you go! This should work :smile:

thank you :smile:

Finally, find on the button the OnClick() Component and click the “+” icon to add an new method.A box will apear and inside that drag and drop your Level1 button,then on the dropdown button next to the box you dropped your Level1 Button, choose LoadLevel1 and then “OnClick”. There you go! This should work :smile:[/QUOTE]

I don’t under stand the part where you say on the dropdown button next to the box you dropped your Level1 Button choose LoadLevel1 and then On Click…
there is no button next to the box I dropped Level1 Button plz help :cry: I have Unity 5

I’d suggest that you check the tutorials, you will not only learn how to do stuff but why it works that way

1 Like

k thank you