![]() ![]() Client starts in scene 0 and when connection is made, it loads scene 1, so no RPCs or anything will fire before a connection is made. I have stubs for the RPCs on the server as well. Seems like a problem because of different SceneIDs? Server is on Scene 0 and client on Scene 1, but it worked before. In the player script Awake () function, I create a NetworkView object, and attach it to the player object dynamically for synchronization. ![]() Received RPC 'UpdatePlayer'- mode 1 - sender 127.0.0.1:1299Ĭould't invoke RPC function 'UpdatePlayer' because the networkView 'SceneID: 2 Level Prefix: 0' doesn't exist When a client connects to the server, the server uses RPC calls to create the player objects on all of the clients. Strange behaviour may occurĬould't invoke RPC function 'SpawnPlayer' because the networkView 'SceneID: 2 Level Prefix: 0' doesn't exist View ID SceneID: 2 Level Prefix: 0 not found during lookup. New scope index 0 is now in scope for SceneID: 1 Level Prefix: 0Īllocated 2 batches of size 50 for player 1 When i thought i started to get a grip on this multiplayer thing, it stopped working again : / A prefab with a NetworkView won't get assigned anything if you just locally Instantiate it this is why Network.Instantiate exists. I'll note here that for NetworkViews already in the scene the Server will always be the owner.Ī third problem I came across in your code is you don't allocate NetworkViewIDs. The Network.isMine bug is a little weirder, the only thing that comes to mind is that unless the server's already initiated, it will always return false but from what I understand this script gets called after you already start a server, so.I don't get it. Took me a good week to figure this out, and I believe someone else on the forum helped) (This is terrible documentation on Unity's part, don't fret yourself too much over it. You'll have to send a NetworkPlayer variable yourself if you want an RPC to come back your way if you're a client. This is why the RPCs are not reaching the intended client. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers. I can't say exactly why the RPC won't reach back to the client if the server receives it, but if I remember correctly (EDIT: just tested, it is indeed), nder gives you where the message came from, this means that since all RPCs are routed through the server, on any given client nder will always give you 0 (the server). get return on networkView.RPC - Unity Answers Unity is the ultimate game development platform. ![]()
0 Comments
Leave a Reply. |