After picking up the weapon again, it disappears from the character’s hands

It's hard to say but my guess is that the item hasn't fully been equipped. I recommend starting to debug by adding the item to the default loadout and seeing if it works. If it does then it's something related to your pickup and you could then compare the pickup to the demo scene pickups.
 
It's hard to say but my guess is that the item hasn't fully been equipped. I recommend starting to debug by adding the item to the default loadout and seeing if it works. If it does then it's something related to your pickup and you could then compare the pickup to the demo scene pickups.
If I add an item to the default loadout, the problem is not solved - everything is the same
The weapon item is added every time I pick up the pickup, and the model is disabled, as already shown in the video.

As for the settings of the pickup - there is nothing to configure there - the video shows its settings. I compared it with the demo scene, how magically everything works there, but it doesn’t work for me with identical settings
 
It's hard to say but my guess is that the item hasn't fully been equipped. I recommend starting to debug by adding the item to the default loadout and seeing if it works. If it does then it's something related to your pickup and you could then compare the pickup to the demo scene pickups.
If the weapon whose pickup you take is not in the character’s hands, the model does not disappear. But if the weapon is in the character’s hands, then when the pickup is taken, it disappears.

https://drive.google.com/file/d/1VgkNsAgOrkPJcTyFGES5oFof-J7AEQAV/view?usp=sharing
 
Can you go through the shootable weapon tutorial video and see at what step it stops working? This should make things easier to debug since you are using the same assets.

If the weapon whose pickup you take is not in the character’s hands, the model does not disappear. But if the weapon is in the character’s hands, then when the pickup is taken, it disappears.
The only thing that I can think of which would cause that is that you are trying to switch to a different weapon and not all of the events are setup. On the equip/unequip events are you using a timer or an animation event? I recommend starting with a timer just so you know it's triggering.
 
Can you go through the shootable weapon tutorial video and see at what step it stops working? This should make things easier to debug since you are using the same assets.


The only thing that I can think of which would cause that is that you are trying to switch to a different weapon and not all of the events are setup. On the equip/unequip events are you using a timer or an animation event? I recommend starting with a timer just so you know it's triggering.

https://drive.google.com/file/d/1RUW9h60V_RivDTIB56YjvL7Nr0DtRHsp/view?usp=sharing

Regarding your question - I use a timer.
Regarding the settings as in the demo scene - I have the same bug in the demo scene...

Although with an assault rifle (in the demo scene) such a bug does not happen - probably because in the demo scene it hangs behind the back and a different logic is reproduced, I don’t know

P.S. Three errors in the demo scene are related to shaders, I think they do not affect the result of the inventory and pickup logic) I use URP
 
Last edited:
Can you go through the shootable weapon tutorial video and see at what step it stops working? This should make things easier to debug since you are using the same assets.


The only thing that I can think of which would cause that is that you are trying to switch to a different weapon and not all of the events are setup. On the equip/unequip events are you using a timer or an animation event? I recommend starting with a timer just so you know it's triggering.
Anticipating your recommendation about testing in a new project, I did it and recorded everything on video - starting with installing the current version of the controller. I don't oblige you to watch this, just for the record)

In this video, in a new URP project created on Unity 2021.3.32f, I install a controller and launch a demo scene in which a bug appears with a pickup of a weapon that does not hang on the back - a pistol. Pickup assault rifle works.

At 6:27 launch with converted scene materials to URP.

https://drive.google.com/file/d/1NBrUZy_xCridVxtwHgDQ0DmOt8CYRxEj/view?usp=sharing
 
Thanks! With that I was able to reproduce it within the demo scene. You can fix this by removing SetVisibleObjectActive on line 479 of CharacterItem.
 
Top