Error when trying to add States to abilities or scripts

I am getting an error when trying to add the existing States to my characters UCL script, both in the abilities and the overall script states as well.
When trying to add new state to item ability:
highlight 'Aim' ability
go to states and click '+'
Click use existing
select the SniperRifleAimPreset (included in opsive package)
get the following error and nothing is added to states list in UI:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Editor.Inspectors.StateSystem.StateInspector.AddExistingPreset (System.Type objType, Opsive.UltimateCharacterController.StateSystem.State[] states, UnityEditorInternal.ReorderableList reorderableList, System.String selectedIndexKey) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateInspector.cs:329)
Opsive.UltimateCharacterController.Editor.Inspectors.Character.UltimateCharacterLocomotionInspector.AddExistingItemAbilityPreset () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Character/UltimateCharacterLocomotionInspector.cs:1332)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121)


This also happens when creating a new state state in the same place, when i click save after giving it a filename, it generates the errors:

ERROR 1:
UnityException: Creating asset at path Assets/aracterController/Demo/Presets/Items/Shooter/SniperRifle/UltimateCharacterLocomotionPresetTEST.asset failed.
Opsive.UltimateCharacterController.Editor.Inspectors.StateSystem.StateInspector.CreatePreset (System.Object target, Opsive.UltimateCharacterController.StateSystem.State[] states, UnityEditorInternal.ReorderableList reorderableList, System.String selectedIndexKey) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateInspector.cs:373)
Opsive.UltimateCharacterController.Editor.Inspectors.StateSystem.StateBehaviorInspector.CreatePreset () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:197)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121)

ERROR 2:
Parent directory must exist before creating asset at Assets/aracterController/Demo/Presets/Items/Shooter/SniperRifle/UltimateCharacterLocomotionPresetTEST.asset.
UnityEditor.AssetDatabase:CreateAsset(Object, String)
Opsive.UltimateCharacterController.Editor.Inspectors.StateSystem.StateInspector:CreatePreset(Object, State[], ReorderableList, String) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateInspector.cs:373)
Opsive.UltimateCharacterController.Editor.Inspectors.StateSystem.StateBehaviorInspector:CreatePreset() (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:197)
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

in the state inspector class it reaches this point when getting the error: AssetDatabase.CreateAsset(preset, path);

any ideas ??
Thanks Justin,

-Jake
 
This likely relates to the location that you are trying to save the preset in is not within the current project. Make sure the directory that you have selected is within the project that you are working in.
 
Top