C++ set Boolean retrieval from playerstate

I have a Boolean set in c++ to determine the character team is adds every other player to the opposite team. Now I’m trying to verify its working by retrieving the data in a blueprint. Currently read write for blueprint when I fetch it it looks like I get an accessed none in construction of the player and it’s always false.

Not sure if this makes sense.

What’s a good way to go about debugging this?

Player State does not exist in Construction Script. Can you please move that logic to BeginPlay and see if that helps. :slight_smile:

fyi the bool for team is meant to be a editable factor so one can change its state which will destroy thier actor as spawn them again with the new team attributes. Does the begin play fire everytime the actor is spawned and possessed?

BeginPlay is fired everytime the actor is spawned and you can use Event Possessed everytime it is possessed

Ok that said then the player controller or playerstate (better because it’s replicated?) can hold a variable that the game state can pull at the spawn of a new actor to use for its creation to say modify the actor, so say linear color. The begin play grabs it puts it on there then player possesses.

This did and didn’t work but another post made me realize the problem. Casti to my playerstate on begin play was happening to quickly. Cast was failing everytime. I added a delay to make sure playerstate was loaded and it all started to work, it get the bool result after .2 and then apply the linear color. Before everyone was spawning with out the applied linear color.

Thnx!