Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Low FPS (20 fps) on mobile when using Unity's third person controller

Discussion in 'Editor & General Support' started by hgopi, Oct 28, 2023.

  1. hgopi

    hgopi

    Joined:
    Nov 12, 2019
    Posts:
    6
    I am using Unity's Starter asset third person controller. In one scene, I have only the ground and third person controller (without geometry), but the game is still running on 20 FPS in my mobile. My mobile has good RAM and memory. I could not find the issue why it is taking time in vsync and rendering.

    upload_2023-10-28_11-31-56.png

    The game scene contains only 11 draw calls and 2.1k triangles. And it looks good in Frame debugger also.

    upload_2023-10-28_11-35-3.png

    I tested with both "Don't Sync" and "Every V blank" options in VSync count. But still I could not get 30 FPS in my mobile.

    I understand performance optimization is a broad topic and the cause might be anything depends on the project. I checked Unity documentation and tried to debug using Profiler. But I could not find anything. Any help would be really appreciated.

    Additional notes:
    I created the game using 3D mobile template with Built-in Render Pipeline using Unity HUB with Editor Version 2023.1.18f1.
    Adaptive Performance not installed.
     

    Attached Files:

  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    What's the hardware?

    I ask because I noticed the ~1300x600 resolution in the editor - if this is also the mobile's resolution it would indicate a low-end device.
     
  3. hgopi

    hgopi

    Joined:
    Nov 12, 2019
    Posts:
    6
    I don't think my phone is a low-end device. I could run other games as well without heating or other problems. I am using:

    Processor: 2.3 GHz Snapdragon 720G Octa-core
    RAM: 8 GM (+4GB phone storage can be extended for RAM)
    Android Version: 13
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    I'm not too familiar with mobile phone hardware and their capabilities. But you can roughly estimate low to high end given the official price tag for the device. If it was below $400 you can expect it to be low-end in terms of game performance.

    But given the simple example it's still odd that it would run this slow. Try URP, this is recommended for mobile anyway due to it being far more efficient than the built-in RP.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,503
    The above advice is wrong.

    Are you setting Application targetFrameRate anywhere?
     
  6. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    I assume you mean the $400 threshold?
    After I posted that I thought that was maybe far off given how capable even low-end hardware is these days.
     
  7. hgopi

    hgopi

    Joined:
    Nov 12, 2019
    Posts:
    6
    Yes, I have set 30 FPS in the code. And, I will check that with URP.

    Actually, I am developing a game with URP for mobile, where I am getting this same performance issue there (20 FPS in one mobile with 2 GB RAM, but 30 FPS with the above specified device). I could not fix it there. Since this is my second game, I did not given thought of checking and monitoring the performance from initial stage. So to fix this issue, I planned to recreate the game from beginning and do one step at a time to check performance. And I stuck and got low FPS in the first step itself. I am wondering is there any specific advice to pinpoint the vsync and rendering issue.

    Steps I have tried in my actual game project:
    * Compressed the textures for android (size: 256, format: RGA Compressed ETC2 8 bits)
    * used AUTO LOD for the character
    * Disabled the additional cinemachine cameras
    * Disabled the shadows
     
  8. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    This first step is still pretty huge step. You may want to isolate it more, like just adding the character (no input/controller) to an empty scene. Then add input. Then add cinemachine. And try without the GUI.

    You may also want to check Package Manager and remove any package and specifically also built-in modules that you don't use.
     
    hgopi likes this.
  9. hgopi

    hgopi

    Joined:
    Nov 12, 2019
    Posts:
    6
    Ok, I will do that and update in this post. Thank you so much for the support.
     
  10. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,406
    Try setting it to 60, and also check out the documentation for that API and how that applies for mobile devices.
     
    hgopi likes this.
  11. hgopi

    hgopi

    Joined:
    Nov 12, 2019
    Posts:
    6
    Sure, I will check this. For now, I think I got the game running at >=25 FPS on the device the issue originated. This will help me in my further learning.