Search Unity

Resolved Waiting for Unity's code in Unity.VisualScripting.Core.Editor.dll to finish executing

Discussion in 'Visual Scripting' started by Deleted User, Jan 19, 2022.

  1. Deleted User

    Deleted User

    Guest

    Been getting this message a lot lately. It gets stuck here until I force terminate the editor application and reopen the project.

    It seems to trigger when I make code changes, return to the editor, and start playback (maybe a bit prematurely?).
    Anyone know a workaround? I'm guessing it has to do with the background workers maybe?

    upload_2022-1-19_13-59-8.png

    OS: Windows 10
    Unity Editor Version: 2021.2.0f1
    Visual Scripting Version: 1.7.5

    Thanks
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,072
    In Preferences try setting this to Recompile After Finished Playing.



    Also, update UnityVS to 1.7.6. It's a minor hotfix release so it shouldn't impact preexisting content negatively. Your Unity version also seems to be a release candidate? Might be worth updating that too. The .0 releases always have issues.
     
    Deleted User likes this.
  3. Deleted User

    Deleted User

    Guest

    Sadly it is still happening.

    I tried all variations of the recompile settings.
    Upgraded Unity to 2021.2.8f1 and Visual Scirpting to 1.7.6.

    Still can't tell when exactly it is happening but it seems to happen from around 5-10 code recompiles. Also seems unrelated to whether a State Graph or Script Graph is open. So something between code changes and just playing the game in the editor is triggering the loading window to get stuck.
     
  4. Deleted User

    Deleted User

    Guest

    I'm starting to get fairly certain this is the culprit. Only if I try enter play mode before this Ludiq Background Worker finishes loading, it gets stuck.

    upload_2022-1-26_17-30-19.png
    Workaround: wait for it to finish before attempting to enter play mode.
     
  5. jeanedouard_unity

    jeanedouard_unity

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    49
    Hi, we are aware of some performance issues during domain reload. They are identified and logged in our bug base. We have planned time to tackle those problems but I'm talking about codes that take 200ms instead of 15ms for example, not 15s like I see in your screenshot. In the meantime, like @PanthenEye is suggesting try to migrate to the latest 2021.2 version (which should be 2021.2.8f1 by now).
     
  6. Deleted User

    Deleted User

    Guest

    Thank you @jeanedouard_unity Appreciate the effort.

    However just for clarity so the team has all the information they need. I stated in this message, I am on the latest 2021.2 Unity version as well as the latest Visual Scripting version. Also you'll see in the screenshot of my opening message that I waited nearly 9 minutes, meaning it cannot only be a performance issue but probably a logic issue. I get stuck completely there until a kill the process and restart Unity.
     
  7. jeanedouard_unity

    jeanedouard_unity

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    49
    Thank you for the information but unfortunately this is still not enough for us to reproduce the bug. That sounds specific to your project. The best you can do is to report the bug using the Unity Bug Reporter and attach your project.
     
    Last edited: Mar 9, 2022
  8. loaikk9

    loaikk9

    Joined:
    Jan 13, 2021
    Posts:
    3
    Stuck on this Please help it pops up as soon as i open the editor restarting didn't work I'm using unity 2021
     

    Attached Files:

  9. marcuslelus

    marcuslelus

    Joined:
    Jun 18, 2018
    Posts:
    67
    I had a similar behaviour a while ago (tho I usually don't wait that long). This issue turned out to be AOTStubs.cs. Basically it's a file that is generated when you build in IL2CPP and can easily have more than 60 000 lines of code (which can take some time to compile). The file usually gets deleted after you build, but if your build fails, it doesn't get removed. Anyway, might be that, might not! :)

    It can also do that if you have some massive scriptable object / asset in your project
     
  10. unity_21100135

    unity_21100135

    Joined:
    May 30, 2022
    Posts:
    1




    Try deleting your Library not your assets just library your program will open slower the first time idk if it will help
     
    HayalOrtak likes this.
  11. Perrorist

    Perrorist

    Joined:
    Sep 13, 2020
    Posts:
    25
    I get this behaviour regardless of it being a new or existing project. I click on a script file and its code appears in Inspector only to be followed by the message: Waiting for Unity's code in UnityEditor.CoreModule.dll to finish executing. I have to kill the editor process to close the project.
    I've tried various remedies that people have suggested and none of them works.
    I can access the script file from File Explorer without difficulty, so the issue is definitely caused by Unity.
     
  12. Perrorist

    Perrorist

    Joined:
    Sep 13, 2020
    Posts:
    25
    I got around the problem by changing from Visual Studio 2019 to Visual Studio Code in Preferences.
     
  13. real2B

    real2B

    Joined:
    Jul 14, 2022
    Posts:
    2
    Yeah I don't think there's a way that works for everyone so I just worked around it and open the script in File Explorer. (it should be a .cs file by the way.)
     
  14. glatteinfo

    glatteinfo

    Joined:
    Nov 17, 2019
    Posts:
    19
    Hey everyone,I was trying to fix this problem for almost 6 hours, because none of the google suggestions helped me (fix PlasticSCM, clear unity cache, etc.). So for anyone stumbling over this in the future:
    In my case it had to do with a problem of the graphics card - thus editor wasent able to render the scene view and got stuck on editor load. I noticed it when i tried to run an old build and it wasent working either.

    P.s. For anyone using a Surface Book 2: Unity tends to trigger 1 of the 2 graphics card to disable itself for some reason when going into power save mode and the returning into unity, (disabling the Nvidia card leaving you only with the graphics card in the screen/tablet part). The remaining graphics card can handle URP but not HDRP causing the editor to freeze on next load (while magically it still works as long as you dont restart unity)

    @jeanedouard_unity if you could add an error message at some point on project load if there is a problem with i.e. rendering scene view giving you a hint on where the problem might be (as in my example with the graphics card) that would be a blast.
     
    Last edited: Sep 7, 2022
  15. jeanedouard_unity

    jeanedouard_unity

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    49
    Thanks for the investigation. I'll report your issue to the Editor team and if they open a public issue I'll link it here.
     
    glatteinfo likes this.
  16. goddamnmisfit

    goddamnmisfit

    Joined:
    Sep 9, 2022
    Posts:
    1
    Guys, u should off "Player projects", that's all. The way I solved this problem. upload_2022-9-10_1-39-40.png
     
    Tymac likes this.
  17. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Same problem now, out of no where, project was fine yesterday, booted up today, unable to open script. i even left it running for more than an hour waiting on unity coremodule.. nothing.. latest 2021 LTS..

    Only thing i mananged was to remove the waiting timer from the popup.. upload_2022-10-12_21-35-25.png
     
    schlista and THJSmith like this.
  18. schlista

    schlista

    Joined:
    May 9, 2022
    Posts:
    1
    I keep getting this wait message now too (Vaupell)'s post.
     
  19. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    had this happen once, did not record any info. I think it was on a new project that i had just created but not initialized but imported some player controller I was working on.

    my fix was to delete the project and redo.
    worked fine after that.
    Was messing around during the install or somthin clicking play
     
  20. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    Digging this up because I ran into a similar issue. For me it was PowerToys FileExplorer Addon.

    I had an issue where if I selected a script file and tried to drag it onto a game object the editor would hang for ever.
    If I selected the file in a File Explorer Window it would attempt to preview and then I would get a catastrophic failure from .NET.

    Looking into the call stack pointed to PowerToys trying to preview the file.

    I disabled it and my issue was resolved.
     
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    How do you check call stack of the editor?
     
  22. slims

    slims

    Joined:
    Dec 31, 2013
    Posts:
    86
    You can go to the Editor.log file at AppData/Local/Unity/Editor.

    I am also having this problem after upgrading to 2022.2.3f1

    My editor log is spammed with this:
    Asset Pipeline Refresh (id=c995216c47eea4947aedf62e183e9c9c): Total: 0.006 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
    NullReferenceException: Object reference not set to an instance of an object
    at UnityEngine.Rendering.Universal.UniversalRenderer..ctor (UnityEngine.Rendering.Universal.UniversalRendererData data) [0x0003e] in .\Library\PackageCache\com.unity.render-pipelines.universal@14.0.5\Runtime\UniversalRenderer.cs:186
    at UnityEngine.Rendering.Universal.UniversalRendererData.Create () [0x00016] in .\Library\PackageCache\com.unity.render-pipelines.universal@14.0.5\Runtime\UniversalRendererData.cs:168
    at UnityEngine.Rendering.Universal.ScriptableRendererData.InternalCreateRenderer () [0x00009] in .\Library\PackageCache\com.unity.render-pipelines.universal@14.0.5\Runtime\ScriptableRendererData.cs:72
    at UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset.CreateRenderers () [0x000a2] in .\Library\PackageCache\com.unity.render-pipelines.universal@14.0.5\Runtime\Data\UniversalRenderPipelineAsset.cs:844
    at UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset.CreatePipeline () [0x000ac] in .\Library\PackageCache\com.unity.render-pipelines.universal@14.0.5\Runtime\Data\UniversalRenderPipelineAsset.cs:769
    at UnityEngine.Rendering.RenderPipelineAsset.InternalCreatePipeline () [0x00004] in <ba80266bdc0549f69eb2853bd3ede7ff>:0
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    UnityEngine.Rendering.RenderPipelineAsset:InternalCreatePipeline()
    UnityEngine.Rendering.RenderPipelineManager:prepareRenderPipeline(RenderPipelineAsset)
    UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object, AtomicSafetyHandle)
    UnityEditor.Handles:Internal_DrawCameraWithGrid(Camera, DrawCameraMode, DrawGridParameters&, Boolean, Boolean)
    UnityEditor.Handles:DrawCameraImpl(Rect, Camera, DrawCameraMode, Boolean, DrawGridParameters, Boolean, Boolean, Boolean, GameObject[])
    UnityEditor.Handles:DrawCameraStep1(Rect, Camera, DrawCameraMode, DrawGridParameters, Boolean, Boolean)
    UnityEditor.SceneView:DoDrawCamera(Rect, Rect, Boolean&)
    UnityEditor.SceneView:DoOnGUI()
    UnityEditor.SceneView:OnSceneGUI()
    UnityEngine.UIElements.IMGUIContainer:DoOnGUI(Event, Matrix4x4, Rect, Boolean, Rect, Action, Boolean)
    UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent(Event, Matrix4x4, Rect, Action, Boolean)
    UnityEngine.UIElements.IMGUIContainer:DoIMGUIRepaint()
    UnityEngine.UIElements.UIR.RenderChainCommand:ExecuteNonDrawMesh(DrawParams, Single, Exception&)
    UnityEngine.UIElements.UIR.UIRenderDevice:EvaluateChain(RenderChainCommand, Material, Material, Texture, Texture, Single, NativeSlice`1, NativeSlice`1, MaterialPropertyBlock, Boolean, Exception&)
    UnityEngine.UIElements.UIR.RenderChain:Render()
    UnityEngine.UIElements.UIRRepaintUpdater:Update()
    UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase(VisualTreeUpdatePhase)
    UnityEngine.UIElements.Panel:UpdateForRepaint()
    UnityEngine.UIElements.Panel:Repaint(Event)
    UnityEngine.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel)
    UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent(Int32, IntPtr, Boolean&)
    UnityEngine.UIElements.UIEventRegistration:processEvent(Int32, IntPtr)
    UnityEngine.UIElements.<>c:<.cctor>b__1_2(Int32, IntPtr)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  23. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Just in case for other who still getting this issue.
    I found what causing it, turn this off. My problem is gone after i disabled this, no more editor stall.
    from the documentation this feature are flagged as experimental
    upload_2023-1-27_13-30-54.png
     
    oAzuehT likes this.
  24. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
  25. HakanYukselGD

    HakanYukselGD

    Joined:
    Sep 4, 2018
    Posts:
    5
    I restarted my PC and its solved.
     
  26. ARealiti

    ARealiti

    Joined:
    Oct 4, 2013
    Posts:
    133
    Does 2022.3 LTS or the latest update to 2021.3 LTS solve any of these issues? I am thinking of going to 2022.3 LTS or 2021.3.27f1 from 2021.3.1f1.

    Edit: just noticed Slim said also same problems in 2022.3.1f in previous post, thanks. I will try 2021.3.27f1, not hoping for much.
     
    Last edited: Jun 12, 2023
  27. koonm

    koonm

    Joined:
    Jan 5, 2016
    Posts:
    12
    no, in unity 2022.3 LTS the problem become more seriouso_O
     
  28. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    This is driving my crazy. I have to wait 40 seconds each time I run a scene without any Visual Scripting nodes in it. 2021.3.21f1 vs1.8
     
    CloudyVR and MichaelTGD like this.
  29. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    Is there any news as to if this is still being looked at?
     
  30. peaceamit

    peaceamit

    Joined:
    Jul 18, 2015
    Posts:
    9
    Nops, I see the same issue on Unity 2021.3.33 LTS.