We are developing a 2D game for Android on Unity. It's our first project, we don't have a lot of knowledge on Unity. We have 2 scenes, in first scene there is only a "Play" button. When that button clicked, other level loads.

void Update () {
    startButton.onClick.AddListener(() =>

Problem is; when we click on Play button, it takes at least 10 seconds to load other level. There isn't much objects on other level so it shouldn't take that much time to load. Sometimes it takes 20 seconds and sometimes game freezes and level won't load. How can we reduce that loading time?


1 Answer 1


You should read the documentation about AddListener(). It adds the specified argument as callback to the onClick event.

That means, once you call the function with your callback, it will be registered and called, whenever the event is fired. Since Update() is called once per frame, you keep adding the callback to the event, which will result in hundreds of calls to it, once the event is being triggered.

In order to fix this, you can simply move the call to AddListener() to the Start or Awake function, which is only called once per GameObject.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .