Pickup an actor when holding a key

i want a pickup system that picks up an actor (for example a pistol) when holding a key when i’m in the collision of actor.What should i create in my actor’s event graph?

Well it would probably be best to set it to a button action event and do a line trace to see if the pistol is close enough

i think you misunderstood what i meant.

Well you said you didn’t know what event to use, and I told you an event. If that is not what your looking for maybe elaborate a little more? Are you confused on having him hold the item?

i want to create something like shooter games when he is near a weapon he can interact and pickup the pistol i want this by holding a key how can i do this?

thanks i asked the wrong qestion

Yes that would be the button action event like I said here is screenshots going to button mapping section where you can set up buttons and axis in this section, and set they button they use

The most easiest way is to make a new BP Actor.

  1. Add a StaticMesh of the item you want to pick up.
  2. Add a Box Collision, make it nice back so you can stand in it.
  3. Then in the Collision, on EventOnOverlap from the Overlap Actor make a branch to see if its equal to the player, if true, cast to the player (use the Overlap Actor pin), and then perform your event on your player (i.e. enable HasKey boolean).
  4. Then DestroyActor.

That’s pretty much it.

are you asking to see a blueprint of how the button event would look like? I’m confused?


i have this nodes and like i said up there i want it to be like
shooter games but i don’t know how can you please help me?

Yeah I can create a short video here soon and I will show you how to set up your button event hold the pistol and fire it, but also a heads up without proper animations he’s just gonna hold the gun down, because I’m assuming you are just using manny with default animations as I will in the video. But you will see how to set it up, it’s not too complicated

But that’s if ur using third person startup, or did you use first person?

could you take a screenshot please?I’m a beginner.

third person

perform action’s action pin needs an asset what should i choose there?

Screen 1

Screen 2

Ok yeah so he would be stuck holding the gun down till you had a proper animation, so I would make a video for you later today of how to set this up to a button pick it up and actually hold it. If you want to actually hold the gun you don’t want to do it amsanity’s way and do you need to see bullet spawning as well?

Perform Player Action node is a custom node from a function I made in the Player Character. You can access custom events and/or functions by casting.

You mind want to watch a view tutorials to get more indepth understanding on blueprint communications (<- search on these keywords)

yes thank you

when will you make this video?

thank you very much