Undo.RecordObject doesn't work

Hello,

I want to implent an undo/redo-system in a 3D virtual reality editor.
I already used Undo.RegisterCreatedObjectUndo to register when a new object is created and make the action undoable.
However I can not get the essential Undo.RecordObject to work, here is an example:

 Undo.RecordObject(GetComponent<LaserPointer>().hitObject, "ObjectMoved");
 OnTriggerDownMove(GetComponent<LaserPointer>().hitObject);

In this example I simply target an GameObject with the laserpointer (attached to the controller) and move it by holding the trigger and dragging it.
Undo.RecordObject does not register any undo-operation for that.

If I use the Undo.RegisterCompleteObjectUndo function, I can use Undo.performUndo to reset the position, however it only allows to save 1 copy of the object and multiple move-steps will not be undoable step-wise.

I hope you guys can help me out, if you need additional information just tell me.

It sounds like you are changing properties on the Transform component, but recording the state of the LaserPointer component. Make sure you pass the affected Transform component to the Undo.RecordObject() method.

I managed to partly get the Undo.RecordObject() function to work now. I placed it inside the OnTriggerDownMove() function and used the transform of the given GameObject:

public void OnTriggerDownMove(GameObject hitObject)
    {
            Undo.RecordObject(hitObject.transform, "ObejctMoved");
           /*...rest of the function...*/
}

However it has the following problem: When I move the object from a to b and then use performUndo(), the object will be reset too position a and everything seems fine.
But when I move the object from a to b and then I move the object from b to c (the object can be grabbed and moved multiple times) and then I use performUndo(), the object will always be reset to position a, even if the starting-position of the last move was somewhere else.
Any ideas?