Search Unity

Question NetworkTransfrom stopped handling character movement.

Discussion in 'Netcode for GameObjects' started by Balphagore, May 3, 2022.

  1. Balphagore

    Balphagore

    Joined:
    Jul 18, 2019
    Posts:
    82
    I decided to update my old project written using MLAPI and replaced it with Netcode for GameObjects. In general, after fixing the bugs, everything works as before, but now the character's movements are not transmitted to the server using NetworkTransform. I understand that he is now server-authority? If I want to pass the position of the client to the server now should I use RPC or NetworkVariable? Or is there some possibility that I didn't find?
     
  2. CosmoM

    CosmoM

    Joined:
    Oct 31, 2015
    Posts:
    204
    The easiest thing to do is to replace the NetworkTransform component by a ClientNetworkTransform, which works the same except that the authority is passed to the owner of the object rather than the server. It can be found here.
     
    tzdevil and Balphagore like this.
  3. Balphagore

    Balphagore

    Joined:
    Jul 18, 2019
    Posts:
    82
    Thanks, works great. By the way, I originally wanted to make an authoritarian server, I just didn’t bother with it, since it was the very first prototype. Maybe there are options for implementing character movement for an authoritarian server?