[C#] Bug? Rotating parent of a collider2D does not rotate the collider itself.

Hi fellow scripters,

in my scene I’ve a GameObject Player (the hearted cube) which has a child called ‘sword’.
Sword (empty game object) has a child called circle (the green circle) which has a SpriteRenderer and a CircleCollider2D.
When i rotate the GameObject ‘sword’ (as shown below) I do rotate the SpriteRenderer but not the CircleCollider2D (as you can clearly see they are offsetted in the image).

Is this a (known) bug?

_Sword.transform.rotation =  Quaternion.Euler (0, 0, Mathf.LerpAngle (_Sword.transform.rotation.eulerAngles.z, angle, 0.5f));


1517747--86591--$sword.png

Could it be that is intentional? Rather than setting the rotation like that what if you use _Sword.transform.Rotate()?

I don’t think it’s intentional. I’m pretty sure it’s a bug in Unity.

And I’ve tried the Rotate function but it doesn’t matter. Same thing happens.

What is weird though, however… that if I rotate the Player instead of the sword GameObject the Collider does rotate.

EDIT: Made a dirty fix (setting the parent transform).

_CircleCollider.transform.parent = _Sword.transform;