Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

need a help iam new deplove games

Discussion in 'Multiplayer' started by TheGhost0, May 5, 2019.

  1. TheGhost0

    TheGhost0

    Joined:
    Sep 11, 2017
    Posts:
    29
    some one send me source code to fix it but iam new to deplove it

    i want some help here please

    Code (CSharp):
    1. public void AddLog (string text)
    2.     {
    3.         if ([COLOR=#ff0000]Network.isClient[/COLOR] || [COLOR=#ff0000]Network.isServer[/COLOR]) {
    4.             if (GetComponent<[COLOR=#ff0000]NetworkView[/COLOR]>())
    5.                 GetComponent<[COLOR=#ff0000]NetworkView[/COLOR]>().RPC ("SendChatMessage", [COLOR=#ff0000]RPCMode[/COLOR].[COLOR=#ff0000]All[/COLOR], text);
    6.         }
    7.    
    8.     }
    9.  
    10.     [COLOR=#ff0000][RPC][/COLOR]
    how i fix it please
     
  2. TheGhost0

    TheGhost0

    Joined:
    Sep 11, 2017
    Posts:
    29
  3. TheGhost0

    TheGhost0

    Joined:
    Sep 11, 2017
    Posts:
    29
    teach me to fix this error
     
  4. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Where to start...

    It looks like you're using unet which is deprecated and therefore should not be used. Perhaps moving to Mirror networking would be best.
     
  5. TheGhost0

    TheGhost0

    Joined:
    Sep 11, 2017
    Posts:
    29
    can you teach me and fix this source code using team view ??
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It is worse than that. NetworkView is from the legacy networking based on Raknet. The one Unet replaced.

    NetworkView is no longer a part of the most recent versions of Unity. It was deprecated several years ago. So long ago that the network solution which replaced it has also been deprecated a year ago as well.
    https://docs.unity3d.com/ScriptReference/NetworkView.html

    Since Unity's next network API is not yet ready, the solution is to choose a 3rd party networking library and switch to that. How to actually code the fix depends entirely on which networking API you choose - see its documentation.
     
    Whippets likes this.
  7. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    I also wouldn't be using team view for anything.
     
    Joe-Censored likes this.