Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity freeze

Discussion in 'Scripting' started by bremyBBW, Oct 20, 2017.

  1. bremyBBW

    bremyBBW

    Joined:
    Mar 23, 2016
    Posts:
    21
    Hello,

    I have a weird freeze in unity.
    • It's appeared when i change scene to my main scene networked or when i make spawn complex object.
    • The problem is that the freeze don't appear every time and i can't find any pattern.
    • When it's appear, i can't interact with unity anymore, the CPU for unity is on 0% so it's not a infinite loop.
    • It doesn't happen on build.
    • I'm using Unity 2017.2.0f3 and already had the bug on Unity 5.6.1p2.
    • I'm using SteamVR as plugin with Oculus Rift or HTC VIVE.
    • I'm using Network with UNet.
    I have no clue to find the origin of the bug.


    I'm open to every thing to find the problem...
     
    Last edited: Oct 20, 2017
  2. laxbrookes

    laxbrookes

    Joined:
    Jan 9, 2015
    Posts:
    235
    Does this only happen when working on a specific project? Does opening other projects cause this issue too?
     
  3. bremyBBW

    bremyBBW

    Joined:
    Mar 23, 2016
    Posts:
    21
    This is specific to a scene on a specific project.
     
  4. bremyBBW

    bremyBBW

    Joined:
    Mar 23, 2016
    Posts:
    21
    I seems to appear systematical on the second Launch. So I launch Unity, i click on "Play", every thing is correct, then i click again on "Play" to stop. Then i reclick on "Play" to launch the game and when i change of scene, Unity freeze.
     
  5. laxbrookes

    laxbrookes

    Joined:
    Jan 9, 2015
    Posts:
    235
    SO, the scene you are loading that causes the freeze, what scripts are contained within it? What is in the awake() and start() methods of the objects in the scene & dontdestroyonload scripts?
     
  6. bremyBBW

    bremyBBW

    Joined:
    Mar 23, 2016
    Posts:
    21
    It contain all the script to make the game work... so it's a lot. Same thing when i spawn object (there are many script attach to them.). The weirdness thing if that the CPU has a usage of 0%, i think it may come from Unity. I also have this line when i debug with Visual Studio :
    Unloading 1726 Unused Serialized files (Serialized files now loaded: 0)
     
  7. bremyBBW

    bremyBBW

    Joined:
    Mar 23, 2016
    Posts:
    21
    The problème seems to be a substance materiel witch was configure to be on "load with scene"
     
  8. threebedroomsinagoodneighborhood

    threebedroomsinagoodneighborhood

    Joined:
    Aug 1, 2019
    Posts:
    1
    Same problem, was resolved apparently when the two lines

    using System.Collections;
    using System.Collections.Generic;

    were put into a .cs file on a DoNotDestroyOnLoad Gameobject, which was lacking thereof. Hope this helps.;)
     
  9. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    That shouldn't do anything. If those lines were needed but weren't previously there, you would have just received a compile error.
     
    Antistone likes this.
  10. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    Only thing I can think of is maybe the file had uncompiled changes that Unity hadn't noticed for some reason, and editing the file caused it to be noticed.
     
    Joe-Censored likes this.