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");
}
}
}
or do you talk about something else? If you want to fade “the whole scene” the easiest way would be to render both to a texture and fade the fullscreen textures. If you don’t have Unity pro this is “almost” impossible. You could try to replace all shaders on all renderers and fade the materials alpha values. That’s probably quite slow and might not give the right result.
A bit more detail on what you actually mean by “fading” and if you have Unity pro available or not would be nice-
Hey! I made easiest method of AutoFade in unity by Unity Game engine, UI elemets etc… You can free download it here… Fully explained and showed. Enjoy and thanks, if any opinions, just write.
[54339-autofadealternative.zip|54339]