Bow not Releasing

nitrox32

Member
I've been trying to get through the tutorial on Shootable Weapons. I've worked my way through the assault rifle section and am getting through the bow portion. Everything seems to be working except when I draw the bow with the mouse button the bow will not go back to it's original position after I release the button. It just stays drawn. Any thoughts?
 
Make sure you are using a charge and hold fire type. When the use ability tries to stop it will then release the bow.
 
OK, now the bow is returning to it's original position if I let go of the charge button. However, I'm getting this error only when switching from the assault rifle back to the bow:
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[UnityEngine.Material,Opsive.UltimateCharacterController.ThirdPersonController.Camera.ObjectFader+OriginalMaterialValue].Add (UnityEngine.Material key, OriginalMaterialValue value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
Opsive.UltimateCharacterController.ThirdPersonController.Camera.ObjectFader.InitializeCharacterFadeRenderers (UnityEngine.Renderer[] renderers) (at Assets/Opsive/UltimateCharacterController/ThirdPersonController/Scripts/Camera/ObjectFader.cs:602)
Opsive.UltimateCharacterController.ThirdPersonController.Camera.ObjectFader.OnShowProjectile (UnityEngine.GameObject projectile, Boolean show) (at Assets/Opsive/UltimateCharacterController/ThirdPersonController/Scripts/Camera/ObjectFader.cs:625)
Opsive.UltimateCharacterController.Events.InvokableAction`2[UnityEngine.GameObject,System.Boolean].Invoke (UnityEngine.GameObject arg1, Boolean arg2) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/InvokableAction.cs:132)
Opsive.UltimateCharacterController.Events.EventHandler.ExecuteEvent[GameObject,Boolean] (System.Object obj, System.String eventName, UnityEngine.GameObject arg1, Boolean arg2) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/EventHandler.cs:425)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.DetermineVisibleProjectile (Boolean forceDisable) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:809)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon.Equip () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:456)
Opsive.UltimateCharacterController.Items.Item.Equip (Boolean immediateEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:378)
Opsive.UltimateCharacterController.Inventory.InventoryBase.EquipItem (Opsive.UltimateCharacterController.Inventory.ItemType itemType, Int32 slotID, Boolean immediateEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:328)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemEquip (Int32 slotID, Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:849)
Opsive.UltimateCharacterController.Game.Scheduler.AddEventInternal[Int32,Boolean] (Single delay, InvokeLocation invokeLocation, System.Action`2 action, Int32 value1, Boolean value2) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/Scheduler.cs:527)
Opsive.UltimateCharacterController.Game.Scheduler.ScheduleFixed[Int32,Boolean] (Single delay, System.Action`2 action, Int32 value1, Boolean value2) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/Scheduler.cs:512)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemUnequipComplete (Int32 slotID, Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:776)
Opsive.UltimateCharacterController.Game.Scheduler.AddEventInternal[Int32,Boolean] (Single delay, InvokeLocation invokeLocation, System.Action`2 action, Int32 value1, Boolean value2) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/Scheduler.cs:527)
Opsive.UltimateCharacterController.Game.Scheduler.ScheduleFixed[Int32,Boolean] (Single delay, System.Action`2 action, Int32 value1, Boolean value2) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/Scheduler.cs:512)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.ItemUnequip (Int32 slotID, Boolean canUpdate) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:692)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:454)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:585)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:512)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.Move (Single horizontalMovement, Single forwardMovement, Single deltaYawRotation) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:455)
Opsive.UltimateCharacterController.Game.DeterministicObjectManager+DeterministicCharacter.FixedMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/DeterministicObjectManager.cs:146)
Opsive.UltimateCharacterController.Game.DeterministicObjectManager.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/DeterministicObjectManager.cs:589)
 
That looks completely separate error - can you tell me how to reproduce it so I can look into it?
 
I'm not sure. What I can say is that I've been following the tutorials and when everything was fine until I got to the shootable weapons video. I have been using my own item types and collection (with your values), but that doesn't seem to create any problems with the functionality of the weapons. I can send you the project file if you'd like. These are the steps I take within play mode:

Press "E" or "Q" to switch to assault rifle
Press "E" or "Q" to switch back to the bow

Then the error occurs, this only happens when switching back to the bow. I can send you the project file if you'd like. It was created from a clean scene.
 
Feel free to PM me the link so I can download. To make the file smaller I only need the unique files (you don't need to include the ucc files).
 
Top