Issues getting Agility pack to work

Samsonite71

New member
So I want to flag that I am a new user so I might have missed something really basic but reading through the setup I can't really see what I might have missed. If that is the case, my apologies :).

I just cant get the agility pack to work except in the demo scene included. I even tried to patch Nolan in the demo scene from the standard install. No go.

Using the included add-on tool for agility returns an error when trying to inject the animations and abilities (tested it with a fresh project). Tested it on my own characters as well as Nolan. I made sure I downloaded the latest version release yesterday to make sure I use that as well.

Using 2019.18f1 I get a "object reference not set to an instance of an object" when running the add-on tool on the char . Since I have really limited understanding of code I cant really root cause this error.

Did anyone experience this and know the solution?
These are the error messages I get.
Code:
You are trying to create a MonoBehaviour using the 'new' keyword.  This is not allowed.  MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all
UnityEngine.MonoBehaviour:.ctor()
Opsive.UltimateCharacterController.AddOns.Agility.AOTLinker:.ctor()
System.Activator:CreateInstance(Type)
Opsive.UltimateCharacterController.Utility.Builders.AbilityBuilder:AddAbility(UltimateCharacterLocomotion, Type, Int32) (at Assets/Opsive/UltimateCharacterController/Scripts/Utility/Builders/AbilityBuilder.cs:77)
Opsive.UltimateCharacterController.AddOns.Shared.Editor.AddOnInspectorUtility:SetupCharacter() (at Assets/Opsive/UltimateCharacterController/Add-Ons/Shared/Editor/AddOnInspectorUtility.cs:135)
Opsive.UltimateCharacterController.Editor.Managers.ManagerUtilityrawControlBox(String, Action, String, Boolean, String, Action, String) (at Assets/Opsive/UltimateCharacterController/Editor/Managers/ManagerUtility.cs:57)
Opsive.UltimateCharacterController.AddOns.Shared.Editor.AddOnInspectorUtilityrawInspector(IAbilityAddOnInspector) (at Assets/Opsive/UltimateCharacterController/Add-Ons/Shared/Editor/AddOnInspectorUtility.cs:31)
Opsive.UltimateCharacterController.AddOns.Agility.Editor.AgilityAddOnInspectorrawInspector() (at Assets/Opsive/UltimateCharacterController/Add-Ons/Agility/Editor/AgilityAddOnInspector.cs:39)
Opsive.UltimateCharacterController.Editor.Managers.AddOnsManagerrawInstalledAddOns() (at Assets/Opsive/UltimateCharacterController/Editor/Managers/AddOnsManager.cs:247)
Opsive.UltimateCharacterController.Editor.Managers.AddOnsManager:OnGUI() (at Assets/Opsive/UltimateCharacterController/Editor/Managers/AddOnsManager.cs:226)
Opsive.UltimateCharacterController.Editor.Managers.MainManagerWindow:OnManagerGUI() (at Assets/Opsive/UltimateCharacterController/Editor/Managers/MainManagerWindow.cs:407)
Opsive.UltimateCharacterController.Editor.Managers.MainManagerWindow:OnGUI() (at Assets/Opsive/UltimateCharacterController/Editor/Managers/MainManagerWindow.cs:305)
UnityEngine.GUIUtilityrocessEvent(Int32, IntPtr)


NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Utility.Builders.AbilityBuilder.SetAbilityDefaultValues (Opsive.UltimateCharacterController.Character.Abilities.Ability ability) (at Assets/Opsive/UltimateCharacterController/Scripts/Utility/Builders/AbilityBuilder.cs:254)
Opsive.UltimateCharacterController.Utility.Builders.AbilityBuilder.AddAbility (Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion characterLocomotion, System.Type abilityType, System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Scripts/Utility/Builders/AbilityBuilder.cs:80)
Opsive.UltimateCharacterController.AddOns.Shared.Editor.AddOnInspectorUtility.SetupCharacter () (at Assets/Opsive/UltimateCharacterController/Add-Ons/Shared/Editor/AddOnInspectorUtility.cs:135)
Opsive.UltimateCharacterController.Editor.Managers.ManagerUtility.DrawControlBox (System.String title, System.Action additionalControls, System.String message, System.Boolean enableButton, System.String button, System.Action action, System.String successLog) (at Assets/Opsive/UltimateCharacterController/Editor/Managers/ManagerUtility.cs:57)
Opsive.UltimateCharacterController.AddOns.Shared.Editor.AddOnInspectorUtility.DrawInspector (Opsive.UltimateCharacterController.AddOns.Shared.Editor.IAbilityAddOnInspector addOnInspector) (at Assets/Opsive/UltimateCharacterController/Add-Ons/Shared/Editor/AddOnInspectorUtility.cs:31)
Opsive.UltimateCharacterController.AddOns.Agility.Editor.AgilityAddOnInspector.DrawInspector () (at Assets/Opsive/UltimateCharacterController/Add-Ons/Agility/Editor/AgilityAddOnInspector.cs:39)
Opsive.UltimateCharacterController.Editor.Managers.AddOnsManager.DrawInstalledAddOns () (at Assets/Opsive/UltimateCharacterController/Editor/Managers/AddOnsManager.cs:247)
Opsive.UltimateCharacterController.Editor.Managers.AddOnsManager.OnGUI () (at Assets/Opsive/UltimateCharacterController/Editor/Managers/AddOnsManager.cs:226)
Opsive.UltimateCharacterController.Editor.Managers.MainManagerWindow.OnManagerGUI () (at Assets/Opsive/UltimateCharacterController/Editor/Managers/MainManagerWindow.cs:407)
Opsive.UltimateCharacterController.Editor.Managers.MainManagerWindow.OnGUI () (at Assets/Opsive/UltimateCharacterController/Editor/Managers/MainManagerWindow.cs:305)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <8d21067e8d9c494db25a2b2485216e63>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <8d21067e8d9c494db25a2b2485216e63>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <8d21067e8d9c494db25a2b2485216e63>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <8d21067e8d9c494db25a2b2485216e63>:0)
UnityEditor.DockArea.OldOnGUI () (at <8d21067e8d9c494db25a2b2485216e63>: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 <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <fe7ee1881b524b0d9443f74417fb598b>:0)
 

Justin

Administrator
Staff member
I just tried and am getting the same error. I will get it fixed and resubmit a new version since this is pretty basic. I'll let you know after I do. Thanks for letting me know.

Edit: you can fix this by adding the following to line 124 of AddOnInspectorUtility:
Code:
                    if (!typeof(Character.Abilities.Ability).IsAssignableFrom(types[i])) {
                        continue;
                    }

I will also update the add-ons to include this.
 
Last edited:

Samsonite71

New member
I just tried and am getting the same error. I will get it fixed and resubmit a new version since this is pretty basic. I'll let you know after I do. Thanks for letting me know.

Edit: you can fix this by adding the following to line 124 of AddOnInspectorUtility:
Code:
                    if (!typeof(Character.Abilities.Ability).IsAssignableFrom(types[i])) {
                        continue;
                    }

I will also update the add-ons to include this.
Well that is great news since I feel a bit less stupid now :). Thank you Sir.
 

Samsonite71

New member
I just tried and am getting the same error. I will get it fixed and resubmit a new version since this is pretty basic. I'll let you know after I do. Thanks for letting me know.

Edit: you can fix this by adding the following to line 124 of AddOnInspectorUtility:
Code:
                    if (!typeof(Character.Abilities.Ability).IsAssignableFrom(types[i])) {
                        continue;
                    }

I will also update the add-ons to include this.
Tested and it works. Thank you.
 
Top