# Custom Component how to access AActor functions

**URL:** <https://forums.unrealengine.com/t/custom-component-how-to-access-aactor-functions/286602>\
**Category:** Community & Industry Discussion\
**Tags:** access, actor, unreal-engine, Components, question\
**Created:** [June 23, 2014, 6:50pm UTC](https://forums.unrealengine.com/t/custom-component-how-to-access-aactor-functions/286602 "2014-06-23T18:50:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sh0day](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sh0day](https://forums.unrealengine.com/u/sh0day)\
**Post date:** [June 24, 2014, 6:58pm UTC](https://forums.unrealengine.com/t/custom-component-how-to-access-aactor-functions/286602/2 "2014-06-24T18:58:20Z")

</div>

Each AActor has some events you can attach a callback function to. This function will be called when the event occurs.

Here you can find some more details about event handling/delegates:

> **[Delegates](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/Delegates/)**
>
> Data types that reference and execute member functions on C++ Objects

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

It boils down to adding a function to your component:

```
UFUNCTION()
void myBeginCursorOver(AActor* OtherActor);

```

and register it (in your constructor for example):

```
OnActorBeginOverlap.AddDynamic(this, &YourClass::myBeginCursorOver);

```

Don’t forget to activate mouse events in your PlayerController (bEnableMouseOverEvents = true)

---

_[View the full topic](https://forums.unrealengine.com/t/custom-component-how-to-access-aactor-functions/286602)._
