- Home /
Argument Exception when selecting object
Hey guys,
I have a Rope component for handling 2D rope creation for a platformer I'm working on. It also has a custom editor so I can display the rope spline in the Sceneview and to structure the Inspector more clearly.
Everything about it works fine, but when any Rope object is first selected, I get the following error: "ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint Aborting"
Here is the section of code, up to the line causing the error. Nothing omitted: public override void OnInspectorGUI() {
Rope rope = (Rope)target;
if (rope.makingRope == null)
{
//Draw the Spline GUI stuff.
serializedObject.Update();
EditorGUI.BeginChangeCheck();
bool includeColliders = GUILayout.Toggle(rope.includeColliders, incColContent);
I've read a few similar questions, but none of them has applied in my case, or had a solution that made a lick of difference.
So, why is this happening? Again, it only happens ONCE, when the object is selected. And the error is convinced it's happening in that GUILayout.Toggle.
Your answer
Follow this Question
Related Questions
App Crash IE8 - UnityScriptCompiler 1 Answer
Latest update spawned weird errors in my console. 1 Answer
OnInspectorGUI - Using the default Object Selection popup. 1 Answer
How to prevent prefab of custom editor inspector from overriding array size. 1 Answer
ArgumentOutOfRangeException When Argument Is Not Out Of Range 1 Answer