File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ bool AIBlueAgent::agent_setup(Variant agentNode)
41
41
}
42
42
}
43
43
44
- void AIBlueAgent::_process (double _delta)
44
+ void AIBlueAgent::_physics_process (double _delta)
45
45
{
46
46
if (_domain.Root ()->Name () != " DefaultDomainName" )
47
47
{
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class AIBlueAgent : public Node3D
36
36
bool agent_setup (Variant agentNode);
37
37
void planner_tick ();
38
38
39
- void _process (double delta) override ;
39
+ void _physics_process (double delta) override ;
40
40
41
41
/* *
42
42
* Sensors
Original file line number Diff line number Diff line change @@ -6,13 +6,6 @@ const SPEED = 3.0
6
6
7
7
func _ready ():
8
8
$ AIBlueAgent .agent_setup (self .get_path ())
9
- func _process (_delta ):
10
- var current_location = global_transform .origin
11
- var next_location = nav_agent .get_next_location ()
12
- var new_velocity = (next_location - current_location ).normalized () * SPEED
13
-
14
- velocity = new_velocity
15
- move_and_slide ()
16
9
17
10
func update_target_loc (target_loc ):
18
11
nav_agent .set_target_location (target_loc )
@@ -35,6 +28,12 @@ func _on_vision_sensor_timeout():
35
28
36
29
func moveTo () -> bool :
37
30
# print("Move Agent To Location")
31
+ var current_location = global_transform .origin
32
+ var next_location = nav_agent .get_next_location ()
33
+ var new_velocity = (next_location - current_location ).normalized () * SPEED
34
+
35
+ velocity = new_velocity
36
+ move_and_slide ()
38
37
return true ;
39
38
40
39
func closest_player () -> Vector3 :
You can’t perform that action at this time.
0 commit comments