A bit more Godot work this evening. I wanted to add a foreground layer of tiles that obscured in the player. This is for making false walls to hide secrets around the level. It took me a while to work out how to turn off collision of this foreground layer: there wasn’t really any way to do so within the designer.
Fortunately, this Github comment showing how to do so using a script worked like a charm:
extends TileMap
const foreground_layer = 1
func _use_tile_data_runtime_update(layer: int, coords: Vector2i) -> bool:
return layer == foreground_layer
func _tile_data_runtime_update(layer: int, coords: Vector2i, tile_data: TileData) -> void:
tile_data.set_collision_polygons_count(0, 0)
Only limitation seems to be that it will disable collision for the whole layer, but that’s perfectly fine with me.