Physics layers are part of the TileSet
. You can change their values with Tileset.set_physics_layer_collision_layer()
and TileSet.set_physics_layer_collision_mask()
like:
extends Node
@onready var tile_map: TileMap = $TileMap
func _ready() -> void:
await get_tree().create_timer(2).timeout
tile_map.tile_set.set_physics_layer_collision_layer(0, 0)