Just learning Godot and GDScript but can't see why the label moves faster when travelling from right to left than left to right in this script. I inserted some variable to check the min and max delta values when travelling in each direction and there's no real difference. The project consists of a single node with just the label as a child. What am I missing (I appreciate the label goes off screen to the right but that's not the issue :D ) ?
extends Node var speed = 200 var dir = 1 func _ready(): pass func _process(delta): var temp = get_node("Label").rect_position temp.x += speed * dir * delta if (temp.x < 1) or (temp.x > get_viewport().size.x): dir = -dir temp.x += speed * dir * delta get_node("Label").rect_position = temp
Thanks in advance,