How can I interact with an object once I am in its collision box that I have made?

Hey Community,

So in my game there is a sword. I need to be able to walk to the sword and once I get within a certain range of it (the collision box I made), I should be able to press “E” and then the sword would be destroyed or something. I can’t figure out how to make it so that the collision box recognizes that you are in it and that you can press “E”.

Thanks for any help

You can use the Event On Actor Being Overlap, this will be called when player triggers and overlap event. So you could have a trigger volume out in the scene and you use that for figuring out if the player is within range to get the sword. From the event, you could “Enable Input”, then if you type “E” into the search box you’ll see and event for “E”, now anything you stem off of that will be called when you hit “E”. You might want to consider “Disabling Input” on another Event call On ACtor End Overlap, this way when you walk out from the trigger volume you turn off the ability to hit “E” and have it do anything.