How to set my autotile using set_cellv()?

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

I’m trying to generate a dungeon by using drunken walk method described here. Tl;dr for the method described there is: carve out the path from the wall. I tried to use set_cellv(position, -1) and set_cellv(position, 1) to do it, but when i do, the autotile does not updating itself. See the image below to see what i mean.

This is the autotile that i get when using set_cellv(position, 1):
The error when using set_cellv()

The result i want:
What i want

It’s the same placeholder autotile i got from godot docs, but when i use set_cellv() the wall did not appear.

:bust_in_silhouette: Reply From: hanke

You need to call update_bitmask_area to apply the autotile rules: TileMap — Godot Engine (stable) documentation in English

In code:

:bust_in_silhouette: Reply From: radome

A simple example