Trying to Snap a Cube another to Cube. Should work, but does'nt!


I’m currently creating a Game where you can attach Cubes to eachother to create bigger Structures and I already set up a System that should work just fine, but for some reasons doesn’t. It gets the relative position of one Actor to another and then calculates what side the cube is touching, but it doesn’t get the correct side and attaches it sometimes to the opposite, left right or in the Center…
If someone knows a way to attach cubes toghether to form Structures like in the Game Scrap Mechanic, this would be amazing.