Search Unity

RemoveClientAuthority() still seems to be broken in 5.2.1

Discussion in 'Multiplayer' started by PHLCollective, Oct 5, 2015.

  1. PHLCollective

    PHLCollective

    Joined:
    Jun 27, 2014
    Posts:
    59
    My scenario is I want a player to be able to enter a vehicle, enabling client control over it, then exit it, freeing it up for use by other clients. Pretty straightforward.

    Everything works great up until a CLIENT wants to EXIT a vehicle. The client sends a command to the server to RemoveClientAuthority() but something seems to go wrong. While the host can now enter the vehicle, his motions are not reflected on the client's view, and when he gets out, the vehicle "snaps" back to the position it was in when he got in. The vehicle has a NetworkTransform component, set to RigidBody3D.

    Here are my two very simple functions:

    Code (CSharp):
    1. [SyncVar] private GameObject currentVehicle;
    2.  
    3. [Command]
    4. void CmdEnterVehicle(GameObject vehicle)
    5. {
    6.     currentVehicle = vehicle;
    7.     vehicle.GetComponent<NetworkIdentity>().AssignClientAuthority(connectionToClient);
    8. }
    9.  
    10. [Command]
    11. void CmdExitVehicle(GameObject vehicle)
    12. {
    13.     vehicle.GetComponent<NetworkIdentity>().RemoveClientAuthority(connectionToClient);
    14.     currentVehicle = null;
    15. }

    According to this thread which had discussion of a similar-sounding problem, it was filed as a bug here, and despite being marked as "fixed", it still seems to be wonky.
     
    Last edited: Oct 5, 2015
  2. Capn_Andy

    Capn_Andy

    Joined:
    Nov 20, 2013
    Posts:
    80
    Yep, seeing this problem as well and it's something I can't "work around" so we've basically stopped work until this is addressed!
     
  3. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    This fix will be in 5.2.1p3
     
  4. PHLCollective

    PHLCollective

    Joined:
    Jun 27, 2014
    Posts:
    59
    Awesome! Glad to hear.
     
  5. Pypsik1

    Pypsik1

    Joined:
    Jul 16, 2016
    Posts:
    6
    Was this really fixed ?
    I'm on Unity 5.3.5, and on RemoveClientAuthority() object "snaps" back, and then "slides (interpolates)" to the correct position. This problem only occuring on clients, never on host.
    I'm using "Rigidbody 2D sync" mode on network transform. (If use transform sync there's no such problem.)
     
  6. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    I have the same problem :-(
     
  7. Deleted User

    Deleted User

    Guest

    5.4.0 F3, same.