Question by
RASKALOF · Mar 08, 2019 at 12:28 PM ·
scripting problem
Why Collider2D size Y changes affects child object position
Hello, i got CapsuleCollider2D on empty GO (player), and i have some sprites as childs of this GO. I am Trying to implement crouching by decreasing CapsuleCollider2D size. (my_collider_size.y = somevalue) But when collider becomes smaller by y axis, all childs GOs mooving down (transform.position.y values of childs are decreases). How to do not moove childs when im changing parent collider size. PS if im changing collider size y from editor all good, no childs are moved, problem only appears if changing size from script. Please help me
Comment