1
0
mirror of https://gitee.com/freeyz/godot-mota.git synced 2024-12-23 01:29:35 +08:00

修复人物运动bug

This commit is contained in:
freewu32 2020-09-05 14:25:24 +08:00
parent 88ad7de89e
commit 1b038e0115
2 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,6 @@ func _ready():
# 使用节点进行动画 # 使用节点进行动画
func interpolate_array(values:Array) -> void: func interpolate_array(values:Array) -> void:
if values.size() < 2:
return
if is_active(): if is_active():
stop_all() stop_all()
self.index = 0 self.index = 0

View File

@ -57,6 +57,8 @@ func _unhandled_input(event):
var start_id = astar.get_closest_point(position) var start_id = astar.get_closest_point(position)
var end_id = astar.get_closest_point(event.position) var end_id = astar.get_closest_point(event.position)
var paths = astar.get_point_path(start_id,end_id) var paths = astar.get_point_path(start_id,end_id)
if paths.size() < 2:
return
animation_tree.active = true animation_tree.active = true
array_tween.interpolate_array(paths) array_tween.interpolate_array(paths)