4 Learn @export, Parallax as Separate Scene

Here we will seperate the parallax to its own scene.

We will learn about @export, and how we can use it to use same scene with different configs in other scenes

We can export a property with @export in front before defining the property.

@export var auto_move = false

Now based on this property we can perform certain actions. And we can set or unset this property from the Inspector.

func _process(delta):
	if auto_move:
		move_bg(delta);
	pass

func move_bg(delta):
	cloud.motion_offset.x += SPEED * cloud.motion_scale.x * delta
	mountains.motion_offset.x += SPEED * mountains.motion_scale.x * delta
	pass