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

unity did not find target for sync message

Discussion in 'Multiplayer' started by FoxCastz, May 11, 2018.

  1. FoxCastz

    FoxCastz

    Joined:
    Jun 18, 2015
    Posts:
    75
    I am getting this message whenever I use transform.position = new Vector3(whatever coordinates);

    The message appears on the client players only and the client is synced via NetworkTransform Character Controller synchronization. I do not get the error when moving around normally, but as soon as the client character is moved using transform.position, then the client is thrown into a random position and the yellow error message "unity did not find target for sync message" appears.

    The client is Local Player Authority in Net Identity.

    Other Notes:
    The issue does not occur when Network Transform is syncing Transform, but Transform syncs cannot use interpolation to smooth movement like syncing character controllers or rigidbodies can.
     
  2. FoxCastz

    FoxCastz

    Joined:
    Jun 18, 2015
    Posts:
    75
    good help, so fast, much useful forum.
     
  3. thesupersoup

    thesupersoup

    Joined:
    Nov 27, 2017
    Posts:
    70
    There's not a lot of info to go off of from the OP, but I am curious: are you syncing the position as an RPC?
    Something like:
    Code (CSharp):
    1. void FixedUpdate()
    2. {
    3.      if(isLocalPlayer)
    4.      {
    5.                if(Input.GetButton("Movement Axis")
    6.                     CmdUpdatePos(this.gameObject.transform.position);
    7.      }
    8. }
    9.  
    10. [Command]
    11. void CmdUpdatePos(Vector3 nPos)
    12. {
    13.      RpcUpdatePos(nPos);
    14. }
    15.  
    16. [ClientRpc]
    17. void RpcUpdatePos(Vector3 nPos)
    18. {
    19.      this.gameObject.transform.position = nPos;
    20. }
    Also, I wish I could be of more help regarding NetworkTransform, but I found it to be cumbersome and unwieldly. I'm currently using Smooth Sync: https://assetstore.unity.com/packages/tools/network/smooth-sync-96925

    It's drag-and-drop easy to work with. You shouldn't need to send an Rpc with the position update either, it should just interpolate from one position to the next.
     
  4. FoxCastz

    FoxCastz

    Joined:
    Jun 18, 2015
    Posts:
    75