Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

VR Controller movement is syncing / moving

Discussion in 'Netcode for GameObjects' started by OvrSimon, Sep 8, 2022.

  1. OvrSimon

    OvrSimon

    Joined:
    Nov 16, 2021
    Posts:
    2
    Hello fellow forum devs!

    I am a virtual reality developer working on a fitness boxing game for the Meta Quest. I want to incorporate a multiplayer mode into the game that players can compete and train with others in the game, and I am using netcode in hopes to accomplish this.

    I have run into an issue where the player GameObjects are not moving accurately to match the speed of the player's controllers. Attached I have 2 videos of a guy throwing quick punches viewed from the server and the client side games. Note that on the client side, the punches do not even travel the full distance the hand actually went out.

    Turning off networkTransform interpolation does not fix the issue, and it adds a lot of jagged movement to the hands of the player. Is there something I may be overlooking? If possible I would appreciate it if someone could steer me in the right direction.
     

    Attached Files:

  2. CosmoM

    CosmoM

    Joined:
    Oct 31, 2015
    Posts:
    184
    Every tick, the NetworkTransform sends a transform update. However, if movement goes back and forth, like with punches, then it may well be that for update A the arm is still moving forward, while for update B it's already on its way back. Interpolation will not help or hinder in that case, because there is simply data missing in between (e.g. the endpoint of the punch). So you need to fill in that data somehow. The simplest thing would be to increase the tick rate in the NetworkManager: more network traffic, but a higher time resolution for movement. Alternatively, use custom messages to send the most important transform points yourself; for example, detect the end point of a punch and use that for interpolating the transform on the client side.
     
unityunity