What's the best way to rotate an object relative to another?
I'm instantiating some quads into a scene using code. For example, I may add a 'floor' which has its 'up' vector like 0,1,0. Rotation around y is arbitrary.
Then I want to add a 'wall' quad, given a point in space above the floor, and a 'suggested normal' (using the same prefab). So the result I'm going for is that the 'wall' object will instantiate such that its center is that point given (above the floor), with its rotation around World Y matching the suggested normal, but at exactly 90 degrees from the floor. In other words, it's World Y would also be 'arbitrary' (as given by the suggested normal), but it's Local Y (up) would be horizontal, parallel to the floor.
I hope that made sense.
Floor normal dotted with wall normal = 90 degrees (somehow)
Your answer
![](https://koobas.hobune.stream/wayback/20220612161404im_/https://answers.unity.com/themes/thub/images/avi.jpg)