# Calling a method on blueprint actor from plugin in c++

**URL:** <https://forums.unrealengine.com/t/calling-a-method-on-blueprint-actor-from-plugin-in-c/135461>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [December 24, 2019, 10:05am UTC](https://forums.unrealengine.com/t/calling-a-method-on-blueprint-actor-from-plugin-in-c/135461 "2019-12-24T10:05:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnasIqbal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AnasIqbal](https://forums.unrealengine.com/u/AnasIqbal)\
**Post date:** [December 24, 2019, 10:05am UTC](https://forums.unrealengine.com/t/calling-a-method-on-blueprint-actor-from-plugin-in-c/135461/1 "2019-12-24T10:05:19Z")

</div>

I have created a plugin using Slate/ C++ and would like to call a method on a blueprint (not necessarily and Actor class). As I am building a plugin, everything needs to happen in editor mode without ever running the game.

My Setup:

- **SBlocksWindow** inherits from **SCompoundWidget**
- **ABlocksBuilderActor** inherits from **AActor**
- **ABlockBuilder\_BP** based on **ABlockBuilderActor**

In my **SBlockWindow** , I created a reference for **ABlockBuilderActor** as:

```auto

ABlockBuilderActor* blockBuilder;

```

In my UI I have a **SComboBox** which I use to select the actors available in the Level and use **TActorIterator** to populate it.

```auto

for (TActorIterator<ABlockBuilderActor> ActorItr(World); ActorItr; ++ActorItr) {
    // Add a menu item for all available ABlockBuilderActor in the level editor
    ...
}

```

Now inside my **ABlockBuilderActor** , I have a function named **StartBuildingBlocks** with **BlueprintImplementableEvent** tag

```auto

UFUNCTION(BlueprintImplementableEvent)
        void StartBuildingBlocks();

```

This function is implemented in the Blueprint. And at some point inside my **SBlockWindow** , I call this function

```auto

...
blockBuilder->StartBuildingBlocks();
...

```

PROBLEM:  
**StartBuildingBlocks()** function is never called.

WHAT I TRIED:

- I tried calling different functions that are only implemented in c++ inside **ABlockBuilderActor** and they all work fine. Confirmed by logs.
- Tried adding other tags to the function as **BlueprintCallable** and **BlueprintNativeEvent**

WHAT I THINK MIGHT BE THE ISSUE:

- The reference I get from **TActorIterator** only returns the reference to the base class but I am not sure. when printing **GetName()** output the name for the blueprint in the level editor is logged.
- Cannot call blueprint functions in editor mode. But then you can create a function with the ‘Call In Editor’ option.

For a specific task (Render Material to Render Target), I need to use blueprints but they don’t necessarily need to be of type AActor. So if there is a suggestion for an alternate setup I am open to it. What am I doing wrong?
