Problems with Bow Setup

nitrox32

Member
I've working through the tutorial on setting up the bow. I'm trying to add the an existing state preset under Shootable Weapon. The state is greyed out, when I try to add an existing preset, the preset doesn't appear in the state and I get the following error:

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.StateSystem.StateBehaviorInspector.AddExistingPreset () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:180)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121)


Unity 2018.2.9f1
UCC 2.0.1

Capture.PNG
 
Is that the first error that you receive? My only guess is that this relates to you selecting a preset that is outside of the project that you are using (there should be an error about this though in the console).
 
Yep, that was it. Not sure how the project folder was changed but that fixed it. Thanks!
 
Last edited:
I've got just about everything set up. The bow is firing and reloading properly. The positioning of the arrow is off in both first and third perspective. I have checked and rechecked the values you use in the video and well as confirmed that I am using the correct values with the correct perspective. That said, the arrow is ending up on the other side of the bow during runtime (in first person). Funny thing is that is that in runtime it is positioned correctly in the editor but in game it is on the other side of the bow. The rotation is funky in third person perhaps one has to do with the other.bow.PNG
 
Check the layer of the arrow - it should be on the overlay layer. This was set in the video with the Projectile Start Layer field.
 
Yep, that did it. I have one more issue with the bow. When in third person perspective the arrow and right arm are at wierd angles. arrow.PNG
 
That looks like the arrow attachment location isn't located under the left hand. I would go through the bow video step by step to ensure that it matches - if something doesn't work exactly as it does in the video then take a step back and see what went wrong.
 
Top