I think I’m improperly using a reference to the player character inside the player state to replicate character customization.
In the player character BP I created material instances.
I created an actor component, named it character customization, and added it to my player state BP.
In the character customization component I added a replicated reference to the player character, and rep notified colors.
In the player controller on possession I get the player character and set the player character reference in the character customization component.
When the player spawns colors are pulled from the saved game and set on the server in the character customization component.
On rep for each color I get the character reference, the appropriate material instance, and change the color.
Everything works great until I spawn in the host, run far away, and then spawn in the client. The host’s custom colors never show, even if the client runs over to the host.
I tried setting the character BP to always relevant just to test culling and that didn’t help. I checked the validity of the character ref in the character customization component, and that is returning false for the host when the client spawns far from the host, but true when the client spawns near the host.
So it still seems like a culling distance issue, but maybe it’s actually a timing issue? Is there a better way to reference the character from the player state? Or is there a better way to reference and change the color of the material instances following the rep notify of the custom colors?