How can I get my custom vehicle class to inherit from my custom pawn?

How can I get my custom vehicle class to inherit from my custom pawn? My vehicle inherits the UE4 vehicle class which inherits from pawn, but I want my custom vehicle to inherit from my custom pawn somehow. Is this possible without changing engine code?

Are you trying to get properties from both your custom pawn and Wheeled Vehicle? Or do you simply want to change the parent to the pawn? If it’s the latter, you can simply reparent your custom vehicle. Go to your custom vehicle’s blueprint, click Class Settings, then select your custom pawn to be it’s Parent Class.

If you want it to have properties of both, you can’t inherit from two separate things at once. Either you’ll want to make your custom pawn inherit from Wheeled Vehicle, and then have your custom vehicle inherit from your custom pawn, OR move the functionality that you need from your custom pawn into a component so that you can add it to anything, anywhere in the parent tree.

Well my character and the vehicle can interact with things.

They both have an interaction collision capsule on them that will do logic if it overlaps an actor with an intractable component on it.

I’m trying to make it so the vehicle can inherit from my pawn class (which the character inherits from) and the interaction capsule can live in the custom pawn class.

Both the engine vehicle and character class inherits Pawn.
I want them to both inherit my custom pawn class without editing the engine

I dont think this is possible, but im curious if theres any secret engine macros im not aware of that can do it.

Inheriting from multiple parent chains isn’t possible in Unreal. I would suggest making the interaction capsule an “Interactor” component, which you then add to both your vehicle and custom pawn.You can have the component inherit from Capsule Collider, then put your functionality into it. That would give them both the same functionality without code duplication

I like that idea dachora1. That should work the way i want. Thx

Something to note, I can only get a c++ class to inherit from UCapsuleComponent. I cant make a custom component in blueprints that inherits UCapsuleComponent.