# Interface Error

**URL:** <https://forums.unrealengine.com/t/interface-error/2404563>\
**Category:** C++\
**Tags:** interface, unreal-engine, CPP, question\
**Created:** [March 21, 2025, 10:38am UTC](https://forums.unrealengine.com/t/interface-error/2404563 "2025-03-21T10:38:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [March 21, 2025, 10:38am UTC](https://forums.unrealengine.com/t/interface-error/2404563/1 "2025-03-21T10:38:21Z")

</div>

Hi!

When trying to build the project the following error pops up:

```bash
PlayerInterface.gen.cpp(106): Error C2511 : void IPlayerInterface::Equip(USkeletalMesh *,EEquipmentID,const TArray<UMaterialInterface *,FDefaultAllocator> &): overloaded member function not found in "IPlayerInterface"

```

```C++
UINTERFACE(MinimalAPI, Blueprintable)
class UPlayerInterface : public UInterface
{
	GENERATED_BODY()
};
class ODWIRKSRPG_API IPlayerInterface
{
	GENERATED_BODY()

public:
        UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="PlayerInterface | Equipment")
	void Equip(USkeletalMesh* EquipmentMesh, TEnumAsByte<EEquipmentID> EquipmentID,
	const TArray<UMaterialInterface*>& EquipmentMeshMaterials);
};

```

this is how I call it:

```C++
void AWearable::OnInteract(AMainCharacter* PlayerCharacter)
{
	Super::OnInteract(PlayerCharacter);

	if (IPlayerInterface* PlayerInterface = Cast<IPlayerInterface>(PlayerCharacter))
	{
		TArray<UMaterialInterface*> Materials = ItemMeshComponent->GetMaterials();
		PlayerInterface->Execute_Equip(
			PlayerCharacter,
			ItemMeshComponent->GetSkeletalMeshAsset(),
			EquipmentID, 
			Materials);
	}
}

```

What’s wrong ???

Thx.

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [March 21, 2025, 12:45pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/2 "2025-03-21T12:45:48Z")

</div>

I think the way you’re implementing the interface might need adjusting. I’m assuming you want to use this in blueprint too but C++ has no grantees you will do that so it needs the interface function implemented natively too.

Your UFUNCTION should be like this using the **BlueprintNativeEvent** instead.

`UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="PlayerInterface | Equipment")`

In your character header you need to implement the interface using **\_Implementation.** You still have the ability to override your interface in blueprint.

```auto
void Equip_Implementation(USkeletalMesh* EquipmentMesh, TEnumAsByte<EEquipmentID> EquipmentID,
 	const TArray<UMaterialInterface*>& EquipmentMeshMaterials) override;

```

You can either implement the function in C++ or if it’s purely for blueprint you can do it in header by ending it with empty { }

For using the interface I usually go with this

```auto
if (PlayerCharacter->Implements<UPlayerInterface >())
{
	IPlayerInterface::Execute_Equip(PlayerCharacter, ...);
}

```

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [March 21, 2025, 3:40pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/3 "2025-03-21T15:40:38Z")

</div>

```C++
//PlayerInterface.h
public:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="PlayerInterface | Equipment")
	void Equip(USkeletalMesh* EquipmentMesh, TEnumAsByte<EEquipmentID> EquipmentID,
	const TArray<UMaterialInterface*>& EquipmentMeshMaterials);

```

```C++
//MainCharacter.h
public:
virtual void Equip_Implementation(USkeletalMesh* EquipmentMesh, TEnumAsByte<EEquipmentID> EquipmentID, const TArray<UMaterialInterface*>& EquipmentMeshMaterials) override;
//MainCharacter.cpp
void AMainCharacter::Equip_Implementation(USkeletalMesh* EquipmentMesh, TEnumAsByte<EEquipmentID> EquipmentID,
	const TArray<UMaterialInterface*>& EquipmentMeshMaterials)
{
	IPlayerInterface::Equip_Implementation(EquipmentMesh, EquipmentID, EquipmentMeshMaterials);
}

```

```C++
...
if (PlayerCharacter->Implements<UPlayerInterface >())
	{
		IPlayerInterface::Execute_Equip(
			PlayerCharacter, 
			ItemMeshComponent->GetSkeletalMeshAsset(),
			EquipmentID,
			ItemMeshComponent->GetMaterials()
		);
	}
...

```

Console Logs:

```bash
11>MainCharacter.h(167): Error C3668 : AMainCharacter::Equip_Implementation: method with override specifier ‘override’ does not override any base class methods

11>MainCharacter.h(167): Warning C4263 : void AMainCharacter::Equip_Implementation(USkeletalMesh *,TEnumAsByte<EEquipmentID>,const TArray<UMaterialInterface *,FDefaultAllocator> &): member function does not override any virtual member function of the base class

11>MainCharacter.h(253): Warning C4264 : void IPlayerInterface::Equip_Implementation(USkeletalMesh *,EEquipmentID,const TArray<UMaterialInterface *,FDefaultAllocator> &): no available override for virtual member function from base class ‘IPlayerInterface’; function hidden

```

😀 😃 😄 😁 😆 😅 🤣 😂

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [March 21, 2025, 7:08pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/4 "2025-03-21T19:08:09Z")

</div>

Do you have the interface added to your character class ? For example at the end of this

```cpp
class AMainCharacter : public ACharacter, public IPlayerInterface

```

Also for your MainCharacter.cpp that’s where you handle equipping you don’t wanna call the same interface

```cpp
//MainCharacter.cpp
void AMainCharacter::Equip_Implementation(USkeletalMesh* EquipmentMesh, TEnumAsByte<EEquipmentID> EquipmentID,
	const TArray<UMaterialInterface*>& EquipmentMeshMaterials)
{
	GetMesh()->.. //for example
}

```

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [March 21, 2025, 7:23pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/5 "2025-03-21T19:23:52Z")

</div>

> [@KaidoomDev](#):
>
> Do you have the interface added to your character class ? For example at the end of this

```C++
class ODWIRKSRPG_API AMainCharacter : public ACharacter, public ISaveableInterface, public IPlayerInterface

```

The problem is that I don’t want to have an interface implementation in C++, but only in Blueprint

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [March 21, 2025, 7:55pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/6 "2025-03-21T19:55:14Z")

</div>

Gotcha. So tried doing the same thing and it seems like the EEquipmentID enum is creating some problem because without it the C++ compiles just fine even if no implementation exists. It also compiles fine if we don’t use the TEnumAsByte.

This works fine just doing EEquipmentID EquipmentID instead of TEnumAsByte, test it and see if your blueprint is able to set it just fine.

```cpp
 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="PlayerInterface | Equipment")
	void Equip(class USkeletalMesh* EquipmentMesh, EEquipmentID EquipmentID, const TArray<UMaterialInterface*>& EquipmentMeshMaterials);

```

Also you can go back to your original code since the issue is not what I thought. BlueprintNativeEvent is needed in this case.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [March 21, 2025, 8:24pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/7 "2025-03-21T20:24:38Z")

</div>

Thank you so much. ❤️‍🔥  
I don’t know why I haven’t stopped using regular enums. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 20, 2025, 8:24pm UTC](https://forums.unrealengine.com/t/interface-error/2404563/8 "2025-04-20T20:24:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
