Touch sprite to load level

Hello guys, I need your help
I want to load new level by touching on a sprite. It’s 2D Android game. I tried few scripts but it doesn’t help.
Can you please help me? Thank you everyone.

Simple really once you get the hang of it - start out by using the new UI tools with unity, and in the unity menu hit “GameObject > UI > Button” to create a button, and use the sprite you would like as its source image. Create a new (in this case C#) script and create a method that does this:

    public void LoadSomeLevel()
    {
        Application.LoadLevel ("MyScene");
    }

Then in the inspector you select the button you created earlier, and link the script in there (under button component “OnClick” section) to allow the button press to call a method from that script you created. You point it to the method you just created, and when a player hits that button with a mouse or touch input, it will change the level (scene that is) to whatever you name the part that says “MyScene”.

Good luck!

1 Like

Sorry for late answer. Thank you :slight_smile: