Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Android strange game freeze. A mystery too me

Discussion in 'Editor & General Support' started by malmorama, Dec 11, 2021.

  1. malmorama

    malmorama

    Joined:
    Mar 14, 2021
    Posts:
    1
    Hello everyone, my game crashes when play on Android. Below is from running the profiler from Android device. The game is like Doodle Jump with a collider outside the screen that respawn platforms when platforms hit it. Looking at the profile it is ontriggerenter2d that is the problem but the findmaincamera makes no sense as it is not used at all in the script. Anyone has any thoughts to why there are many calls on findmaincamera? Or is it something with the OnTriggerEnter2d?

    About to drop the full project down the toilet....

    Thanks
    Håkan

    Screenshot 2021-12-11 at 09.36.54.png
     
  2. Skiriki

    Skiriki

    Joined:
    Aug 30, 2013
    Posts:
    69
    Something in your OnTriggerEnter call or something that is called from within that function is calling Camera.Main a whole bunch of times.
    If the number in the calls column gets higher over time, then you're somehow accumulating something that causes these calls.
    If you turn on Deep Profiling you should be able to see more clearly what exactly is calling that
     
    malmorama likes this.