i there, the problem is maybe that i understand something wrong with this. I try to get any used tile in a gridmap via get_meshes() like this:

func getTiles(gridmap:GridMap):
	for tile in gridmap.get_meshes():
		print(tile)

how can i access the vector3 of the tile. Have tried a lot like: tile.get_translated(), tile.basis, tile.origin and even tile[1]. The try to reach it via tile[1] is cause of the description about get_meshes() -> returns an array. The print(tile) returns: <PlaneMesh#-9223372009474358913>
[X: (1, 0, 0), Y: (0, 1, 0), Z: (0, 0, 1), O: (-13, 0, 25)]

What is my misconception? Thanks for any help.

  • There is a function call get_used_cells also you can loop and use get_cell_item

There is a function call get_used_cells also you can loop and use get_cell_item

    GridMap::get_meshes() returns an array of Mesh and Transform3D pairs for each populated cell. Origin property of each returned Transform3D is probably what you're looking for.

      cybereality works like charm. Thank you very much for your help. With this i get access to all i need. Also to get the item_name and other stuff over the id in the mesh_library. I wish you a nice weekend.

      xyz Thanks for the help but with origin i have tried it. I can't access it.