I'm trying to use Navigation2D with a TileMap. The TileSet has two tiles, one (yellow) with collision and no navigation, the other (green) with navigation and no collision. I can use these to quickly lay out a maze, using yellow to set boundaries and green for acceptable paths. I'm then using Navigation2d.get_simple_path() to find a path through the maze.
When I place the tiles in the editor, it works perfectly, but I really want to place the tiles with code. I place the boundaries (yellow) manually and fill empty cells with green tiles using get_cell and set_cell in the TileMap ready() function. Everything looks good, but when I call get_simple_path() from my players (KinematicBody2D) physics_process, it fails (returns an empty path). Again, the same layout and code works when I place the tiles in the editor.
Any ideas?
Thanks.