Grab Rotation Fix

So I understand that XR Interaction Toolkit is coming up with a solution to this. But before that happens, I need to fix this problem for my project.
When I pick up an object using a ray interactor (or direct interactor), the rotation of the object always resets to match the “hand” or controller. I need the object to keep its rotation. I’m trying to add a script to do this but I can’t seem to get it right. I tried to get the rotation this way:

    void Start()
    {
        interactor = grabee.transform.GetComponent<XRGrabInteractable>();
    }
    void Update()
    {
        interactor.selectEntered.AddListener(GetRotation);
    }
    void FixedUpdate()
    {
        if(interactor.isSelected)
            RotateWith();

        if(interactor.isSelected)
            MoveWith();
    }

    public void GetRotation(SelectEnterEventArgs args)
    {
        flag = true;
        originalRotation = grabee.transform.localRotation;
    }

    public void MoveWith()
    {
        grabee.transform.position = grabber.transform.position;
    }

    public void RotateWith()
    {
        if(flag)
        {
            grabee.transform.localRotation = grabber.transform.localRotation * originalRotation;
            flag = false;
        }
        else
        {
            grabee.transform.localRotation = grabber.transform.localRotation;
        } 
    }

But I think I need to get the rotation right before selectEntered. But I don’t know how or if that’s really the way. Any help would be much appreciated.

I think this is where things could be wrong.

Multiplication does not seem right, I would have used the object rotation, and then add the hand’s rotation like -

grabee.transform.localRotation =  originalRotation + grabber.transform.localRotation;

I mean it’s totally untested but you could give it a shot.

That was my first instinct too but localRotations are of the type Quaternion which you can’t use + for. I will try converting them to Euler angle and giving a try though. Thanks.

Hi. Is there any updated code here, including declarations. I’m a unity newbie and am trying to do the same thing with similar issues. Thanks in advance for the help.

Same for me. I am working with VRTK 4 grabbers, but the problem should be of the same kind.