how to get correct roation on Z to spawn Actor with prefered orientation?

Hi,

I have a mesh which is a building with several walls. Everything is one mesh.
Then I have a player which does a line trace so I can get the location of a point on the wall.
Now I can spawn an actor at that point, lets say a picture frame.
The picture frame has the same pivot orientation like the building. So if you look at the drawing the picture frame spawns with the correct orientation for the right wall.
But how can I get the rotation for the the picture frame if i want to let it spawn with the correct orientation on one of the other walls?
I am sure the is a solution, but I can’t get it.
The solution must work for every wall orientation, not just for 90 degree differences.

You should be able to use the normal/impact normal

You can then use a Make rotator from X node to convert that to rotation
image

Thank you, I did not thought that it was that simple.
Here Is a complete solution: UE4 - Easy spawning on surface angle - YouTube