Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Which script is running ?

Discussion in 'Scripting' started by Quast, Feb 28, 2020.

  1. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    521
    Hi.
    Is there any way to figure which script is running in my scene or how many one ?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,009
    Any scripts that are attached to active objects in your scene are running.
     
  3. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,278
    I think you either need to dive deeper and ask a highly technical and precise version of that question or back up and talk about what you're ultimately trying to accomplish.
     
    Olmi, Quast and Joe-Censored like this.
  4. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    521
    You right. Look, I got drop in frames, and I don't know what causing it. If my scene running with 3 players and 30 enemies smoothly with 60/40 frames. why suddenly I get drop for 1 second when there are no enemies !? So, I want to see which script taking or consuming more data.
     
  5. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,212
    @Quast have you tried Profiler? (ctrl+7)
     
  6. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    521
    Yes. I want something like "Task Manager" in windows.
     
  7. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,278
    In what way do you want it to be like "Task Manager" that the profiler isn't already like it?
     
    Yoreki likes this.
  8. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    521

    Look at unity software details I can get from TM.
    Like this one, I want to see which script is consuming more data when running my game scene.
    I have 3 scripts. animation,UI and saving data. I want to see which one is taking more memory or consuming data.
    I hope I cleared my idea now.
     
  9. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,009
    Yeah, Profiler gives you all that information plus a LOT more.
     
  10. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    521
    Could you show me a picture of this?
     
  11. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,212
    Window/Analysis/Profiler?
     
  12. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,278
    There's several different profiler modules for examining different things, but here's a picture looking at CPU usage broken down by where in your scripts it's happening:


    (taken from the Unity manual at https://docs.unity3d.com/Manual/ProfilerCPU.html )
     
    MartinTilo likes this.
unityunity