1
Fork 0
mirror of https://github.com/Steffo99/looping-for-loops.git synced 2024-11-26 01:54:21 +00:00
looping-for-loops/Objects/ScrollingObjects/Utilities/ConveyorScrollParent.gd

14 lines
403 B
GDScript3
Raw Normal View History

2020-10-04 14:35:24 +00:00
extends ScrollParent
class_name ConveyorScrollParent
onready var conveyor_belt: ConveyorBelt = null
func _enter_tree():
conveyor_belt = get_tree().current_scene.get_node("ConveyorBelt")
conveyor_belt.connect("cb_speed_changed", self, "_on_ConveyorBelt_cb_speed_changed")
func _on_ConveyorBelt_cb_speed_changed(old, new):
2020-10-04 14:41:46 +00:00
scroll_velocity.x = -conveyor_belt.get_relative_cb_speed(parent.position)