navigation agent added for person

now it goes to new object when it is placed . Also new obj model for person
This commit is contained in:
Nikolai Fesenko
2025-08-15 14:50:15 +02:00
parent 37960fe7f9
commit b7bf4792f3
11 changed files with 393 additions and 17 deletions

18
Scripts/person.gd Normal file
View File

@@ -0,0 +1,18 @@
extends CharacterBody3D
var nav_agent: NavigationAgent3D
func _ready() -> void:
nav_agent = $NavigationAgent3D
Global.object_placed.connect(_on_object_placed)
#nav_agent.target_position = Vector3(-15.955,3.486,-58.942)
func _physics_process(delta: float) -> void:
var new_velocity = global_position.direction_to(nav_agent.get_next_path_position()) * 5.0
velocity = new_velocity
move_and_slide()
func _on_object_placed():
nav_agent.target_position = Vector3(-14.305,3.486,-59.836)