I want to get as fast as I can to the point, What I’m trying to to is a Semi-Authoritative Server for an online Life simulator.
I’ve been working on it for 3 days, And I managed to get good results. I can Spawn any player in any Map I have, and I can see other network players that spawns too.
The problem is: How to spawn players that logged before me? I can spawn players that logged after me, but they can’t still see me because they logged BEFORE me.
I actually found a semi-solution by using this system:
Spawn The player using ViewID-1
Maybe I’m not explaining myself too well, So I’m posting a part of the client-side script that SHOULD spawn correctly the players before me and then assign them a custom NetworkView.viewID:
Your initial problem will not be solved by generating your own view id’s. Unity handles it behind the scenes, so no reason to change this.
Your problem is that you are not buffering the RPC calls for joining clients.
At the end I managed to solve my problem using this simple System.
I added a RPC call to the client, that would tell the server to tell the client to spawn the players before, It’s a pretty dirty code, but it does work if you have your server set up like mine.
I’m also providing the code because I saw how much people had my same problem, and I truly want to help them.