This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

Why My Player is floating?

VardiroVardiro Posts: 2Member

Hi,
Im new to godot and programming and in my first project I have a problem that make my sprite to float. Idk why Here is some screenshots from the project thanks :smile:
Code:


Tags :

Answers

  • VardiroVardiro Posts: 2Member

    EDIT: In the title I mean that the player is frezzing in the air here is a screenshot of the game:

  • TwistedTwiglegTwistedTwigleg Posts: 2,561Admin

    Looking at the code, I do not see anything out of the ordinary that would be causing this behavior, which makes me think something in how the scene is setup is causing the issue.

    Can you jump when the player is frozen in the air? If so, maybe the collision shape for the player is too big or positioned incorrectly in relation to the player sprite. Ideally you want your sprites and their collision shapes to occupy the same space, or as close as possible.

    Another thing to check would be to see if the platform has it's collision shapes correctly positioned. Looking at the picture, it looks like it is a Tileset. In that case, I would check to see if the tiles collision shapes are positioned correctly.

    You can make collision shapes visible while the game is running by selecting "Visible Collision Shapes" under the "Debug" menu.

    Hopefully this helps! :smile:

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.