- Home /
Unity crash, no one is call the function but it show up to the party anyways
A function in on of my monos is
public void Main() {
Application.LoadLevel("mainmenu");
}
Every time a hit the play button, my unity editor crashes, after some guessing i but the break point in this function, and its been called from no where, the callstack is empty.
This function is supposedly been called by a UI.Button (new ui), removing the event does not solve.
Only after i rename the function, the problem was solved.
Here is my questions: What happend? and Who is calling this function? and Why the unity crash by a simple Appliction.LoadLevel at start (guess is been called to soon)?
is "$$anonymous$$ain" perhaps some kind of builtin class? Try a different method name and see if this persists.
Rena$$anonymous$$g the function indeed solves the problem
Also, what version of unity are you using. I recently upgraded to 5.3.0 and was experiencing crashes on level loading. Only after I replaced Application.LoadLevel with Scene$$anonymous$$anager.LoadLevel did the crashes go away. Also, it was not happening always which was kinda weird too!
Im in the 5.2.2f1, they added a Scene$$anonymous$$anager! \o/
Your answer
Follow this Question
Related Questions
OnSelect and OnPointerEnter work in one script but not another on the same object 2 Answers
Changes in variables from function triggered by editor script during edit mode are not applied. 2 Answers
Jumping on moving platforms problem c# 1 Answer
The variable has not been assigned - but it has 1 Answer
Create GUI based on an array 2 Answers