how to match a staticbody2d dimensions with it sprite and collision children and does it matter?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By joaomelo

I’m a really beginner, sorry if my question is super basic.

I am building a scene for a paddle in a arkanoid style game. I added a staticbody2d node and corresponding children nodes for the paddle’s 2d sprite and collisionshape. Than i realized that the staticbody2d and its children sizes didn’t match, illustrated in the picture below:

I thought it would be simple to adjust that, but first i couldn’t find width and height properties for the staticbody2d in the inspector. I also tried resizing it by changing the scale property but all the children nodes (sprite and collisionshape) changes size too.

I don’t know if it matters in the end, maybe the mechanics of the game should care only for the sprite and collisionshape sizes, but is so annoying to have this staticbody big square when it should match the paddle form.

Thank you.

:bust_in_silhouette: Reply From: kidscancode

Short answer: it doesn’t matter.

StaticBody2D does not have a size. The handles you see are the default ones that exist for every Node2D, and are there for moving and scaling in the editor. As you say, the sprite and collision shape are all that matter in game.

FYI, in Godot 3.1, those handles are hidden on collision object types, so you wouldn’t see it at all.

Perfect. Thank you.

joaomelo | 2019-02-12 11:01