i created an ammo pickup blueprint where i can fill up the ammo when the player is overlapping and a button is pressed. This works fine when just 1 ammo pickup is in the scene. As soon there are more pickups of the same blueprint in the scene its only working for the last placed ammo pickup in the scene. If i remove the gate and the button pressed its working for all placed ammo pickups in the scene.
How can i fix that? Thanks for the help.
Here is the ammo pickup blueprint.
Pick Up Item If Its Collided And A Button Is Pressed not working with multiple pickup instances in the scene
My approach destroys the actor on consume.
On press (input action), get all overlapping actors of class, get (index 0), Do something, Destroy actor.
So if I have 4 ammo actors in a pile I’ll get the last first. It’ll be destroyed on consume. Next key press I’ll get the 3rd etc and so forth.
Here’s the approach using blueprint interface.
In character class …
In the item class (pick up actor) …
My inventory system is all contained in an actor component. Said component has a pick up / drop function for each type of item. weapons, ammo, throwables, meds etc.
thank you, i managed to get it working with your help.