# Open Door on overlap

**URL:** <https://forums.unrealengine.com/t/open-door-on-overlap/690352>\
**Category:** C++\
**Tags:** newbie, unreal-engine, please-help-me, need-help\
**Created:** [November 14, 2022, 1:06pm UTC](https://forums.unrealengine.com/t/open-door-on-overlap/690352 "2022-11-14T13:06:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marquez02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marquez02](https://forums.unrealengine.com/u/Marquez02)\
**Post date:** [November 14, 2022, 1:06pm UTC](https://forums.unrealengine.com/t/open-door-on-overlap/690352/1 "2022-11-14T13:06:26Z")

</div>

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.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/3/443ffe26f421a36710c710f3af05c650661714c7.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/2/672ebafe27d0cb7205eab5aa10b7d497aed39059.png)

Any help would be appreciated 🙂

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [November 14, 2022, 10:44pm UTC](https://forums.unrealengine.com/t/open-door-on-overlap/690352/2 "2022-11-14T22:44:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Marquez02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marquez02](https://forums.unrealengine.com/u/Marquez02)\
**Post date:** [November 15, 2022, 5:38pm UTC](https://forums.unrealengine.com/t/open-door-on-overlap/690352/4 "2022-11-15T17:38:32Z")

</div>

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/8/9786d4e1ea62dcb5d210305471ddda2c7c15a578.png)  
But Not sure how to do B) step but also the endoverlap it gives me an error  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/a/47a316d88cfb9eb470d5455841dcc497d2a82195.png)  
would b) be something like this  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/d/06dc45641fa57708f613617a3908160ddf4362ce.png)  
on the bind action the object thing gives me also an error not sure what to put there  
Thanks for replying!!

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [November 15, 2022, 8:23pm UTC](https://forums.unrealengine.com/t/open-door-on-overlap/690352/5 "2022-11-15T20:23:56Z")

</div>

> **[DoorProj.zip](https://drive.google.com/file/d/1f0mcYoJKW1SOXWyDLTcsvuafTAoAoxFz/view?usp=sharing)**
>
> Google Drive file.

A working project with what you want to accomplish.

---

<div class="post-metadata">

**Author:** ![PresumptivePanda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/presumptivepanda/32/1194593_2.png) [@PresumptivePanda](https://forums.unrealengine.com/u/PresumptivePanda)\
**Post date:** [November 24, 2022, 1:42am UTC](https://forums.unrealengine.com/t/open-door-on-overlap/690352/6 "2022-11-24T01:42:32Z")

</div>

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! 🙂
