0 votes

I just spent a long time today trying to figure out why collisions in a tilemap were not working. The issue was that in the tileset scene I had the staticbodies as the parent nodes for each tile, with the sprite and collisionbodies as children.

Is this intended?

in Engine by (34 points)

1 Answer

+1 vote
Best answer

I think it was, because Tilemaps are generally used to, at least, display graphical tiles, so Sprites.
Then Sprites can have colliders, light occluders etc but they at least have a Sprite most often, so it was forcibly implemented as if tilemaps were to be used primarily for displaying sprites.

I agree it can be confusing because most of the time, in any interactive game object, the root is physics and location, and visuals are children. It shouldn't be difficult to modify the TileSet exporter to relax this constraint, however you still have to match only one Sprite per tile (although even that could be worked around).

I never had problems with this so far anyways, but if you do, maybe you can suggest something on Github.

by (28,789 points)
selected by

It is definitely confusing, after I figured out the tileset order I thought that was the correct way of doing things and without thinking I went around and changed other interactive objects to match this style, which of course broke my scripts.

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.