Download

UE4 and multiple inheritance

Hi there,

I started working on NonPlayerCharacters and originally planned to use multiple inheritance from 2 classes.

However it seems that UE4 support multiple inheritance only if one class is an interface.

Every actor the player can interact so far is inherited from it’s baseclass InteractiveActor. I planned to make an inheritance from BaseCharacter and InteractiveActor, since the interaction pipeline is currently designed to use the virtual functions of InteractiveActor and the raytrace hit is looking for an interactive actor as HitActor.

Could it work with setting up an UInterface to a class with NPC interactions inherited from Interactive Actor?..I would prefer to use the existing pipeline of InteractiveActor to handle talking, trading and pickpocket, since I don’t want to perform multiple raytraces per tick to check if the trace hit an InteractiveActor, a NPC or a creature.

I never used UInterface so far, so I’m not sure if it is the right way to go