• Opsive has been nominated for TWO Unity Awards: Publisher of the Year and Best Development Tool (Behavior Designer Pro)! Your support means everything, cast your vote here: https://awards.unity.com/vote

[Bug] Missing Method Exception when selecting Movement tasks

Cheo

Active member
Hello, when selecting a Movement task in the BD Pro graph, I get the following error :

C#:
[Exception] MissingMethodException: Default constructor not found for type Opsive.BehaviorDesigner.AddOns.MovementPack.Runtime.Tasks.Pathfinder
RuntimeType.CreateInstanceMono() at <314938d17f3848e8ac683e11b27f62ee>:0

RuntimeType.CreateInstanceSlow() at <314938d17f3848e8ac683e11b27f62ee>:0

RuntimeType.CreateInstanceDefaultCtor() at <314938d17f3848e8ac683e11b27f62ee>:0

Activator.CreateInstance() at <314938d17f3848e8ac683e11b27f62ee>:0

Activator.CreateInstance() at <314938d17f3848e8ac683e11b27f62ee>:0

Activator.CreateInstance() at <314938d17f3848e8ac683e11b27f62ee>:0

Opsive.BehaviorDesigner.AddOns.MovementPack.Editor.MovementBaseTypeControl+MovementBaseView..ctor() at /Opsive/BehaviorDesigner/Add-Ons/MovementPack/Editor/MovementBaseTypeControl.cs:58
  56:  // Set the NavMeshAgent implementation if the task doesn't already have one set.
  57:  if (movementBase.Pathfinder == null) {
-->  58:      m_MovementBase.Pathfinder = Activator.CreateInstance(m_PathfinderTypes[m_PathfinderIndex]) as Pathfinder;
  59:      onChangeEvent?.Invoke(m_MovementBase);
  60:  }

MovementBaseTypeControl.GetControl() at /Opsive/BehaviorDesigner/Add-Ons/MovementPack/Editor/MovementBaseTypeControl.cs:149
 147:      protected override VisualElement GetControl(TypeControlInput input)
 148:      {
--> 149:          return new MovementBaseView(input.UnityObject, input.Value as MovementBase, input.OnChangeEvent);
 150:      }
 151:  }

TypeControlBase.GetTypeControl() at <b6b394c4b0074b3e94c3d812796a26c6>:0

FieldInspectorView.AddTypeControl() at <b6b394c4b0074b3e94c3d812796a26c6>:0

FieldInspectorView.AddFields() at <b6b394c4b0074b3e94c3d812796a26c6>:0

StackedTaskControl+StackedTaskView.AddTaskValues() at <048069e3e6524f578c0cb40e9fbdb1bc>:0

StackedTaskControl+StackedTaskView+<>c__DisplayClass7_1.<.ctor>b__3() at <048069e3e6524f578c0cb40e9fbdb1bc>:0

ReorderableList.SelectItem() at <b6b394c4b0074b3e94c3d812796a26c6>:0

ReorderableList.set_SelectedIndex() at <b6b394c4b0074b3e94c3d812796a26c6>:0

Opsive.BehaviorDesigner.Editor.Controls.StackedTaskControl+StackedTaskView..ctor() at <048069e3e6524f578c0cb40e9fbdb1bc>:0

StackedTaskControl.GetControl() at <048069e3e6524f578c0cb40e9fbdb1bc>:0

TypeControlBase.GetTypeControl() at <b6b394c4b0074b3e94c3d812796a26c6>:0

FieldInspectorView.AddTypeControl() at <b6b394c4b0074b3e94c3d812796a26c6>:0

FieldInspectorView.AddFields() at <b6b394c4b0074b3e94c3d812796a26c6>:0

NodeInspector.ShowNodeFields() at <d574f56fb4f54d189f7bbe1ae88853e6>:0

NodeInspector.UpdateInspector() at <d574f56fb4f54d189f7bbe1ae88853e6>:0

GraphView.AddToSelection() at <d574f56fb4f54d189f7bbe1ae88853e6>:0

GraphView.AddToSelection() at <d574f56fb4f54d189f7bbe1ae88853e6>:0

GraphElement.OnMouseDown() at <d574f56fb4f54d189f7bbe1ae88853e6>:0

UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke() at <000b9cabcd7144318084fe66c973c221>:0

EventCallbackRegistry+DynamicCallbackList.Invoke() at <000b9cabcd7144318084fe66c973c221>:0

EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent() at <000b9cabcd7144318084fe66c973c221>:0

EventDispatchUtilities.DispatchToCachedElementUnderPointerOrPanelRoot() at <000b9cabcd7144318084fe66c973c221>:0

EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer() at <000b9cabcd7144318084fe66c973c221>:0

UnityEngine.UIElements.PointerEventBase`1[T].Dispatch() at <000b9cabcd7144318084fe66c973c221>:0

EventDispatcher.ProcessEvent() at <000b9cabcd7144318084fe66c973c221>:0

EventDispatcher.Dispatch() at <000b9cabcd7144318084fe66c973c221>:0

BaseVisualElementPanel.SendEvent() at <000b9cabcd7144318084fe66c973c221>:0

UIElementsUtility.DoDispatch() at <000b9cabcd7144318084fe66c973c221>:0

UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent() at <000b9cabcd7144318084fe66c973c221>:0

UIEventRegistration.ProcessEvent() at <000b9cabcd7144318084fe66c973c221>:0

UIEventRegistration+<>c.<.cctor>b__1_2() at <000b9cabcd7144318084fe66c973c221>:0

GUIUtility.ProcessEvent() at <f6111d1faa514697a3ca90ffef671e30>:0

Here's a video showing the error popping up :


This is using the latest versions of BD Pro and the Movement pack. Hope this can be taken a look at, thanks.
 
I just tried to reproduce this using Unity 6 in a fresh project but wasn't able to. You could try adding a default constructor to NavMeshAgentPathfinder but it shouldn't be necessary:

Code:
public NavMeshAgentPathfinder() {}
 
Thanks for this very quick reply, but unfortunately adding this to NavMeshAgentPathfinder did not solve the issue. I created a new project in Unity 6.0.48 (the latest LTS) and got the bug again. May I please ask you to try creating a new project in the same version, and import BD Pro from a download on the Opsive website and then the Movement Pack you personally sent me ? I'm confident you'll get the error through one of these three factors. Thanks.
 
I was using the latest and I'm not able to reproduce it. I also haven't gotten any other reports about this issue which I would have expected to since it's a simple use case. With that said, you could change the error line to:

Code:
                    pathfinder = Activator.CreateInstance(typeof(NavMeshAgentPathfinder)) as Pathfinder;

This will force the default pathfinder type.
 
Yes, that solves it, thanks ! I would nonetheless appreciate if you could try with the latest BD Pro package from the Opsive website and the one you sent me to be absolutely sure whether the issue is isolated to my side.
 
Back
Top