Open Door on overlap

Im trying to Open a door when i enter an overlap area and press E although I cant seem to make it work when I press a key. I tried calling the function when the input is pressed although It didn’t seem to work. The door opens fine when i don’t have the input implemented.


Any help would be appreciated :slight_smile:

You need to use three functions

A) The overlap to set a bool that you are in range

B) a bind pressed test that will trigger the action if the bool is true

C) overlap end needs to set the bool to false

Why are you using SetupPlayerInputComponent on an actor? You are not overriding any function with it because it is derived from the ACharacter class not the AActor class

Okay so i tried following what u told me and I made the 3 functions with the bool BIsOverlaping


But Not sure how to do B) step but also the endoverlap it gives me an error

would b) be something like this

on the bind action the object thing gives me also an error not sure what to put there
Thanks for replying!!

A working project with what you want to accomplish.

1 Like

This topic has been moved from International to Programming & Scripting: C++.

When posting, please review the categories to ensure your topic is posted in the most relevant space. Hopefully, this new category helps you (or other devs with similar questions!).

In the meantime, good luck and happy developing! :slight_smile: