How to know when a BoltEntity has received initial state data on spawn on client

In UNET I would use OnStartClient, that method is called when an object is spawned and has all of it's state data available. How can I do the same in Bolt? At the moment, in Attached I start a coroutine and wait until certain properties do not have their default values. Is there a better way I can handle this? It's really bizarre to me that Bolt seems to have no concept of knowing if you've gotten your initial state data yet or not.

I'm aware of tokens, but it won't work for my needs since my initial data can also change, it's both initialization and state data. Plus tokens go against some of the concepts of Bolt: not having to write serialization/deserialization code.

Comments

  • It's a downfall of bolt in many users' opinions that there is no way to know when all of the initial state values have been replicated. I would set the priority of everything higher than 0, and have another state value boolean with priority 0, and once that boolean was updated say that hey i got the data I needed and I'm ready. Other idea I tried was just waiting like .5 seconds after Attached callback. Last great idea I had was, yeah, I used a token to send a lot of the initial data that's important (race, class, name, level, etc.) and just once the state update hits, update the player. Sure there might be a 'blip' while things are updated, but I wait like .5 seconds for other players to be able to view a new arrival so blips don't happen often.
  • I actually had the same idea with the bool approach. My only problem is there were still rare times that the bool was set on the client before other state data had arrived. So my coroutine that waits until that bool is set also looks for specific initialization data that needs to be set.