Okay so I have been working on a hint system for our game for a while and I am at the end of having everything working. One issue I have now is that the clients can’t buy the hints in a predictable way.
I was trying to figure out a good place to store the number “hint charges” that players would find in the game. These would have to follow on level changes and stay synced and correct. My solution is to have the number of charges stored in the “ObjectivesTracker” blueprint and in the game instance. On begin play the BP syncs the number of charges from the servers game instance.
The reason why I did it like this is to be able to see the number of remaining hint charges in the widget.
I have a function inside the objective tracker that returns the hint when purchased and subtracts a charge from the local sum of charges and syncs it to the game instance.
This all works fine on the server but when the client buys a hint it does not get subtracted and the hint isn’t available to the server or any other client.
Both the sum of hint charges and the array are set to replicate.
Ive tried a lot of different things but nothing seems to solve this. Does anyone have any suggestions?