Search Unity

Overhead at 90% for seemingly no reason!

Discussion in 'Editor & General Support' started by Treasureman, Oct 24, 2016.

  1. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    My scene was running fairly smoothly at about 20 FPS at its highest settings (which for my computer is pretty good), but then I did one thing that sent my Overhead up to around 85% - 90%. This is all because I added this. There's a camera with an animation of you getting out of a chair, the player GameObject is disabled. When the cameras animation is done, the camera is disabled, and the player is enabled. Simple. So, Why is it that when that animation camera is enabled, the Overhead is at about 90% and runs at 4 FPS at it's LOWEST quality settings! The scene goes back to normal when the player is enabled. Why is it doing this?
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    So you have two cameras running?
     
  3. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    Seems like you have the Animation camera + Player camera running at the same time. When playing the animation camera, disable the player camera. Using multiple cameras is VERY expensive and should almost never be done.
     
  4. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    No, the play is disable while the animation is running
     
  5. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    The play, or the play camera? Is the play camera disabled?
     
  6. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    yeah. The animation camera starts enabled, and the player is disabled. I was doing some stuff in the profiler and discovered that it's not having the animation camera enabled that's slowing the game, but have the player disabled.
     
  7. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    How can disabling something give you less FPS? Maybe you have some scripts that need the player to be enabled? Why do you need to disable the player in the first place?
     
  8. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    It's so you can't move around during the cutscenes. I was able to increase the framerate though by disabling a few things the player can't see at that point.
     
  9. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    Can't you just disable your control script, or put a rigidbody on your player and enable all of its constraints?

    You said you gained FPS by disabling things the player can't see. Have you looked into Occlusion Culling? That sounds like what you need.