In the beginning of my game, I have it set to fade to black and then load the next scene but, whenever I click, the game freezes for a small amount of time and then goes black completely without a proper transition. Now, I know the fade code is correct because it works perfectly fine running it inside unity.
Here is the code for the thing I was talking about:
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour {
public int level;
public GUISkin skin;
void Update()
{
if (Input.GetMouseButton(0)){
gameObject.GetComponent<Fadeout>().enabled = true;
Invoke("fade",0.5F);
}
}
void fade()
{
Application.LoadLevel(level);
}
}
I’ve tried making my own timer, coroutines and involking but, all to the same fate. If you need anymore information to help me solve this issue, please ask.