How can i change the frame of a kinematicbody2D:

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

Hello guys!

First of all i am sorry about my english but its not my native language.

So,this is my problem:
When i choose the 2D framework and i want to put a kinematicbody2D at the axle system,then the empty frame of the kinematicdody2D is very very small as a mark.this is also happens and with other options, for example about staticbody frame or sprite frames and anything.So,how can i change the size of a frame?I was searching about 2 days in google but nothing usefull…

Thank you.

:bust_in_silhouette: Reply From: kidscancode

I’m not sure I understand what your asking, but KinematicBody2D doesn’t have a “size”. You can give it a visible form with a Sprite (which has a size), and you set its collision with a CollisionShape2D (which has a size).

I recommend reading this:

First of all thank you very much about your answer.
Basically when i say “the size of the frame” i dont mean a size for the kinematicbody2D. i mean the “contour” or with other words the “outline” or the “frame” that represents a kinematicBody2d.This frame appears on the axle system when you choose the option kinematicbody2D from the scene as you know. The point is that the shape of this frame is a square before you put a sprite in there.In my case it has not the shape of a square but it is just a mark,When i put a sprite, then it takes a normal square shape but at a first the shape is just a small mark.So,when i want to create a collision i have problem because i cant check and handle the points on the countour…

Nick888 | 2019-04-23 17:35

There is no “contour”. The + mark is what it’s supposed to look like because before you’ve added a shape, a body has no size. In older versions of Godot, a box would appear, but this was misleading and caused user error. Add a CollisionShape2D or CollisionPolygon2D and you can size it as you wish.

kidscancode | 2019-04-23 17:39

Thank you very much again.I will try it…!

Nick888 | 2019-04-23 17:45

i would like to thank you again!Your suggestion worked perfectly!!!

Nick888 | 2019-04-24 04:50