In a VR project, Align an object in rotation when releasing

The situation is this, Im working on a VR project and I need a pickup object to align to a grid in location and rotation when releasing.

so I managed to solve the grid location as shown in the image, but the rotation alignment does not work the same.
Can you help me please?