Search Issue Tracker


Fixed in 2022.2.0b11, 2023.1.0a13



Found in




Issue ID




"NullReferenceException" in Particle System's Shape Module while reference is set



Reproduction steps:
# Open attached project "" and scene "BaseBattleWorld_ProperUnits"
# In Hierarchy window, select "Enemy Warlock" -> "Troop_Enemy_Warlock" -> "Walk VFX"
# Observe Console window
# In Inspector window, while still selecting the same GameObject, select Particle System -> Shape -> Texture
# Assign the same Asset - "Assets -> Prefabs -> Troops -> VFX Particle"
# Observe Console window
# Reopen the project
# Repeat steps 2-3

Expected result: No error throughout any of the steps
Actual result: "NullReferenceException" and "GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced." errors initially, and after entering-exiting play mode again

Reproducible with: 2022.2.0a4, 2022.2.0b4, 2023.1.0a6
Not reproducible with: 2021.3.8f1, 2022.1.13f1, 2022.2.0a3
Could not test with: 2020.3.38f1 (project breaks)

Reproduced on: Windows 10

  1. Resolution Note (fix version 2023.1.0a13):

    Fixed in 2023.1.0a13

  2. Resolution Note (fix version 2022.2.0b11):

    Fixed in 2022.2.0b11

Comments (1)

  1. jkj_spillehallen

    Sep 21, 2022 13:00

    If it has any interest, here is some additional info.

    Another way to produce the same error is to make a particle system, and under Shape:
    Shape: Box
    Emit From: Shell
    Texture: any texture

    Save and restart Unity, then click node with particle system and it will spam these two errors:

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.ShapeModuleUI.OnSceneViewTextureGUI (UnityEngine.ParticleSystem+ShapeModule shapeModule, UnityEngine.Mesh mesh, System.Boolean twoSided, UnityEngine.Material mat, UnityEngine.Matrix4x4 transform) (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.ShapeModuleUI.OnShapeToolGUI (System.Boolean allowGizmoEditing, System.Collections.Generic.IEnumerable`1[T] targets) (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.ShapeModuleUI+ShapeGizmoTool.OnDrawHandles () (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.EditorTools.EditorToolManager.InvokeOnSceneGUICustomEditorTools () (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.SceneView.CallOnSceneGUI () (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.SceneView.DoOnGUI () (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEditor.SceneView.OnSceneGUI () (at <f410fc5435e441ef807a07ba817c3e30>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
    UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
    UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)
    Rethrow as ImmediateModeException
    UnityEngine.UIElements.UIR.RenderChain.Render () (at <8c4c0c3614e7457984f7ec0d5dc10278>:0)

    As soon as You click on "Shape" again, the gizmo will appear correctly and the error spam will stop; then You will not see the error again until You restart Unity and click the particle system node once again.

    If You set texture: none the error will also stop, so I would say that is the trigger (in my case).

    Since it seem to be a problem with the Gizmo, I would assume it wont affect runtime or builds.
    Produced with Unity 2022.2.0b4.2768.

Add comment

Log in to post comment