# I want to make an interface that calls some functions whenever a derived class created.

**URL:** <https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835>\
**Category:** Programming & Scripting\
**Tags:** interface, unreal-engine, CPP, Blueprint, question\
**Created:** [November 20, 2025, 11:49am UTC](https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835 "2025-11-20T11:49:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![E\_Hamza\_MB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@E\_Hamza\_MB](https://forums.unrealengine.com/u/E_Hamza_MB)\
**Post date:** [November 20, 2025, 11:49am UTC](https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835/1 "2025-11-20T11:49:14Z")

</div>

I want to design an interface in Unreal Engine. It is important for me to have immediate access to the functions implemented by this interface. What I want is for every class that implements this interface to automatically register itself into a list. For now, I’m handling this using Register/Remove functions. However, someone might forget to call Register/Remove, which can lead to unexpected behavior or crashes. Because of this, I want to automate these Register/Remove functions. How can I do that?

- I tried using TObjectIterator, but I don’t want to iterate over all objects.

- My interface can be inherited in Blueprint as well, so that also needs to be considered.

```auto
UINTERFACE(Blueprintable)
class UTestInterface : public UInterface
{
    GENERATED_BODY()
};

class SomeClassForStatics
{
public:
    static TArray<TScriptInterface<UTestInterface>> ObjectList;
};

class ITestInterface
{
    GENERATED_BODY()
public:
    void RegisterObject(const TScriptInterface<UTestInterface>& Interface) const
    {
       SomeClassForStatics::ObjectList.Add(Interface);
    }
    void RemoveObject(const TScriptInterface<UTestInterface>& Interface) const
    {
       SomeClassForStatics::ObjectList.Remove(Interface);
    }
};

```

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [November 20, 2025, 2:39pm UTC](https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835/2 "2025-11-20T14:39:49Z")

</div>

you could bind to a world delegate like FWorldDelegates::OnActorSpawned and check if it implements interface?

---

<div class="post-metadata">

**Author:** ![E\_Hamza\_MB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@E\_Hamza\_MB](https://forums.unrealengine.com/u/E_Hamza_MB)\
**Post date:** [November 20, 2025, 6:40pm UTC](https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835/3 "2025-11-20T18:40:11Z")

</div>

Thanks for the answer. The interface won’t be used only by Actors — other UObjects in the system will also use it. I could control the Actors through a delegate as you suggested, but UObjects make up almost half of the classes implementing this interface. Therefore, I don’t think that approach will be sufficient.

---

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [November 21, 2025, 1:17am UTC](https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835/4 "2025-11-21T01:17:44Z")

</div>

i’d recommend using inheritance instead of “interfaces”. they are 90% of the times more suitable. and you can add that auto behavior using them.

interfaces on ue are a form of inheritance too iirc.

though if you go so low level as to use it for uobjects or actors then it could be a mess.

another alternative is using a subsystem to spawn them. or have a static function in a bpfl. akin to a factory.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [November 21, 2025, 4:00am UTC](https://forums.unrealengine.com/t/i-want-to-make-an-interface-that-calls-some-functions-whenever-a-derived-class-created/2676835/5 "2025-11-21T04:00:59Z")

</div>

there is also FCoreUObjectDelegates::OnObjectConstructed
