I was comparing two Vector2 in this way:
var pos = $"../TileMap".world_to_map(posPlayer)
for i in range(0, sizeMap, 16):
if pos >= Vector2(i, i) && pos <= Vector2(i + 16, i + 16):
if pos.x > pos.y:
posChunk = Vector2(i, i) - Vector2(32, 48)
else:
posChunk= Vector2(i, i) - Vector2(16, 16)
But this exception of when x is greater than y, is not working very well, I'm trying to generate the map around the player, and I thought about it, to find the chunk in which the player is and then generate a certain amount of map , in the case of 64x64 in the position of the player - 16, so the player being in (16, 16) would instantiate 64x64 cells from the position (0, 0), which would leave the player surrounded by map, but due to some cases where x is greater than y would not work. I read a response in git saying to use the comparison of Rect2, however I do not know how to compare two Rect2 for my situation, would it be the best way, or am I thinking wrong?