Hi there,
First off, sorry if this does not belong here (I wasn’t sure about posting it in this forum or in Scripting). I have an empty scene that contains 2 videos, the Epilogue of the game (skippable) and the Credits (skipping leads to MainMenu). I had those cutscenes added to the scene, but the build always crashed when loading it, so I now tried loading them from Resources, but it is also crashing. Both cutscenes (very long, and at a 1080p resolution) are a 400MB total in weight, but the computer is not, by any chance, running out ot RAM, so maybe it is a bandwidth issue?
I load all the scenes through an empty scene with a progress animated icon, it unloads the previous scene and assets and then loads asynchronously the next one. Here’s my code for the cutscenes in case it helps:
void Start()
{
StartCoroutine(LoadCutscene());
}
IEnumerator LoadCutscene()
{
ResourceRequest resourceRequest = Resources.LoadAsync<MovieTexture> ("Cutscenes/Epilogue");
while (!resourceRequest.isDone) {
yield return null;
}
if(resourceRequest.isDone)
{
movie = (MovieTexture) resourceRequest.asset;
StartPlay();
}
}
void StartPlay()
{
cinematic_canvas.material.SetTexture("_MainTex",movie);
cinematic_canvas.material.SetColor("_Color",Color.white);
_mt = (MovieTexture)cinematic_canvas.material.GetTexture("_MainTex");
if(_mt != null)
_mt.Play();
_cutscenePlaying = true;
StartCoroutine(LoadCredits());
}
IEnumerator LoadCredits()
{
ResourceRequest resourceRequest = Resources.LoadAsync<MovieTexture> ("Cutscenes/EndCredits");
while (!resourceRequest.isDone) {
yield return null;
}
if(resourceRequest.isDone)
cMovie = (MovieTexture) resourceRequest.asset;
}
Do you know what might I be doing wrong? Thanks for your time.