Player places objects on walls - how to get proper rotation of objects

Something along these lines?

Not sure if there’s an easier way:


Can me made more complicated, for sure.