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

Question Playmode running at really low Fps

Discussion in 'Editor & General Support' started by D_4rk, Mar 12, 2023.

  1. D_4rk

    D_4rk

    Joined:
    Feb 26, 2022
    Posts:
    35
    I just realized that in the editor during the playmode my game is running at ~30 fps even with empty scene, and if i try to target fps at 200 for example it stay at 30 fps. Even then before in other projects my games was able to reach even 200 fps. What is going wrong in this project? Maybe some default settings?
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,507
    This is nothing to do with Physics.

    I'll move your post to the Editor forum for you.
     
    D_4rk likes this.
  3. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,849
    You can use the Profiler to see what is taking up what amount of time per frame. It should be your first port of call for any performance questions.
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,425
    Inspectors in the Unity Editor always refresh at a low update rate. Documentation mentions 10 times per second, so having 30 fps is already an improvement.

    You may have a custom inspector refreshing at faster rates by calling EditorUtility.SetDirty from the custom inspector code:
    Code (CSharp):
    1. public class MyCustomInspector : Editor
    2. {
    3.     public override void OnInspectorGUI ()
    4.     {
    5.         EditorUtility.SetDirty(target);
    6.     }
    7. }
     
  5. D_4rk

    D_4rk

    Joined:
    Feb 26, 2022
    Posts:
    35
    I did. As i said the scene is empty so and
    Well actually i did. As i said even in an empty scene the playmode is running at 30 fps and looking the profiler the player loop is constantly running at 30 fps even without scripts. I tried to exclude Unity process from antivirus and didn't work. So i thought that the problem could come from Nvidia whispermode (that was activated) so i turned it off but that didn't solve the problem either.
     
  6. D_4rk

    D_4rk

    Joined:
    Feb 26, 2022
    Posts:
    35
    I knew that the inspector run slower than the build but i used to have more fps in playmode. Sometimes even around 200 fps depending on the scene intensity. Btw how should i use SetDirty func to increase fps?
     
  7. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,425
    Oh, I see we're likely talking about different things. It seems I misunderstood the question.

    If your game is capped at 30 fps while playing it in the Editor, this may have several causes:
    • Project Settings > Quality. Select a different quality here to apply in the Editor. Check out the VSync setting in the selected quality, as this is the typical setting for limiting the fps.
    • Build Settings > Target. I'm no expert here, but I've read that some target platforms may have a strict FPS limit. Try setting a Desktop target to ensure this part is not a limit.
     
  8. D_4rk

    D_4rk

    Joined:
    Feb 26, 2022
    Posts:
    35
    I already tried all of these options a none of them seems to be working :( !! Its looks to be capped at 30 fps for some reason. I read on the internet that some people had this problem working with the laptop going with the battery energy and so Unity saves energy making the editor cap at 30 fps but actually my laptop is plugged on energy. On the contrary i don't even have battery on my laptop because i removed it (could the abscence of battery be the cause of the problem?).
     
  9. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,425
    I'd try your project in another computer to ensure the issue is not related to the Unity project itself. It might well be something related with your laptop's power management.

    For example, I've also had a similar problem with a laptop, but in this case I couldn't get more than 10-15 fps when running on the battery no matter the power options I configure. It seems that either the display adapter forcefully enters an aggressive power saving state, or the GPU is just disabled and graphics work on the chipset's graphics adapter.
     
  10. D_4rk

    D_4rk

    Joined:
    Feb 26, 2022
    Posts:
    35
    Exactly it must be something like that, but it is frustrating to not understand what is going on exactly. Thanks for the tip, i will try from another pc when i will have the chance to do that!
     
    Edy likes this.
  11. theshizon

    theshizon

    Joined:
    May 4, 2015
    Posts:
    8
    Hey! Wanted to bump this, I found a solution in my case. I was capped a 30FPS in game view, I was at 15 FPS if I had the game view and the scene view open in the editor, viewing both at the same time and playing the game. This was with just a 2D capsule moving around. Really annoying! This was with DirectX11 and 12, Unity 2021.3.29f LTS. I have a wicked computer. Ryzen 64 GB RAM, 3080card. I went to my Nvidia control panel and found I had a max framerate set to 30 for some reason?? I turned it to off, now I am running at over 400 FPS with DX11 or 12. Hope this helps!
     
    Edy likes this.