I am using GameObject.Instantiate to spawn player which has CoherenceSync component. And I want to store the network players in a Dictionary with their CoherenceSync. Is there any event that fires up when other clients Instantiate.
Hello, we have a system for this called ClientConnections: Client Connections | coherence Documentation
They can be used for exactly what you’re describing.
Hey! To add to Brit’s reply, we also have a Package Sample demonstrating how to implement exactly this, using Client Connections to keep track of the spawn points assigned to each player in a dictionary.
You can find it if you go to coherence > Explore Samples, and import the Sample Scenes.
Scene 7_PlayerSpawner is the relevant one. You can check out the implementation in SpawnManager.cs
and tweak it as needed for your project.
Thank you for your reply
Thank you for the reply