Align two mesh in game

Is possible to align two mesh by face? For example from this

To this

Sorry, infact my question is too poor for some help. What i’m trying to do is a minecraft style building. Currently i have a line trace from my camera that when it will hit i should be able to place one actor aligned to the hit actor

Sure its possible but how do you want it to done? Are they going to stick to each others? Are they working as magnets?
Please explain a little what you trying to do.
In general you can try this:Block A and Block B first you rotate the block B to the same rotation as block A using Rinterp ,then you make a vector with rotation from Block A with the width of the block, that way you have the position where the block B need to go, then you just use custom build function to move the block B to position.
Ps: The custom function should be used with rinterp in tickevent, it will be really useful if you used distance between the blocks in Rinterp, the closer they are the faster the rotation.
Pss: These will work only for one side if you want it to work for the others as well you need to check where block B is located and getting a different rotator for the vector with rotation.
If you want them to just teleport you just need the rotation and the vector and that it.

I can’t because the first block is not “snapped” to a grid

Lol what you trying to do is really simple, I use simple grid system, lets say each height and width for your blocks is 100, all you need is the hit location. From the hit location set it to grid location and then back to location that way it will reset to perfect grid location example: hitlocation- X=123 Y=143 z=0 end result will be X=100 Y=100 Z=0 and set the location of your new block as that.
Ps: all blocks should follow the grid system if not it will be a mess.

Then make it snap, if not you trying to create something a lot different than minecraft style, and you need to take the rotation of the first block then get the vector from the block to the right position with the rotate vector and the width of the block and just spawn or teleport the second block to position with the rotation of the first block.