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. Dismiss Notice

Question Jerky movement of a Kinematic Interactable when using Continuous Move Provide

Discussion in 'XR Interaction Toolkit and Input' started by SunnyValleyStudio, Jun 20, 2022.

  1. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    67
    Hey!


    I'm using XR Garb Interactable (sword) with Kinematic Movement Type.
    The problem is that when I hold it and move using the Continuous Move provider the item falls behind creating this jerky movement.

    I did try setting interpolation on the swords rigidbody, adding Character Controller and using smooth position settings but nothing seems to fix it.

    It works great with Instantaneous Movement Type but then the hit collision between the sword and other objects stops working correctly.

    I would appreciate some help with this issue :)

    Thanks!
    -Peter
     
    Last edited: Jun 20, 2022
  2. konzeptzwei

    konzeptzwei

    Joined:
    Feb 10, 2006
    Posts:
    64
    hmm first question would be: What XR SDK version do you use? This has been an issue for a long time and has only be fixed in 2.0 I think.
     
  3. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    67
    Thanks!
    I'm using Unity 2022.1.3f with
    • OpenXR Plugin 1.4.2
    • XR Interaction Toolkit 2.0.2
    • XR Plugin Management 4.2.1
    I honestly think that this is a Unity Physics related issue.

    The Continuous Move Provider is using Update and is basically teleporting the player by changing the position directly. The RigidBody position changes in a FixedUpdate so the discrepancy between the position is because the hand is teleported quicker (every frame) and the Kinematic RB position is updated in the following Fixed Update Frame.

    My best solution idea is a physic based movement system because if I leave the XR Grab Interactor at Instantaneous movement type it seems very tricky to get collisions to work properly.

    I would appreciate any and every solution idea :)
     
  4. EbrietasI

    EbrietasI

    Joined:
    Mar 20, 2022
    Posts:
    2
    Hi, I meet the same problem with you. Do you find any way to deal with it ?
     
  5. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    67
    What happens here is that you are moving a kinematic rigid body and making it keep up with a hand that is moved using Transform.position. The jerkiness comes from the difference between frequency of Update vs FixedUpdate.

    In my basics of Vr in Unity course at https://startvr.teachable.com/ I suggest that we can lower the Fixed Timestep in the Preferences for the Time to make the physics run smother - but we trade in the performance which is not that greater of a trade.

    The best solution would be to split the visual part (the model) and make it being moved using the transform.position while have an invisible physics representation that is moved using the Kinematic RB.

    According to the feedback from people who play VR games extensively they simply stops noticing the jerky movement when playing the game so the best solution is - make your game so engaging that people will ignore the jerkiness.
     
    EbrietasI likes this.
  6. EbrietasI

    EbrietasI

    Joined:
    Mar 20, 2022
    Posts:
    2
    Nice ! Very much appreciate that.