PlayerController vs Character: Are the Template projects actually doing it wrong?

Ok. Let’s repeate, analogy that has been used many times here. Controller is brain and character is body.

Assuming we live in Dune World, you could take brain out of your body and implant it into any other body, and each body would have different functionality, but you would still interface with that body using your brain.

The rule of thumb is, if you need some control (input) options available on global level to player, you should put them in Player Controller.

If some input is specific only to the specific character, you might want to put it inside Character class.

I personally tend to do most of my input stuff inside Player Controller, and from there route it currently controlled pawn (note Pawn not character). To make most out of it, you must abstract what are you controlling into interfaces/components which are easy to reuse in many actors.

For example I devised that all weapon need is simple interface which have functions responsible for input, and every actor implementing this interface could be called.

In my player controller i check if actor have this interface (when player press fire button). Controller doesn’t care which pawn in control, as long as weapon, which pawn holds, implement this interface.

1 Like