Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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:
    66
    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.