So I want to make a score system based on collectables, that mean when any of my character collect the object, it is added to the “coins number” counter.
I want to put that in a UI, but then when I change of pawn, the score is not the same.
if player 1 collect 10 coins, it wrote 10 on my HUD, it’s normal.
but when I change to player 2, the coins counter is still at 0.
I want to make a counter in link with every character.
is that with the player state blueprint class ?
You can store scores in any class you want but if you put it in the pawn, you lose the info every time the pawn is destroyed.
Player State is probably the best place to put it for an individual player.
If you want the players to share the same score it can go in the game state.
If you need to, you can make your own classes for any purpose too. Just remember, Actors are destroyed when you switch to another level, but Objects can persist.
But I prefer player state for individual players’ information that must persist between pawn deaths or unpossessions, and game state for information that must be shared between players,
and Game Instance for information that must persist between levels.