Sync obj transformed via RotateAround will cause lags

Hey...so I have a obj rotate around a pivot via RotateAround(). I have tried using UNET and PUN to sync its position&rotation...both have visible lags....
Is this because of RotateAround()? Cause when I used UNET for translate and rotate there is no this kind of lags....
Need Help.

Comments

  • Hi @JUUEN,

    how do you synchronize the object? If you are using a non-modified PhotonTransformView component you will most likely always face a delay in the synchronization. This is because the owner of the object sends the current position which takes some time to arrive and being applied on another client. In the meantime, the owner's simulation doesn't stop running and continues updating, meaning that his view differs from the other client's view all the time.

    I think this isn't related to the use of the RotateAround() function.
  • @Christian_Simon
    hey thanks for reply and explanation. I think you are right. What is the better practice? Can you share some tips or clues...
  • @Christian_Simon
    ah, and the lags I mentioned is not only about the difference between clients' views. In the client, the object of other clients executing RotateAround() does not move smoothly.... I dont understand why. I have tried to experiment on sync settings but cant fix it...
  • [...] does not move smoothly....


    How fast do the objects move? If you are using OnPhotonSerializeView only the object's position gets synchronized. If the object is moving too fast so that it has to 'travel' a 'long' way on the remote client's view, then you might face some kind of stuttering. So if the object is moving very fast, please try reducing its speed and see this is working better. I still can't imagine, that this has something to do with the RotateAround function.
  • JUUEN
    JUUEN
    edited January 2018
    @Christian_Simon
    It is not quite fast.

    So here is my thought:

    I am still thinking if the reason is that I am using RotateAround() to realize this behavior. While doing RotateAround(), the object will move through a circular path, and this is controlled via changing Position Value. The change of Rotation Value is only to make sure the object will keep looking at the target. While with interpolate, the object will move from one point to next received point straightly in a remote client.

    So in a remote client, actually the object is trying to do a circular movement via Lerp moving along a series of received positions straightly. I am thinking if this is the reason why I can't get a satisfying result.

    What do you think?
  • I have created a test scenario for this and having set the Interpolate Option to 'Lerp' with Lerp Speed 10 and disabled the Extrapolate Option for the position and additionally having set the Interpolate Option to 'Lerp' with Lerp Speed 10 for the rotation, too. This ends in good results as far as I would say. I have used the PhotonTransformView component for this test. If you are using this component as well, please try testing around with different options.