0
Fixed

The object of type "GameObject" has been destroyed ... ?

PET 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 6

I made an unlisted video here:

Not sure exactly if this is a bug or I'm doing something wrong.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

I can't edit my post but to sum it up:

- My graph variable "plantToBuild" becomes Null after I set it up as GameObject. This happens all the time for example when I'm saving the scene. Everything seem to work fine even if this exists
- I did a couple of Undo's and some of my Super Units got mixed up. This is maybe what triggered this problem. It worked fine before. I will investigate furder with the undos.
- Main problem is the error:

MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
Ludiq.ConversionUtility.UnityHierarchyConversion (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:453)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:498)
Rethrow as InvalidConversionException: Failed to convert from 'UnityEngine.GameObject' to 'UnityEngine.Transform' via UnityHierarchy.
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:506)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:215)
Bolt.UnitDescriptor`1+<ValueInputWarnings>d__30[Bolt.SetMember].MoveNext () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescriptor.cs:379)
Bolt.UnitDescriptor`1+<Warnings>d__29[Bolt.SetMember].MoveNext () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescriptor.cs:269)
System.Linq.Enumerable+<CreateCastIterator>c__Iterator0`1[System.Object].MoveNext ()
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Object].MoveNext ()
System.Collections.Generic.List`1[System.Object].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[System.Object]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[Object] (IEnumerable`1 source)
Ludiq.ConversionUtility.EnumerableToListConversion (System.Object value, System.Type listType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:428)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:495)
Rethrow as InvalidConversionException: Failed to convert from 'Bolt.UnitDescriptor`1+<Warnings>d__29[Bolt.SetMember]' to 'System.Collections.Generic.List`1[Bolt.Warning]' via EnumerableToList.
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:506)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:215)
Ludiq.DescriptionAssignment._Run (IDescriptor descriptor, IDescription description) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptionAssignment.cs:74)
Ludiq.DescriptionAssignment.Run (IDescriptor descriptor, IDescription description) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptionAssignment.cs:42)
Ludiq.Descriptor`2[TTarget,TDescription].Describe () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/Descriptor.cs:38)
Bolt.UnitDescriptor`1[TUnit].Describe () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescriptor.cs:42)
Bolt.MemberUnitDescriptor`1[TMemberUnit].Describe () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Framework/Codebase/MemberUnitDescriptor.cs:17)
Ludiq.DescriptorProvider.GetDecorator (IDescribable decorated) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptorProvider.cs:33)
Ludiq.XDescriptorProvider.Descriptor (IDescribable target) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptorProvider.cs:63)
Ludiq.XDescriptorProvider.Description[UnitDescription] (IDescribable target) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptorProvider.cs:78)
Bolt.XUnitDescription.Description (IUnit unit) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescription.cs:40)
Bolt.UnitWidget`1[Bolt.IUnit].Cache (Boolean manual) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Units/UnitWidget.cs:99)
Ludiq.Widget`1[Bolt.IUnit].BeforeGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Widgets/Widget.cs:33)
Ludiq.Canvas`1[TGraph].BeforeGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Canvases/Canvas.cs:147)
Ludiq.Canvas`1[TGraph].OnGraphGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Canvases/Canvas.cs:74)
Ludiq.GraphWindow.OnGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Windows/GraphWindow.cs:311)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:245)

We managed to fix my problem in todays stream. I think this was related to the Undo bug which we were able to reproduce :D

https://clips.twitch.tv/CrunchyQuaintPistachioAllenHuhu

This is a link to the whole livestream:

https://www.twitch.tv/videos/206586930

Hi Bagdan

Based on the video in the first post it looks like you are experiencing the same issue I reported a few weeks back.

https://support.ludiq.io/forums/5-bolt/topics/692-macros-change-after-undo/

+1
Fixed in Alpha

Hi Bogdan! Thanks for the thorough report video.

There are actually 3 different issues here:

  1. Game object variable becoming null: This is not a bug. It's just that Bolt does not enforce the type of a variable beyond its contents (they're not type safe), meaning that a "null game object" ("None" in the inspector) is exactly the same as a null of any other type. Basically, don't worry if that type resets to null.
  2. Changes after many undos: This is indeed related to issue #692. It's a very high priority bug for me, but I haven't yet been able to find why it happens. Still working on it, scheduled for fixing in the v.1.2 cycle.
  3. Descriptor error: Thanks for the report! Found & fixed for v.1.2.2, it was a simple mistake.

Seems like it.