Game behaves differently between editor (Windows) and hardware (Android)

Hello, I have a script that should restart the level with the default variables:

SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);

When this code executes in the editor everything works as intended and the level rotation is set to 0 however when I try this on the hardware level rotation gets messed up and rotates to the angle script is called instead of the default angle of the level. For the first time in a while, I think this is not my fault and is about Unity instead, here are some possibly related code:

A largely cut down version of the GameManager: using UnityEngine.UI;using UnityEngine.SceneManagement;using UnityEngine; - Pastebin.com

Some of the LevelGenerator: using UnityEngine;public class LevelGenerator : MonoBehaviour { //visibl - Pastebin.com

Hello.

I dont know if the problem is related to script order of executions. But sometimes, In editor, scripts are executed in some order, and in build (more often if is build for another platform like MAC or Android) are executed in other order.

I mean, for example in editor it runs:

ScriptA.Start()
ScriptB.Start()
ScriptC.Start()

But in build it runs:

ScriptC.Start()
ScriptA.Start()
ScriptB.Start()

This can cause rpoblems with null references, wich causes scripts to stop, wich causes “strange” behaviuors in the game.

I recommend you to force the order of execution of you scripts to be sure this is not the problem. Here:

Bye!