- Home /
Answer by BlastOffProductions · May 09, 2016 at 04:39 AM
I know this doesn't answer your problems completely, but it might help a bit.
using UnityEngine; using System.Collections;
public class NextLevel : MonoBehaviour {
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
Application.LoadLevel(1);
}
}
Use this script with an Event Trigger, and it should take you to another scene. Just make sure you go to build settings to apply the scene you want.
Your answer is correct but partially, as this code will only work if one (or both) of those objects have rigidbody component on them