mirror of
https://gitee.com/freeyz/godot-mota.git
synced 2024-12-22 20:39:19 +08:00
修复人物运动bug
This commit is contained in:
parent
88ad7de89e
commit
1b038e0115
@ -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
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user