How do I make a pickup item with button input?

Hi guys,

I’m trying to make a blueprint pickup item that will only be activated when the player is next to it and presses a button - I’ve managed to make it work when overlapping, but can’t add the extra level of input!
Any help would be hugely appreciated!
Thanks

JJ

Hello jusanator, have you tried using a gate node?

You have the collision components set up so I would use the begin/end overlap to open/close the gate. The gate node only allows the exec pin to flow IF you are within the trigger box or whatever it is that you have. The place whatever it is you want happening from the out pin of the Gate node. Hope this helps.

Thanks very much for the reply! Would this be built in the level blueprint editor?

I think this should work in the levelbp, I believe input is enabled in the level bp by default. If it is not you could always just enable input.

Thanks very much! This is what I have now:

Unfortunately, I have an animation linked to the InputAction assigned to the right face button which won’t play simultaneously, which I think is because I’ve changed the input on the FoodBP to Player 0, but I’m not sure how to solve this. Also, I can only interact with the latest instance of the blueprint placed in the world - do you know why this is?

Thanks so much

Also this is built in the FoodBP (the pickup), not the LevelBP

I would have no idea why it would not play simultaneously unless you disabled input in the other instance you programed the button. If you place it in the your FoodBP, then it should work for all instances of that blueprint. try adding a collision box and use collision with the box directly for your overlap event.

Is the other animation that you linked to the InputAction right face in your DuckCharacter?

Thanks for the reply - Yeah, when I use the InputActionEat (assigned to the right face button) it does an eating animation from the CharacterAnimBP - but stops when I have the input on for food… I’ve tried building this in the DuckCharacterBP but now it still won’t animate or interact with the Food… I’m not sure how to create the overlap event in the LevelBP either :confused: sorry about this!

So you have and animation for eating that you’ve assigned on the FaceButtonRight and when you collide with the FoodBP do you want it to play the same animation or a different one? I would do the collision in your DuckCharacterBP and cast it to your FoodBP and I believe the animation should play because input is allowed. What are you using to play your animation?

I’ve got it working! Thanks so much for your help! :smiley: