0 votes

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.

in Engine by (218 points)

1 Answer

+1 vote
Best answer

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:
https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html

by (18,221 points)
selected by

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...

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.

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

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories