Programmically draw terrain path function

Hello,

image

I am trying to mimic the draw terrain path function you use in Godot 4 editor so it does the same at runtime, here is how I have it so far:

@onready var tile_map = $“…/TileMap2”
var created_map =

func pros_gen_env():
var vec1 = Vector2i(0,1)
var vec2 = Vector2i(0,0)
var vec3 = Vector2i(1,0)
created_map.append(vec1)
created_map.append(vec2)
created_map.append(vec3)
tile_map.set_cells_terrain_path(0,created_map,0,0)

The issue Im having is that the terrain is not visible at runtime
The tilemap is visible and the terrain is configured in the same tilemap

Any suggestions?

Just tested it and it works fine. Are you sure that the TileMap origin is visible? The path is local to the TileMap origin. Are you having any error in the debugger?

It is visible but I made a new proyect and it is visible I will work on this new setting. I appreciate your help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.