# How to react in a blueprint using c++ BeginOverlap

**URL:** <https://forums.unrealengine.com/t/how-to-react-in-a-blueprint-using-c-beginoverlap/451322>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4, question, Blueprint, CPP\
**Created:** [June 26, 2019, 6:22pm UTC](https://forums.unrealengine.com/t/how-to-react-in-a-blueprint-using-c-beginoverlap/451322 "2019-06-26T18:22:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_56b3ca2d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_56b3ca2d](https://forums.unrealengine.com/u/anonymous_user_56b3ca2d)\
**Post date:** [June 26, 2019, 6:22pm UTC](https://forums.unrealengine.com/t/how-to-react-in-a-blueprint-using-c-beginoverlap/451322/1 "2019-06-26T18:22:50Z")

</div>

280801-

I implemented this using the button to be pressed.

![280802-button.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/1/2f1893c812290736734df68f86b0b52c7d964a62.png)

When the button is pressed, it tries to make the blue print actor visible.

![280803-coin.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/c/69c92a16bb01b0bc182910a9848229675dbc31e6.png)

I want to show this.

280804-

So I tried to change the value in blueprint but I do not know how to change other values with BeginOverlap.

Or is there another way?

---

<div class="post-metadata">

**Author:** ![danielf94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@danielf94](https://forums.unrealengine.com/u/danielf94)\
**Post date:** [June 26, 2019, 6:52pm UTC](https://forums.unrealengine.com/t/how-to-react-in-a-blueprint-using-c-beginoverlap/451322/2 "2019-06-26T18:52:33Z")

</div>

First you must get a reference from the actor, in this case it would be the button

use UFUNCTION OnOverlapBegin

.h

```
UFUNCTION()
void OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

```

add the function to your botton and “trigger” so you can pass the botton:

.cpp

```
ACoinButton::ACoinButton()
{
Button->OnComponentBeginOverlap.AddDynamic(this, &ACoinButton::OnOverlapBegin);
Button->SetCollisionProfileName(TEXT("Trigger"));
}

void ACoinButton::OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	OverlappedComp->
}
```
