- Home /
 
               Question by 
               HeavyProduction · Jul 25, 2018 at 02:07 PM · 
                rotationvector3quaterniondirectionmath  
              
 
              Rotate object based on hit normal + matching camera direction
I am trying to get an object to rotate so its aligned with the normal of the hit we have just received, but I would like it to also rotate around its local Z-Axis so that its always oriented with the camera.
Currently using this to get the rotation from the hit which works fine:
 Quaternion newRot = Quaternion.FromToRotation(Vector3.forward, hitInfo.normal);
But I am unable to get the second part working.
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
               
 
			 
                