Unity - change only z axis rotation to 0

by Green_qaue   Last Updated September 10, 2019 18:13 PM - source

I have a child where I want the rotation to work like (parentRot, parentRot, 0).

So first I set its localRotation to 0, meaning it will get the parents rotation: child.localRotation = Quaternion.identity;

But how can I make sure the world rotation (not local) value of the z axis stays at 0?



Related Questions


Checking if object passed between two other objects

Updated April 14, 2015 20:05 PM


Unity C# 2D Platformer Enemy Patrolling

Updated April 03, 2015 21:22 PM

Material not changing Unity3d

Updated June 04, 2015 12:05 PM