Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func _ready():
- set_process(true)
- func _process(delta):
- #print(get_node("Path2D").get_curve().get_point_count())
- if get_node("Path2D").get_curve().get_point_count() < 2:
- set_process(false)
- return
- var n_offset = get_node("Path2D/PathFollow2D").get_offset() + delta * speed
- get_node("Path2D/PathFollow2D").set_offset(n_offset)
- get_node("Sprite").set_pos( get_node("Path2D/PathFollow2D").get_pos() )
- if get_node("Path2D/PathFollow2D").get_unit_offset() >= 1:
- set_process(false)
- print("hj")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement