Hello world! I've been trying to figure this out but no luck as of yet :(
So basically, I want the level to load and fade-in as the character walks into the box collider. This is what I've managed to create so far and do not know how to do the fade transition. Any help would be greatly appreciated! Thank's in advance. (Oh and I am new to scripting)
using UnityEngine;
using System.Collections;
public class LevelTrigger : MonoBehaviour {
void OnTriggerEnter ( Collider cubeTrigger ){
Debug.Log ("OnTriggerEnter : cubeTrigger.tag = " + cubeTrigger.tag); // shows the tag of the trigger
// if tag is player
if (cubeTrigger.tag == "Player")
{
var firstlevel = GameObject.Find("Level1");
Destroy(firstlevel);
Application.LoadLevelAdditiveAsync ("Level2");
}
}
}
↧