Topic was automatically imported from the old Question2Answer platform.
Asked By
potatobanana
how can i make my hitbox position follow my mouse in area2D i set, but if my mouse go outside the area2D i set, my hitbox wont move beyond area2D but still follow the direction?
something like this
A few different ways to achieve this. A naive approach is to clamp the hitbox distance from the centre of the area (i.e. its radius). You could also create a polygon collider and do it all in editor.
Create a Sprite with a texture of that shape (an image of a circle for example)