I have a unity project, that when I run it in the editor with script A, it crashes on the first run of that unity session.
If I disable script A in the Inspector for the first run, the project runs fine. If I re-enable the script for the second run the project works fine (in the same unity session, i.e. without opening and closing the program).
I have commented out all of the body code in script A and it still crashes, I have moved it to the front and back of the execution order and it still crashes.
The script contains a void Start() and void Update().
Any ideas as to what is causing this?
edit:
The key is that it only crashes (no console output, just crash) if I have it enabled during the initial/first time I hit play in the unity editor (I just did another test and if it is disabled and I enabled it after the editor is in the play mode, it works fine).
edit (2):
Now it is crashing even if the script is disabled or removed from the scene.
edit (3):
I noticed the crash started happening after using a USB controller, though I can’t confirm if this is what caused the crash. I sent a report to Unity, so we’ll see. Will post if I figure out the cause.
edit(4): Unity got back to me, after deleting my Library folder, everything was working as expected.