Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Wofke |
Hello. I’m new to Godot engine and I am trying to create a small infinite runner game.
I had the idea to move the ground instead of the player for no particular reason, I guess I liked this more
Now my question, how can I retrieve the world position of a tile while the tilemap is moving in the x direction?
My current code is the following
func _physics_process(delta):
move_local_x(-1)
print(left_pos())
func left_pos() -> Vector2:
var used_cells = get_used_cells()
var result = map_to_world(used_cells[0])
return result
In my head this makes sense, but the value of left_pos()
always stays the same when I print it to the console.
Is there something I am missing? Thanks for reading.