[Noob] Why aren't my blocks staying within same distance?
I try to make a blocks that move at the same time, but for some reason their spacing is changing.
What am I doing wrong?
var dir = 1 var play = true var speed = 400`
Here is my Block code:
func _ready(): set_fixed_process(true) func _fixed_process(delta): var motion = Vector2() if(globals.play): motion += Vector2(globals.dir,0) if(get_global_pos().x <= 0): globals.dir = 1 elif(get_global_pos().x >= 720): globals.dir = -1 motion = motion.normalized()*globals.speed*delta move(motion)`
This is the start situation:
The space between the blocks doesn't stay constant.