Rpc command for Game Start?

I was using the GameOver handler process for RPC I want to call on Client. In this case, I was trying to call Rpc during the ServerOnBaseSpawned event.
The function was not firing, and googling the problem revealed, that Mirror have to finish a lot of stuff before it can execute RPC’s. I’ve added 3 seconds delayed and it worked.

Now I am wondering what is the correct way of doing this? E.g. showing the screen message to all clients once the game fully functional in the map scene

Hi there, interesting question.

My first thought is maybe to trigger the message using an event or coroutine. If you have added a delay then you may have already used a coroutine. Coroutines run in parallel to the main code/script thread, so you might be able to us this to trigger something regardless of where the scene is up to.

What was not working with the ServerOnBaseSpawned event? Was the event not firing or the function wasn’t subscribed to it yet? Curious where it went wrong, as that might help find a solution.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms