Search code examples
unity-game-engineurp

GPU is on more then 50%


I have a simulation I create on unity and I have an issue that when I build and run my project and open it on my UI menu(there is only some buttons), and for some reason my GPU is on more then 50%. I tried to delete evreything on my scene and create a new camera and build it and I get the same result. maybe it can be relevent but Im using URP. this is my profiler from the build mode:

enter image description here

and this is my task manager: enter image description here [enter image description here][3[![] ]

this issue happen on other computers on the GPU1

enter image description here someone have an idea what causing it?


Solution

  • I find my own solution- for some reason when I open the UI menu, Unity try to get the maximum FPS and this is why the GPU work hard. my solution is to block the maximum FPS to 30 on the UI menu using Application.targetFrameRate and then on my game the FPS to default like that:

    void Start()
    {
       Application.targetFrameRate = 30;
    }
    

    and to change it to the default do that:

     void OnDestroy()
     {
        Application.targetFrameRate = -1;
     }