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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Removed scripts slowing game down

Discussion in 'Editor & General Support' started by supadupa64, Apr 1, 2016.

  1. supadupa64

    supadupa64

    Joined:
    Feb 20, 2016
    Posts:
    175
    So I added Bloom to my character, played the scene, lagged pretty bad, removed bloom, still lagged bad (16fps), hit control Z a bunch of times until I got to where I didn't add bloom yet, played scene and got my 30-40 fps. Is there a way to check to see if removed scripts are running still or deleted trash kicking around slowing everything down?
     
  2. Kamilche_

    Kamilche_

    Joined:
    Jan 11, 2015
    Posts:
    75
  3. supadupa64

    supadupa64

    Joined:
    Feb 20, 2016
    Posts:
    175
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Or just look at the profiler to see what is causing the slowdown?
     
    hippocoder likes this.
  5. supadupa64

    supadupa64

    Joined:
    Feb 20, 2016
    Posts:
    175
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Profiler is for when you have 25,000 objects in your scene. You sort the columns by Time ms and deal with the ones consuming the biggest amount of time first, then work your way down best you can. You will see the ones that are the biggest offenders early on.

    If you can't learn to use Profiler, then there isn't much help coming.
     
  7. supadupa64

    supadupa64

    Joined:
    Feb 20, 2016
    Posts:
    175
    How would I see a deleted bloom script in the profiler?
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Deleted scripts don't cause slowdown, something related might, ie error spam.
     
  9. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Well, I heavily add - remove image effects and shaders, custom ones as well as those that come from Unity, for the last few months. Things seem quite broken.
    Sometimes you add something and you get no result.
    Other times you remove something and it still persists.
    When such problems occur, I save the scene, save project, exit, open again. Afterwards things work, mostly.

    Many problems reveal themselves only after building the project, aka you need to build really often. What you see on device is different from what you see on the editor and you have to try it on device to see if it works. The above applies for PC and android builds that I have tried, since IL2CPP the IOS and WebGL builds are too slow for working with them. Cloud build is not a solution for trying things out fast.

    It is quite difficult to replicate this behavior because it is not constant, or I cannot spot it. It could be something faulty with my configuration - hardware - skills whatever.

    The feeling I have is that the environment is not stable atm.
     
    supadupa64 likes this.
  10. supadupa64

    supadupa64

    Joined:
    Feb 20, 2016
    Posts:
    175
    I feel like something is wrong with the caching system in Unity. I have a sound that I have had attached to an object for months not moved and when I deactivate it or delete it it lags my game play considerably. I can't figure out how to shake it.

    Also, I have a script running and it occasionally lags, but then after a minute it's all fine. It's like it takes a minute to calibrate information? I now have about about 40,000 objects in my scene, but maybe that is irrelevant because only small amounts are active at any one time.