Hello!
It's me again with probably another newbie problem.
I want to make a scrolling background. And it works. However, only at certain speed
extends Node2D
export var Speed = 150
func Scroll(Delta):
if $Sprite_Background1.get_position().y < get_viewport_rect().size.y:
$Sprite_Background1.set_position(Vector2(0, $Sprite_Background1.get_position().y + Speed * Delta))
$Sprite_Background2.set_position(Vector2(0, $Sprite_Background2.get_position().y + Speed * Delta))
else:
$Sprite_Background1.set_position(Vector2(0, 0))
$Sprite_Background2.set_position(Vector2(0, -800))
For example at speed 150 there is a line where you cant see background textures. At 250 or 50 there is none. I cant see an error in my code. I would be glad for any help.
Best regards
Bizarre