Download

Character Blueprints, Pawn and player controllers?

Hello forums!
I’m new to unreal engine and I’m no programmer so I figured I’d make a post here on the forums to see if someone could help me out understand UE and where I wan’t to go.

My game is a third person game, I would like there to be different classes(by classes I mean a rogue, a mage, a warrior etc.) and somewhere down the line I want there to be a character creation screen where you can customize your character like adding a mustache or changing the gender. Now where I’m at right now I put everything in the character blueprint cause that’s what the tutorial I first followed did, but then I heard on another tutorial, this way might not be the best fit for me?
If all my characters have the ability to move forward and backwards, turn when I rotate my mouse and jump when I press space, should it be in a Player Controller?
If I have three different characters with a set of different abilities and animations, would I make three different character blueprints but share the same controller?

I am a total noob, and I’m probably overthinking everything when I should just be having fun making stuff, but I’m super confused and I could really use some help from someone to clear things up a little for me.

Thanks in advance!

Hi,

Yes, you are right, for movement input, in my opinion, your best choice is the Player Controller. I would probably create the input handling in the PC then implement the actual movement on the characters. Interfaces are really handy for this, here is a link about them: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/

For stuff that is really unique to each of your characters, you can use your character blueprint, but for example if all your characters can ‘Cast Spell’, but all in a different way, creating a ‘Cast Spell’ interface function then implementing it on each character is an option I would consider.

You are not overthinking it, it is good to think ahead and consider different approaches and solutions :slight_smile:

I hope this helps you a bit.

Corrected.

That isn’t correct, when you change a level, the Player Controller will be reinitailized as well. Game Instance is the only class that will keep its values when a new level is loaded, because it gets created when the game starts and only gets destroyed upon exit. I think what you mean is the possible data loss on the character/pawn Blueprint when the character dies. The Player Controller will not change, but when you respawn your charater and destroy your previous one, a new character will be created, therefor all the values in that class will be set to default. PlayerState or GameState could be a great alternative for money/score, in fact the documentation suggests this approach as well.

You are correct. Respawn it won’t reset, new level/map it will. And I agree, PlayerState or GameState is the best place for these.