Hey People,
I’ve noticed a weird (repeatable) behaviour with the colliders (seems to be with all of them). Basically it seems to ignore the transforms scale when it comes to rotations. Also when a parent’s transform has a negative scale (so just swapping from 1 to -1) the size of the collider on the child object seems to change (looks like it’s related to which scale value is negative, so a box collider with a parent scale of -1 will have a smaller x size then one with a parent scale of 1. Also with a capsule collider along the Y-Axis, the height changes in the same manner).
Method:
Create a Game Object (parent)
Create a second Game Object (chile) and add it as a child to the parent
Add a Capsule Collider (size it so it’s easily visible in the editor)
Change the Z rotation on the child game object (to 20ish)
Issues:
Now if you change the x scale on the child from 1 to -1, the rotation of the collider isn’t flipped
Also, if you change the x scale of the parent from 1 to -1, the size of the collider seems to change
Any idea on how I can get around this? I’m working on a 2D platformer and it would be nice if my collider would rotate with my characters body (regardless of the direction it’s facing).
Thanks in advance,
~Cyro