Game/Engine Doesn't Respond after trying to Stop Player Input

Hey everyone!

I got a bug where if I wanted to stop all movement of the player when a fade in and out transition
is happening, the game (and engine itself) locks up. Built an APK of the game too, and it froze. Any solution that I can use, and how did that problem happen too? Thanks!

And for anyone asking, I’m running Unity 5.5.4f1 on Windows, building on Android.

Warp.cs: Warp.cs - Pastebin.com

ScreenFader.cs: ScreenFader.cs - Pastebin.com

PlayerMovement.cs: PlayerMovement.cs - Pastebin.com

Your while loops inside your ScreenFader class are missing their curly brackets. That means your code actually looks like this:

// [ ... ]
while (isFading)
{
    Debug.Log("PlayerMovement.canMove = false; fadeout");
}
PlayerMovement.canMove = false;

Debug.Log("Starting yield (FadeToClear)");
yield return null;
// [ ... ]

Since your while loop can never finish and you don’t yield inside the while loop your application is caught in an infinite loop.