Jump to another scene detecting a rigidbody

44 views Asked by At

I am making a little game in c# on unity 5, and until now I have almost everything. How do I jump to another scene on detecting a rigidbody?

1

There are 1 answers

15
maraaaaaaaa On BEST ANSWER

in one of your game object's scripts, put:

public void OnCollisionEnter(Collision col)
{
    Application.LoadLevel(nextLevel);
}

so implementation would look as such:

using UnityEngine;
using System.Collections;
public class BotonIrAInstrucciones : MonoBehaviour
{

    // Use this for initialization
    void Start () { }
    // Update is called once per frame
    void Update () { }

    public void OnCollisionEnter(Collision col)
    {
        Application.LoadLevel("Next Level");
    }
}