V
V
Vasily Vorobyov2015-09-23 12:02:01
Unity
Vasily Vorobyov, 2015-09-23 12:02:01

How to transfer a multiplayer project from Unity 4.x to Unity 5.x?

Good afternoon
I have a project that I wrote on unity 4.5 and which used such a thing as uLink. Who does not know - a library for creating multiplayer games. For example, the ClientMessenger class has a method:

[RPC]
  void SuccessfulLogin()
  {
    GUIController.Controller.LoggedInOnGUI();
  }

This means that this method can be called from the server with the line
networkView.RPC("SuccessfulLogin", uLink.RPCMode.Owner);

After I opened the project in unity 5.1, everything seemed to work, but an error appeared
Assets/Scripts/Client/ClientMessenger.cs(50,10): warning CS0618: `UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'
Assets/Scripts/Client/ClientMessenger.cs(56,10): warning CS0618: `UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'
Assets/Scripts/Client/ClientMessenger.cs(61,10): warning CS0618: `UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'
Assets/Scripts/Client/ClientMessenger.cs(66,10): warning CS0618: `UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'
Assets/Scripts/Client/ClientMessenger.cs(81,10): warning CS0618: `UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'
Assets/Scripts/Client/ClientMessenger.cs(86,10): warning CS0618: `UnityEngine.RPC' is obsolete: `NetworkView RPC functions are deprecated. Refer to the new Multiplayer Networking system.'

What should RPC methods look like now?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2015-09-23
@zuberok

I'm afraid that you won't be able to simply replace one attribute with another, the new network library is essentially written from scratch. Judging by this page , you are out of luck with uLink, it has been abandoned, so either you can read the manual and try to update it, or look for another plugin.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question