Where and how do i store shared functions and variables, that 2 classes use (Playercontroller and AIController)?

So i have a player controller and AI controller. They both share functions and member variables. How do i do this in UE4 c++? Interfaces? Inheritance?, … ?
Please tell me how.

Hey,

Depending on what you need,

  • withing a struct if simple methods/variables

  • in a component ( Controller are actors ) if you need UObject features ( delegates & things like this )

c++ multi Inheritanceis not possible in UE

What the hell i tried the exact same thing (using UActorComponent) and now it works and it did not before.

programming is kinda like dark magic sometimes…
But if it work now, it’s all good !