Hi I am trying to make a mob with Area2D with AnimatedSprite2D and CollisionShape2D. I would like to resize the mob on demand while the mob moves (by frame). What’s the best practice or what shape i shall use to get a dynamic size mob.
you need to resize the collider of the Area2D or CharacterBody2D (or both) using the properties of the shape. and then change the size of the sprites using scale.
DO NOT CHANGE SCALE of a collider or physics body.
you can animate the dimensions of the shape, or, depending on the shape, it can be changed through code.
for example, a collidershape with a shape of type calsule:
var capshape = collider.shape as CapsuleShape2D
if capshape:
capshape.height = 30.0
capshape.radius = 10.0