proto3 initial commit

This commit is contained in:
Segey Lapin
2020-04-13 12:45:25 +03:00
parent 69410badf6
commit 1084b6d5c3
1588 changed files with 368852 additions and 23 deletions

View File

@@ -0,0 +1,19 @@
extends BTCondition
class_name BTHasArrived
func tick(tick: Tick) -> int:
var npc = tick.actor
var tgt = npc.get_meta("target_loc")
var point = npc.get_meta("path_point")
var npc_pos = npc.global_transform.origin
# print("target: ", tgt, " point: ", point, " pos: ", npc_pos)
if point.distance_to(tgt) < 0.2:
# print("arrived1")
npc.set_meta("path_valid", 0.0)
return OK
if npc_pos.distance_to(tgt) < 0.4:
# print("arrived2")
npc.set_meta("path_valid", 0.0)
return OK
# print(npc.name, " distance: ", npc_pos.distance_to(tgt))
return FAILED