# Receiving click messages

**URL:** <https://forums.unrealengine.com/t/receiving-click-messages/275364>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364 "2014-03-11T02:14:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/1 "2014-03-11T02:14:27Z")

</div>

I’m sure this is a huge noob question, but couldn’t find the answer in the documentation or support requests:

I’m using the “Top Down” project in C++ and trying to get mouse click events.

I see that AActor has a ReceiveActorOnClicked() method, and I add that to my character class (ACodeTopDown3Character : public ACharacter), but it doesn’t get called when the player character is clicked. Do I need to do something else to ensure that this gets called?

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/2 "2014-03-11T02:14:27Z")

</div>

bEnableClickEvents needs to be true in your PlayerController class to enable the click events.

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/3 "2014-03-11T02:14:28Z")

</div>

Marc, I’m not seeing anything called bEnableClickEvents anywhere in PlayerController or AActor or anywhere in the whole code base. Are you running a more recent version of the engine than I am?

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/4 "2014-03-11T02:14:28Z")

</div>

I don’t think so. Using the most recent Rocket beta I see that variable there and to be certain you could create a blueprint that inherits from player controller and see if it has the Enable Click Events property in its defaults.

Does it not compile if you put bEnableClickEvents = true; in the constructor of your game’s player controller class?

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/5 "2014-03-11T02:14:29Z")

</div>

That’s correct; it has no idea what that variable is and it does not compile if I add that line.

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/6 "2014-03-11T02:14:29Z")

</div>

Never mind; fixed now. My mistake.

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/7 "2014-03-11T02:14:30Z")

</div>

Dear Paul,

I am not sure what version you are using,

But in my version, the latest and only version I have, Marc Audy’s information is correct:

**On line 172 of playercontroller.h**

```
// Whether actor/component click and touch events should be generated
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=MouseInterface)
uint32 bEnableClickEvents:1;

```

Good luck!

Rama

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/8 "2014-03-11T02:14:30Z")

</div>

Thanks, Rama – That did the trick. I’d been looking in the wrong place for this, and I’d set up my Find in Files dialog wrong so it wasn’t finding it. Derp 😉

---

<div class="post-metadata">

**Author:** ![ue4-archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ue4-archive](https://forums.unrealengine.com/u/ue4-archive)\
**Post date:** [March 11, 2014, 2:14am UTC](https://forums.unrealengine.com/t/receiving-click-messages/275364/9 "2014-03-11T02:14:30Z")

</div>

Yay! Glad you got it all figured out 🙂
