Godot4 how to set a scene in a TileMap using gdscript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lordslumber

I’m wondering how to use TileMap’s set_cell() to set a scene from a Scene Collection in a TileSet. The docs imply that you can but the parameters of the call conflict with the function docs.

from set_cell doc:

void set_cell(layer: int, coords: Vector2i, source_id: int = -1, atlas_coords: Vector2i = Vector2i(-1, -1), alternative_tile: int = 0)

The atlas coordinates identifier atlas_coords identifies a tile coordinates in the atlas (if the source is a TileSetAtlasSource. For TileSetScenesCollectionSource it should be 0),

So it says atlas_coords should be zero but its a Vector2i param so that doesn’t work. I tried a Vector2i of zero length (also didn’t work), but even if it did, then how do you choose between different scenes in your scene collection? This feels like an incomplete feature. Or am I missing something?

Did you write a bug for this already?

hoihoi8 | 2022-12-10 07:08

No. Figured I’d try here first.

lordslumber | 2022-12-10 22:20