Problem with Use state with shootable weapon

Szymon Z.

Member
Hello,

I have problem with states of my player.
I created my own shootable weapon, but when i try to shoot, it is "Freez" in Use state forever. I have no idea what can be wrong. I unchecked "wait for animation event" everywhere but it still doesn't help. I already spent hours trying to solve that issue, has anyone any advice ? And yes i saw the tutorial on the youtube, but it doesnt help, while the problem doesnt exists on the tutorial
 
To get started have you followed the tutorial with the demo assets? This will allow you to follow the video exactly so you can understand the workflow. Once you have that down you can use your own weapon which the only difference will be the model that you use.

The top of this page has some tips for troubleshooting the shootable weapon. My guess is that it could be related to the third item: https://opsive.com/support/document...roller/items/actions/usable/shootable-weapon/
 
Hello,

Yes i tried with demo weapon, it's same thing. When i press Fire1 button is going to UseState and stay here forever. Even if "Wait for animation event" is unchecked. I also wrote classes to force stop using item, like EventHandler.ExecuteEvent, but it won't help. One thing that I found is, i wrote my own class already and devired from Shootable Weapon. Then i attached this to my new created item and ovverided OnItemUseUpdate function to extend that to debug state of my weapon. And value CanStopItem is always "False", so i think this is problem the state of my weapon is never changing to be possible to change state. I saw the tutorial, but I'm doing that with Ultimate Inventory, so i just added a step to Integrate Item in Ultimate Inventory and selected Consumable Items to one created in Ultimate Inventory before. It's all. But when i try to press "use" it's just not working as except... Plus i have an Muzzle attached and it also didn't spawn
 
If you create a new fresh project with just the character controller imported can you successfully get an assault rifle working by following the video? I would start with this before making any modifications since the modifications may inadvertently cause things not to function the way that they are supposed to. For this initial test do not use the Ultimate Inventory System.
 
Also when creating with inventory system, even consumable items (ammo) won't be use. I have 50/50 in clip and i can see that in inspector, even if i will add some extra to my default loadout. So state seems to be changed to "use", animation is playing but consumable items arent use, seems like weapon is just not starting to shoot. In my opinion that can be the problem, because as i see the code, if mode is set to "instant" we have to wait at least 1 bullet to be shoot before we can stop use item (and my item is stuck on Can Stop Item : False)
 
Ok, the inventory system adds another layer of complexity. I'm moving this thread as the problem looks related to the integration.

Have you followed along with these videos to get it setup exactly as shown in the video? @Sangemdoko does a great job of going through step by step explaining how everything is setup and you should follow the video just like he does before attempting to create your own set of weapons.


 
Top