Search Unity

Simulate mobile performance in editor with targetFrameRate?

Discussion in 'Editor & General Support' started by fati36, Jun 23, 2020.

  1. fati36

    fati36

    Joined:
    Jul 9, 2019
    Posts:
    2
    When i optimized my game for mobile(used profiler,deleting unnecesesary update funcs etc.), its improved from 300fps~to 1k fps in my editor and i thought that would be good start for optimizing.

    Well i built the game and played on mobile but for example; in editor when X object ontriggerenter its immediately stopping but on mobile its missing 2~4 frames for stopping.

    So i set application.targetFrameRate to 30 to editor its showed up 40~45fps in stats and X object is missing kinda same frames with mobile for stopping.

    Is this sensible way to setting editor 30fps for simulating and optimizing for that?

    I am kinda beginner so if this is already discussed or looking irrational feel free to give me advices or directions.
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,453
    Sounds like you might be stopping your object with a Lerp or in some other, frame rate dependent way. Because the OnTriggerEnter event should be fired in the first frame already.

    As the documentation for Application.targetFramRate says, all mobile devices are locked to a max refresh rate dependent on their screen. Setting vSync or targetFrameRate in the Editor for testing purposes will mean your timing/frame rate dependent code might behave closer to what it would be on a phone, but obviously the performance is quite different, so there could still be difference.

    Oh and, please don't take the FPS counter in that stats window too seriously. It calculates out the time it takes to process the editor per update.