adam
adam

Reputation: 63

Unity 2D - low fps in editor, 60+ fps in build

we are developing platformer game in Unity engine. Currently in our scene are 15 npc, movement is animation based, they are navigated via scripts, they can talk to player, fight etc. Rigid body does not handle collisions, it just detects ground as a trigger. When build is created, all is nice and smooth 60fps, in editor it is 25 to 30, sometimes a lot lower which makes us sometimes a lot of problems. Do you have any experience how to make a game run smooth in editor? Thank you

Upvotes: 2

Views: 10965

Answers (5)

Baris
Baris

Reputation: 21

For me it was caused by GSYNC being enabled on windowed mode. I want GSYNC enabled on windowed mode because I play some games on windowed mode. To solve this problem I followed these steps for Unity.exe, which turns of GSYNC for Unity specifically:

Open the NVIDIA Control Panel Go to the "Manage 3D Settings" Menu. Select the "Program Settings" tab. Select the game you want to turn off G-SYNC for, locate the "Monitor Technology" toggle, pick the "Fixed Refresh" option, and hit the "Apply" button.

Upvotes: 2

Vladimir Putin
Vladimir Putin

Reputation: 37

Try using Unity 2022.1.24f1, I get more fps in that build and also you can try using this free asset to get more fps.

https://assetstore.unity.com/packages/tools/utilities/frame-rate-booster-120660

Upvotes: 0

Jara G
Jara G

Reputation: 33

Another option may be to turn off Gsync(Vsync) on your monitor and graphics card control panel

Upvotes: 1

jjxtra
jjxtra

Reputation: 21160

Two top things are check that the profiler is not running and that the scene view is not open. These are the two most common causes (in my experience) of slow down in the editor.

You can also make sure there isn't any light baking going on, shouldn't be for 2D but worth checking.

Another thing to check is any editor only scripts, i.e. namespace UnityEditor.* usages (#if UNITY_EDITOR).

If you want an uncapped frame rate, go to project settings -> quality -> vsync mode, and turn off vsync.

Upvotes: 1

R4y
R4y

Reputation: 325

if your editor is very slow you can go to the unity icon right click on it and select properties and in the target add -force-opengl in the end.

you can also increment the fps by

 void Start()
{
    //increase of fps
    Application.targetFrameRate = 300;
}

for more info go to https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html

try to logout to unity becuase sometimes the login can make the editor running slow

Upvotes: 1

Related Questions