I want to rotate a game object so that its upward axis (+y) is aligned with another game object's surface normal in a editor script. I should also be able to specify an angle that describes the rotation around the surface normal, if that is possible somehow.
This is what I got so far inside my OnSceneGUI():
float angle = 24f;
GameObject obj;
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 1000))
{
Vector3 normal = hit.normal;
// Rotate here
}
Thanks for the help!