Scale ColiisionBody2D's mouse_enter and exit signal areas

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MugenHachi
:warning: Old Version Published before Godot 3 was released.

Hello! I have a very simple yet disturbing problem. I preloaded a scene (which has a node2D > rigidbody2D > sprite and collisionShape2D), and right before adding it as a child to another scene, I use set_scale() to scale the RigidBody2D’s sprite and collisionShape2D. However, the mouse_enter and mouse_exit signals’ triggering area did not scale as well,
i.e. those signals only trigger on the area of the scaled sprite that corresponds to it’s area before scaling.

So I tried scaling the node2D, the Rigid Body2D, everything possible using the set_scale() and scale() functions, tried overriding their _get_item_rect() functions and even updating them with update() method. Nope. None of that worked.

I would be really glad if someone could enlighten me here.
.
.
P.S: The RigidBody2D, Sprite, CollisionShape are all squares of same size and position.

Scaling collision shapes will give you problems (is mentioned a couple of times on the docs).

Look for another way, you can try scaling the visual representation (sprite) and resize the shape to fit on it while keeping the body node intact.

eons | 2016-11-17 18:16