Multiple characters/AbilitySystemComponent in Multiplayer

Hi, have you created several AbilitySystemComponents in the PlayerState’s constructor? Or does the PlayerState have a mapping of AbilitySystemComponents for each character type? Both?

I recommend creating one ASC in the PlayerState and then refresh/grant abilities based on the character that’s possessed. With this approach, attribute values will persist on the PlayerState across characters.

If you want to, you can modify attributes by applying effects to different character types eg. you possess a new character who moves much faster so you could set their speed to be higher. A character’s default stats could use a GameplayEffect class which you apply in the PossessedBy() function.

Have you implemented the IAbilitySystemInterface as well? Your PlayerState and each character will need to implement this interface and the GetAbilitySystemComponent() function.

virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;

The PlayerState grabs the ASC attached directly to it while the characters point to the ASC on the PlayerState (assign in a character’s PossessedBy() function).

Consider having a parent character class that handles a lot of the initial set up eg. when any character is possessed, grant default abilities and effects. You could create child classes in editor where you can modify what abilities and effects are granted on a per character basis.