GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced

Hi There So I have this issue and can’t seem to work out how to fix it!

I’m using Astar Pathfinder Pro 4.1
and Unity3D 2019.3.0a2

I’m following the Tutorial video https://www.youtube.com/watch?v=5QT5Czfe0YE

I’m getting This Error and cant move forward…
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.

Desktop%20screenshot

I was able to reproduce this issue with 4.1.0 beta ( pro )

I was able to fix it by changing the following lines of code;
In EditorGUIx.cs L103

public void Header (string label, ref bool open) {
	/*if (GUILayout.Button(label, labelStyle)) {
		open = !open;
		editor.Repaint();
	}*/
	this.open = true;
}

After having unity compile the changes I reverted the changes and all seemed to work again.

I do recommend updating to the latest version 4.2.8

Hi

I cannot replicate it still, so I’m not sure what’s causing it.

@ToastyStoemp Can you reliably cause the error again if you uncomment that code again?

@Dead-Rose Do you think you could post the full stack trace for the error message?

I tried going over this step by step again, only to end up with a different outcome, nonetheless here are the steps I took:

Unity version 2019.3.0b4
A*PP version 4.1.0 beta (pro)

Create new project
Import the unity package
Open exampleScene Recast Example 1
Select the A* object Pathfinder

image

As you can see here the inspector becomes unusable.

It does yield in a different error ( warning )
UnityEditor.EditorGUILayout:EndFadeGroup()
Pathfinding.FadeArea:End() (at Assets/AstarPathfindingProject/Editor/EditorGUIx.cs:135)
Pathfinding.AstarPathEditor:DrawGraph(GraphEditor) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:714)
Pathfinding.AstarPathEditor:DrawMainArea() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:395)
Pathfinding.AstarPathEditor:OnInspectorGUI() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:277)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

This I was able to resolve by changing the next function:

**From:**
public void End () {
		EditorGUILayout.EndVertical();
		if (visible) {
			// Some space that cannot be placed in the GUIStyle unfortunately
			GUILayout.Space(4);
			EditorGUILayout.EndFadeGroup();
		}
		EditorGUILayout.EndVertical();
		GUIUtilityx.PopTint();
	}
**To:**
public void End () {
	EditorGUILayout.EndVertical();
	if (true) {
		// Some space that cannot be placed in the GUIStyle unfortunately
		GUILayout.Space(4);
		EditorGUILayout.EndFadeGroup();
		}
		EditorGUILayout.EndVertical();
		GUIUtilityx.PopTint();
	}

I tried the exact same using 4.2.8 and did NOT have this issue.
The example scene ran fine after re linking the forward animation on the mine_bot.
Also able to Unity version 2019.1.14f1 with A* 4.2.8 worked flawless.

So @Dead-Rose I’d highly recommend updating to the latest version of A* PP, you can find the latest download here: https://arongranberg.com/astar/download

1 Like

Hi!

I have this issue in 2021. I use Unity 2020.3.17f1 and A* 4.2.15.

So; “GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.” in console and also some wierd Inspector bugs like not able to press the enable/disable button or an empty Inspector. This is only when i have A* imported in a project.

I did not test other Unity versions since this 3.17f is the latest 2020LTS and this is my project version.

Hi

Does this happen if you create the AstarPath component in a new scene?

Hi,

It does work in a clean scene, but i fixed it in my used scenes with the solution from @ToastyStoemp

From:

public void End () {
		EditorGUILayout.EndVertical();
		if (visible) {
			// Some space that cannot be placed in the GUIStyle unfortunately
			GUILayout.Space(4);
			EditorGUILayout.EndFadeGroup();
		}
		EditorGUILayout.EndVertical();
		GUIUtilityx.PopTint();
	}

To:

public void End () {
	EditorGUILayout.EndVertical();
	if (true) {
		// Some space that cannot be placed in the GUIStyle unfortunately
		GUILayout.Space(4);
		EditorGUILayout.EndFadeGroup();
		}
		EditorGUILayout.EndVertical();
		GUIUtilityx.PopTint();
	}

Hi

Thanks. I checked the code and it looks like I’ve already made this fix in the beta version.