Ignore parent's Y rotation?

How can I make a child ignore it’s parent’s Y rotation completely? (js)

Why is it a child if it’s not to receive the parent’s transformation?

And if it’s that important. What you’ll want is to just subtract the rotation of the parent from the child. You can do this by directly subtracting, using an inverse matrix, or deducting a quaternion from the rotation. All are suitable.

How would I subtract the rotation?
I tried transform.eulerAngles.y =- target.transform.eulerAngles.y;
Where target is the parent.
But nothing changed.

that’s equating your y rotation to the negative of the parent rotation.

Furthermore, you’d have to update the local rotation EVERY time you wanted to update the local rotation (or the parents). If the parent and child’s rotation are sent seldom, this is fine. But if they’re set all the time, it’ll have to be done more frequently.

Again though… why would you do this? It defeats the purpose of having a child be the child of a parent.

There may be a better way to do it. For instance, if this is like some turret head on a tank, and the turret head always faces a specific direction even though the tank moves around… you don’t make the turret head ignore the parent directly… you set the turret to face in the direction you want.