I have a certain GUI management mechanism. When I press Play, it freezes, if it doesn’t, it does when I press a particular button.
I couldn’t find Player logs, I only have Editor one.
I couldn’t upload it because attachment is too big, but it’s also too big for pastebin. 188MB.
So what exactly can I give you in order to help?
I don’t know which file it is, but GUI is involved with dozens of other files so just giving you pieces would be pointless. Is there a smaller log hidden somewhere that would help that I can give?
What would be the first step to solve that?
Start disabling different bits, see which one causes the crash
Then I would get missing references errors, wouldn’t I?
I tried doing that 3 months ago with same error*, and it taught me couple of things:
- Just because I know which line causes error, it still doesn’t provide answers (nothing is null or missing).
- If error is caused by an action, any Debug.Log are not yet processed. If it crashes in an “instant”.
Yet another thing, my Visual Studio is screwing up, so I cannot attach it to Unity for breakpoints.
The mechanism is also too complex for me to just pull off parts of it, because it may remove the error, but the error may not caused by that particular command but by a tiny portion of it. Individual parts may be meaningless.
* - Previously I could trace the error in logs, but now logs are too massive.
Just asking for clarity: Does it freeze? Does it freeze and crash? Does it only crash?
You said it sometimes does not happen until a specific button is pressed. Check what’s linked to that button and try to work your way into it.
I mean, there shouldn’t be error if the button has no subscribers… Then, add in piece by piece, basically the other way around as suggested already. At some point, it’ll crash again and that’s your starting point to dig deeper and deeper.
Perhaps you’ll find the offending piece of code, and perhaps that’s the same that makes the application crash in all other scenarios.
1 Like
It irrecoverably freezes, everything on the computer works fine. I have to forcibly kill it with CMD.
It seems that I have found that single script that forces a slowdown. Ironically it’s an Enumerator called as Coroutine, here’s the code:
What’s up with it?
[ ][ ]
CanvasGroup item passed.
Bool is true.
It seems to freeze Unity, which it does, but it unlocks itself after this function is done running.
I had log in there once to measure how fast the alpha measurements are getting, but it didn’t spawn any Debug.Log until it finished processing. Isn’t the entire point of Coroutine to exactly not freeze the main thread? Am I missing something?
Note: For testing purposes it’s always active. So the SetActive is redundant.
That’s not how you use a coroutine to fade, you’re doing all the work and then resting a frame, making it go from 0 to 100 in a frame, defeating the whole purpose of the coroutine.
1 Like
Yep, what Sparrow said…
Instead, you need to move your yield instruction to the loop so that only one iteration happens per frame.
1 Like