Question about using set_cellv()

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

This is my code:

if event.is_action_pressed("Ctrl"):
			print("Control pressed")
			map.set_cellv(position,1)

It’s held in a much larger area of code of course and map is set to get the tilemap node. Whenever I trigger the event however nothing happens. I can see that it is printing that the event was triggered but it doesn’t set the cell to the tile in the 1 position. What should I change?

:bust_in_silhouette: Reply From: kidscancode

What’s the value of position? Are you using tile coordinates? The vector passed to set_cellv() needs to be in map coordinates, not pixel coordinates.