foreach (var cell in cells)
{
if (GD.Randf() < 0.03 && cell != PlayerSpawnCoords)
{
Node2D appleTree = ReusableStatics.AppleTree.Instantiate<Node2D>();
appleTree.Position = MapToLocal(cell);
AddChild(appleTree);
GetCellTileData(0, cell).SetNavigationPolygon(0, null);
}
}
I'm trying to dynamically remove navigation from specific cells, but I am getting extremely unexpected results(Screenshot), all tiles should have navigation except the cells with trees on them, but as you can see it looks like it's just.. random?