Hello all,
I have some questions about the global_position method.
In my code I have a signal calling the _on_line_removed() method, this is the text for debugging purposes:
func _on_line_removed(YPos):
print("YPos" + str(YPos))
print("wallPosition" + str(wallPosition))
print("y global Position" + str(global_position.y))
finalPos = Vector2.ZERO
label.text = (str(global_position.y))
The output looks like this:
YPos240
wallPosition256
y global Position768
the label output at screen looks like this:
(please note that the wallPosition is y Coordinate of the below wall, and the YPos position is the line that got removed by the Tetris game):

I thought that the global position would give me the node position relative to the root node, but I dont understand why the label is giving me a diferent value than the output.
Here the current node structure:

The code with the above method is in a singleBlock instance.
I checked and all Node2d transforms are 0,0 before getting into the screen, so there should be no offset.
Can somebody point me to the correct direction? What am I missing? I think it is a bug in my code... but I am not getting to debug this properly.
Thanks for all the help.
Sinith