0 votes

I have created a tilemap as explained in docs. I added StaticBody2D nodes to some of the tile types. After saving and testing the project, I realised that colliding with these bodies did not return the tile sprite of the cell, but the tile map node itself (As also pointed here).

So, I decided to get rid of static bodies as they are practically useless for me. I returned to the tileset_edit scene, removed the static body nodes. I converted the scene to the tileset again, by overriding the existing one (Merge with existing = Off).

However, when I test my project, the tilemap still collides with my objects. When I set the collision shapes visible, I can still see that these particular cells are blue.

How can I remove these static bodies?

in Engine by (30 points)
edited by

I don't know if this is helpful, but get_collider_metadata will return the cell involved in the collision on a tilemap.

Oh, I didn't know that such thing exists. It would be useful, thanks.

1 Answer

0 votes
Best answer

Ok, I've found the problem.

Updating the resource itself didn't update the TileMap's tile set property. When I updated resource (tileset file), Godot changed the tile set property of TileMap to something named Terrain which seems to be the copy of my old tile set. So when I clear the property and load the file again, it recognizes the new tile set.

by (30 points)
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 Frequently asked questions and 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 [email protected] with your username.