I'm scripting a duck/crouch action to a platform-ish game, and I wanted to implement it downscaling the hitbox (an CollisionShape2D node), preferably tweening the scale. The thing is: when I tween/change the "CollisionShape2D:shape:extents" property, the scaling happen uniformly from both sides, and the desired behavior would be for the bottom of the shape to remain in the same place while the top smoothly shrinks downwards.
I guess what I'm really looking for is: how can I change the scaling anchor/pivot from a Node2D (more specifically a CollisionObject2D) node via code? Is there some other simpler way to do this that I'm missing?
before anything else, thank you for the attention. :3