Steamvr 2.2.0 changing held rigidbody movement speed

Hi,

Im wondering if anyone can help me this. I have a sword in a VR game attached to a hand. As I swing said sword it follows the hand. Problem is it follows the hand a little bit to slowly for my liking. I would like to change this so it feels more realistic or simply just faster.

What I did was dive into the SteamVr code to find the part of the code that updates its movement and what I found was this (SteamVr - Hand.cs Line 1161):

 protected virtual void FixedUpdate()
 {
      if (currentAttachedObject != null)
      {
         AttachedObject attachedInfo = currentAttachedObjectInfo.Value;
         if (attachedInfo.attachedObject != null)
         {
           if (attachedInfo.HasAttachFlag(AttachmentFlags.VelocityMovement))
           {
              if(attachedInfo.interactable.attachEaseIn == false ||
                 attachedInfo.interactable.snapAttachEaseInCompleted)
              UpdateAttachedVelocity(attachedInfo);

// bunch of other code after an else statement

so I jumped and skipped down to that Method (SteamVr Hand.cs line 1212):

protected const float MaxVelocityChange = 10f;
protected const float VelocityMagic = 6000f;
protected const float AngularVelocityMagic = 50f;
protected const float MaxAngularVelocityChange = 20f;

 protected void UpdateAttachedVelocity(AttachedObject attachedObjectInfo)
 {
     Vector3 velocityTarget, angularTarget;
     bool success = GetUpdatedAttachedVelocities(attachedObjectInfo, out velocityTarget, out angularTarget);
    if (success)
    {
       float scale = SteamVR_Utils.GetLossyScale(currentAttachedObjectInfo.Value.handAttachmentPointTransform);
        float maxAngularVelocityChange = MaxAngularVelocityChange * scale;
        float maxVelocityChange = MaxVelocityChange * scale;

        attachedObjectInfo.attachedRigidbody.velocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.velocity, velocityTarget, maxVelocityChange);
        attachedObjectInfo.attachedRigidbody.angularVelocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.angularVelocity, angularTarget, maxAngularVelocityChange);
        Debug.Log("Moving");
    }
}

I put the debug.log in there to make sure this was actually the call being made when I picked up my sword. Now The problem is that when I increase these numbers, regardless of what I do, the movement is not changed at all, not slower or faster. Im wondering what I can be doing wrong.

if updating the maxVelocityChange is not showing any different when getting increased,most likely is because the attachedRigidBody velocity is the same as velocityTarget. how are you callculating that velocity in the GetUpdatedAttachedVelocities? can you try just multiplying velotiy target by 10 for example?

attachedObjectInfo.attachedRigidbody.velocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.velocity, velocityTarget * 10, maxVelocityChange * 10);

Turns out that the culprit was that rigidbody.maxAngularVelocity, the actual maximum angular velocity of the item, in this case the sword. It had to be increased before the other variables could reach those values. Took me ages to figure this out hope it helps someone.