[4.25] Have Pawns inherit from an enriched Actor class

Hello everyone,

I’ve been trying to expose the Gameplay Tag Asset Interface in all my actors’ blueprints since I’m not a C++ developer, and I’m almost there but turns out there’s a final boss of a problem that I can’t seem to solve.

WHAT I’VE ALREADY DONE :

  1. I followed this very helpful comment and created a C++ class called “ActorEnriched” and added these tidbits in ActorEnriched.h :
#include "GameplayTagAssetInterface.h"
class AFooCharacter : public ACharacter, public IGameplayTagAssetInterface

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GameplayTags")
FGameplayTagContainer GameplayTags;

virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override { TagContainer = GameplayTags; return; }

Also this in my build.cs:

PublicDependencyModuleNames.AddRange(new string]{ "Core", ....,  "**GameplayTags**" });
  1. I followed this excellent tutorial in order to “CoreRedirect” all my actor class references to the new “ActorEnriched” class by adding this in DefaultEngine.ini :
[CoreRedirects]
+ClassRedirects=(OldName="/Script/Engine.SkeletalMeshActor",NewName="/Script/MyProject.MySkeletalMeshActor",InstanceOnly=false)

RESULT :
it does work for all my actors which directly inherit from the “Actor” class, they now all inherit from my “ActorEnriched” class. Hence I could see the gameplay tags were exposed, and I was thrilled.

PROBLEM :
it did not change anything for my Pawns, nor my StaticMeshActors, etc… basically anything that doesn’t have as a direct parent “Actor” has not been impacted. They don’t have the Gameplay tags exposed. I hoped they would because after all Pawns inherit from Actors, but they still reference the “old” Actor class apparently nothing was redirected there.

I guess I could create a “PawnEnriched” class, a “StaticMeshActorEnriched” class, etc, and add new redirectors, but that sounds like it wouldn’t be clean.
I guess I could directly modify the engine Actor class but that sounds dangerous and not good practice (unless it is?)

QUESTION :
is there a clean way I could make my Pawn (or StaticMeshActor, etc) inherit from “ActorEnriched” instead of the default Actor class ?

Thanks in advance for your help ! If it ends up being too much of an ordeal I’ll probably revert back all my changes and either use a dumbed down version of gameplay tags (using Blueprint interfaces) or drop it altogether since my project is already well advanced and worked fine before.

Welp, I ended abandoning that idea since it would have just been a “nice to have” feature in my case and I couldn’t find any way to have it working without taking the risk of breaking fundamental things. Too bad, but let’s move on!