Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Path2D
- export (NodePath) var target_node
- onready var target = get_node(target_node)
- export (float) var lerp_speed: = 2.0
- onready var follower: = $PathFollow2D
- func _process(delta:float)->void:
- var offset: = curve.get_closest_offset(target.global_position - global_position)
- follower.offset = lerp(follower.offset, offset, lerp_speed*delta)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement