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.

Tileset collision: what do I forget?

ilbakilbak Posts: 3Member
  • I created the main scene
  • I created the scene with tiles and each tile is a StaticBody with Sprite and CollisionShape.
  • I exported the scene as tilesets
  • I created a Tilemap node in the main scene and indicated the tileset created ...

The tiles in the main scene are imported without collisions. In the scene with the tiles the collisions work, but it is as if they were not exported.
What did I forget?

Best Answer

  • TwistedTwiglegTwistedTwigleg Posts: 2,561
    Accepted Answer

    Have you looked at the using a tilemap section of the documentation? When I have followed the steps exactly and made my node setup the same as in the documentation, I have been able to successfully get collision with a tilemap.

    I think for exported tilemaps to have working collision, the tiles have to be set up in the following order: Sprite -> StaticBody2D -> CollisionShape2D/CollisionPolygon, but I do not use the 2D side of Godot very often so I’m not positive.

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,561Admin
    Accepted Answer

    Have you looked at the using a tilemap section of the documentation? When I have followed the steps exactly and made my node setup the same as in the documentation, I have been able to successfully get collision with a tilemap.

    I think for exported tilemaps to have working collision, the tiles have to be set up in the following order: Sprite -> StaticBody2D -> CollisionShape2D/CollisionPolygon, but I do not use the 2D side of Godot very often so I’m not positive.

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.