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 Moving RigidBody position not respecting joints when grabbed

Discussion in 'XR Interaction Toolkit and Input' started by vallinoto, Jan 21, 2022.

  1. vallinoto

    vallinoto

    Joined:
    Nov 18, 2021
    Posts:
    1
    Hi, if anyone can help me please, I've tried so many things to fix this that I am almost abandoning my project.

    I'm trying to create a car, with a gear system that I can use to change the gears.
    I have created a configurable joint for the gears, and it is working ok, until I move the whole car.
    When I move the car, the gear will follow, but its position will move back proportionally to the speed, not respecting the anchor of the joint, as you can see on the attachment. I know the lever is moving back, that's fine, i'll fix that later. My issue is the whole RidigBody of the lever seems to be moving opposite to the speed direction ( disrespecting the joint ). Check the black marks on the attachment .

    I have built it like this:
    - I am applying speed to the car structure ( RigidBody.velocity ), that's how everything moves.
    - The gear joint has the base of the car as the connected body.
    - I am using a grab interactable with velocity tracking at the lever.

    Observation : If I add Is kinematic to the lever, it won't happen until I grab the lever. It will stay still as desired, unless I grab it. Then it moves back.

    Hope that was clear, thank you very much in advance.
     

    Attached Files:

    adamgffrd likes this.
  2. adamgffrd

    adamgffrd

    Joined:
    Sep 26, 2018
    Posts:
    35
    Hi @vallinoto, I am running into this exact same issue. I have built a boat that moves based off a lever connected via. configurable joint. If I move the lever using Kinematics, works "fine". As soon as I change the xr grabbable throttle to Velocity Tracking, I move with the boat fine, but the anchor point on the configurable joint will start sliding backwards. This then causes the throttle handle to jump back and forth between my hand and a little ways behind the hand, over and over and over again until the anchor has slid so far it's just unmanageable.

    I had a feeling that this was more so related to how the XR Hand/Controller updates in the physics loop but I am not so certain about that anymore. I am starting to feel like this just isn't fixable, that it's just a limitation of the Unity PhysX system but idk, at a loss currently.

    I am hoping you have figured something out about this. My "solution" was to just table this for now and setup the boat movement controls based off the controller joystick input but that's just a temporary work around for now.

    I hope this message finds you and if you have any information on how you proceeded with this, I would be very grateful! :) Thanks!