# Call Blueprint interface implementation for base class from child class

**URL:** <https://forums.unrealengine.com/t/call-blueprint-interface-implementation-for-base-class-from-child-class/426838>\
**Category:** XR Development\
**Tags:** interface, unreal-engine, implementation, Blueprint, CPP, question\
**Created:** [June 6, 2018, 10:50pm UTC](https://forums.unrealengine.com/t/call-blueprint-interface-implementation-for-base-class-from-child-class/426838 "2018-06-06T22:50:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarkVoid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarkVoid](https://forums.unrealengine.com/u/DarkVoid)\
**Post date:** [June 6, 2018, 10:50pm UTC](https://forums.unrealengine.com/t/call-blueprint-interface-implementation-for-base-class-from-child-class/426838/1 "2018-06-06T22:50:45Z")

</div>

Hello, comrades!

Sorry for my english, but i’ll try to explain what i want to do.  
So, i have inteface in C++:

```
#pragma once

#include "Interface.h"
#include "IPickupItem.generated.h"

UINTERFACE(Blueprintable)
class MYGAME_API UPickupItem : public UInterface
{
	GENERATED_BODY()
};

class MYGAME_API IPickupItem
{
	GENERATED_BODY()

public: // this methods must be implemented only through Blueprints
	UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "My|InterfaceMethods")
		void PickupItem(USceneComponent* AttachTo); 

	UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "My|InterfaceMethods")
		void DropItem();
};

```

C++ class, which inherits from interface:

```
#include "IPickupItem.h" // my interface
    #include "ItemBase.generated.h"
    
    UCLASS()
    class MYGAME_API AItemBase : public AActor, public IPickupItem
    {
	GENERATED_BODY()
public:
	AItemBase(); .... // (some other stuff, methods, members, etc. don't really matters)
    // BUT! I don't have any overload or overrides of interface methods!
protected:
UPROPERTY(Category = "My|Basic", EditAnywhere, BlueprintReadWrite)
		UMeshComponent* itemMesh; // will be inited in child class!
    }

```

And i have child class of game item, for example:

```
#pragma once

#include "CoreMinimal.h"
#include "ItemBase.h"
#include "StaticItemBase.generated.h"

UCLASS()
class MYGAME_API AStaticItemBase : public AItemBase
{
	GENERATED_BODY()
public: 
	AStaticItemBase(); // initializes itemMesh from AItemBase with StaticMeshComponent
	UFUNCTION(BlueprintCallable, Category = "My|Methods")
	UStaticMeshComponent* GetStaticMesh(); // returns itemMesh' pointer
protected:	
};

```

Then i’am creating a Blueprint from my AItemBase (ItemBase\_BP) class and another one - from AStaticItemBase (StaticItemBase\_BP). Some instances of StaticItemBase\_BP are placed to game map to interract with.  
What was my idea: in ItemBase\_BP i make implementation of interface methods PickupItem() and DropItem(), that will be called from MotionController BP (standart from VR-sample) using interface call when i’am trying to pick up an object StaticItemBase\_BP with motion controller.

All checks like “is overlapping objects implements my interface” are correct and works fine.

Problem is, that execution never comes to ItemBase\_BP event PickupItem()/DropItem() for StaticItemBase\_BP objects. I think that’s because they (objects) are not directly inherited from ItemBase\_BP.

ItemBase\_BP is inherited from AItemBase C++ class (and C++ interface), StaticItemBase\_BP is inherited from AStaticItemBase C++ class (which is inherited from AItemBase C++ class =)).

Please, can someone explain me, how this can be solved? I mean, is there any way to call Blueprint implementation of base class interface function for ALL child objects, which are inherited from that base class?

Thank you!  
Alex
