Enemies path to position off NavRegion and not to set target

Correct! Here is my full zombie.gd script just for reference.

Thank you so much for helping me out!

extends CharacterBody3D

@export_group("Zombie Stats")
@export var movement_speed: float = 4.0
@export var Health = 1

@onready var vehicle = $"../Vehicle"
@onready var nav_agent: NavigationAgent3D = get_node("NavigationAgent3D")
@onready var sfx_zombie_run_over = $"../sfx_zombie_run_over"
@onready var zombies_killed_label = get_node("hud/Score/Zombies_Killed/zombies_killed_label")

signal zombie_killed

#Official method that doesn't work
#func _ready() -> void:
	#navigation_agent.velocity_computed.connect(Callable(_on_velocity_computed))

#Official method that doesn't work
#func set_movement_target(movement_target: Vector3):
	#navigation_agent.set_target_position(movement_target)

func _physics_process(delta):
	nav_agent.target_position = vehicle.global_position
	
	var current_location = global_transform.origin
	var direction = nav_agent.get_next_path_position()-global_position
	
	direction = direction.normalized()
	velocity = lerp(velocity,direction*randf_range(100,150),delta*movement_speed)
	move_and_slide()
	
func update_target_location(target_location):
	nav_agent.target_position = target_location
	
#Official method that doesn't work
	#if navigation_agent.is_navigation_finished():
		#return
	#var next_path_position: Vector3 = navigation_agent.get_next_path_position()
	#var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_speed
	#if navigation_agent.avoidance_enabled:
		#navigation_agent.velocity = new_velocity
	#else:
		#_on_velocity_computed(new_velocity)
#func _on_velocity_computed(safe_velocity: Vector3):
	#velocity = safe_velocity
	#move_and_slide()

## Bullet damage logic
func Hit_Successful(Damage, _Direction: Vector3 = Vector3.ZERO, _Position: Vector3 = Vector3.ZERO):
	Health -= Damage
	if Health <= 0:
		zombie_killed.emit()
		queue_free()
		print("zombie shot")
		
## Collision damage logic
func _on_body_entered() -> void:
	zombie_killed.emit()
	$"../sfx_zombie_run_over".play()
	queue_free()
	print("zombie ran over")
	
# This function will be called from the Main scene.
func initialize(start_position, player_position):
	# We position the mob by placing it at start_position
	# and rotate it towards player_position, so it looks at the player.
	look_at_from_position(start_position, player_position, Vector3.UP)

why there are 2 lines of code that update the target_position?
if you only let the physics_processā€™ target_position, will it work properly?

oops! leftover code that I forgot to get rid of.

I commented out that function but still have the same issue. Thanks so much for helping me debug this! Any other ideas on what could cause this behavior?

thatā€™s very peculiar one, have you checked whatā€™s inside the navigation path? try 1 zombie only first
try printing nav_agent.get_current_navigation_path()
see what the Array shown

also try to print current vehicleā€™s global position from the vehicle script itself on every frame, see if the vehicle global position matched with navigation agentā€™s Array of navigation path

Thanks @zdrmlpzdrmlp ! The position of the vehicle is always printing

(-9.201, -0.181171, -85.64682)

if I print print(vehicle.global_position) on the zombie.gd and print(self.global_position) on the vehicleā€™s script.

Iā€™m not sure why this is the case so I am just going to dump my scripts here before I go line by line tonightā€¦

sandbox.gd

extends Node3D


const AccelerationTimer := preload("acceleration_timer.gd")

signal car_speed_changed(speed)

@export var camera_crane : CameraCrane

@export var camera_view := 0

@export var camera_views : Array[Node3D] = []


@onready var _vehicle : Vehicle = $vehicle

@onready var _speed_label : Label = %speed_label

@onready var _gear_label : Label = %gear_label

@onready var _rpm_label : Label = %rpm_label

@onready var _acceleration_timer : AccelerationTimer = $acceleration_timer

@onready var _acceleration_timer_interface := $hud/acceleration_timer

@onready var camera_driver = $CameraCrane

@onready var camera_passenger = $MainCamera

func _ready() -> void:
	camera_crane.snap_to_position(camera_views[camera_view])

	_initialize_timer_interface()


func _unhandled_input(event : InputEvent) -> void:
	if event.is_action_pressed(&"change_camera"):
		_cycle_camera_view()
	if event.is_action_pressed(&"toggle_timer"):
		_acceleration_timer.start()


func _process(_delta : float) -> void:
	_speed_label.text = str(absi(int(_vehicle.get_speed(Vehicle.KILOMETERS_PER_HOUR))))
	var gear := _vehicle.transmission.gear
	_gear_label.text = "D" + str(gear) if gear > 0 else "R" if gear < 0 else "N"
	_gear_label.modulate.a = 0.5 if _vehicle.transmission.is_shifting() else 1.0
	_rpm_label.text = str(int(_vehicle.motor.rpm))
	var car_speed = abs(int(_vehicle.get_speed(Vehicle.KILOMETERS_PER_HOUR)))
	emit_signal("car_speed_changed", car_speed)
	print(self.global_position)


func _cycle_camera_view() -> void:
	var current_view_index := camera_views.find(camera_crane.get_current_camera_position())
	var next_view_index := (current_view_index + 1) % camera_views.size()
	camera_crane.transition_to_position(camera_views[next_view_index])


func _initialize_timer_interface() -> void:
	_acceleration_timer_interface.hide()

	for target_speed in _acceleration_timer.target_speeds:
		var speed_label := Label.new()
		speed_label.text = "0 - %d" % int(target_speed)
		var time_label := Label.new()
		_acceleration_timer_interface.add_child(speed_label)
		_acceleration_timer_interface.add_child(time_label)

	_acceleration_timer.activated.connect(func():
		for i in _acceleration_timer.target_speeds.size():
			var time_label : Label = _acceleration_timer_interface.get_child(3 + 2 * i)
			time_label.text = "--"
		_acceleration_timer_interface.show()
	)

	_acceleration_timer.time_recorded.connect(func(index : int, value : float):
		var time_label : Label = _acceleration_timer_interface.get_child(3 + 2 * index)
		time_label.text = "%.1f" % value
		if index < _acceleration_timer.reference_times.size():
			time_label.text += " (%+.1f)" % (value - _acceleration_timer.reference_times[index])
	)

@onready var Dad = %Player_Character
@onready var Mom = %mom_npc
@onready var Daughter = %daughter_npc
@onready var Son = %son_npc

@onready var seat_driver = %seat_driver
@onready var seat_shotgun = %seat_shotgun
@onready var seat_back_left = %seat_back_left
@onready var seat_back_right = %seat_back_right

@onready var seats = {
	seat_driver: Mom,
	seat_shotgun: Dad,
	seat_back_left: Daughter,
	seat_back_right: Son
}

func _input(event):
	if event.is_action_pressed("move_to_F1"):
		var players_last_seat = null
		for seat in seats.keys():
			if seats[seat] == Dad:
				players_last_seat = seat
				break
		if players_last_seat != seat_driver:
			var temp_position = Dad.global_transform.origin
			Dad.global_transform.origin = seat_driver.global_transform.origin
			var character_in_seat_driver = seats[seat_driver]
			temp_position.y += 0.55
			character_in_seat_driver.global_transform.origin = temp_position
			if players_last_seat != null:
				var temp = seats[seat_driver]
				seats[seat_driver] = Dad
				seats[players_last_seat] = temp
				print(seats)
			
	if event.is_action_pressed("move_to_F2"):
		var players_last_seat = null
		for seat in seats.keys():
			if seats[seat] == Dad:
				players_last_seat = seat
				break
		if players_last_seat != seat_shotgun:
			var temp_position = Dad.global_transform.origin
			Dad.global_transform.origin = seat_shotgun.global_transform.origin
			var character_in_seat_shotgun = seats[seat_shotgun];
			temp_position.y += 0.55
			character_in_seat_shotgun.global_transform.origin = temp_position
			if players_last_seat != null:
				var temp = seats[seat_shotgun]
				seats[seat_shotgun] = Dad
				seats[players_last_seat] = temp
				print(seats)
		
	if event.is_action_pressed("move_to_F3"):
		var players_last_seat = null
		for seat in seats.keys():
			if seats[seat] == Dad:
				players_last_seat = seat
				break
		if players_last_seat != seat_back_left:
			var temp_position = Dad.global_transform.origin
			Dad.global_transform.origin = seat_back_left.global_transform.origin
			var character_in_seat_shotgun = seats[seat_back_left];
			temp_position.y += 0.55
			character_in_seat_shotgun.global_transform.origin = temp_position
			if players_last_seat != null:
				var temp = seats[seat_back_left]
				seats[seat_back_left] = Dad
				seats[players_last_seat] = temp
				print(seats)
			
	if event.is_action_pressed("move_to_F4"):
		var players_last_seat = null
		for seat in seats.keys():
			if seats[seat] == Dad:
				players_last_seat = seat
				break
		if players_last_seat != seat_back_right:
			var temp_position = Dad.global_transform.origin
			Dad.global_transform.origin = seat_back_right.global_transform.origin
			var character_in_seat_shotgun = seats[seat_back_right];
			temp_position.y += 0.55
			character_in_seat_shotgun.global_transform.origin = temp_position
			if players_last_seat != null:
				var temp = seats[seat_back_right]
				seats[seat_back_right] = Dad
				seats[players_last_seat] = temp
				print(seats)

vehicle.gd

class_name Vehicle
extends RigidBody3D


const METERS_PER_SECOND := 1.0

const KILOMETERS_PER_HOUR := 3.6


@export_range(0.0, 90.0, 0.01, "radians") var max_steering_angle := deg_to_rad(30.0)

@export_range(0.0, 10.0, 0.01, "or_greater") var frontal_area := 2.3

@export_range(0.0, 2.0, 0.01, "or_greater") var drag_coefficient := 0.3

@export_range(0.0, 2.0, 0.01, "or_greater") var air_density := 1.204

@export var motor : Motor

@export var transmission : Transmission

@export var center_differential : Differential

@export_range(0.0, 20.0, 0.01, "or_greater") var input_speed := 6.0

@export var motor_audio_controller : MotorAudioController

@export var wheel_audio_controller : TireAudioController


var _axles : Array[Axle] = []

var _engine_input := 0.0

var _steering_input := 0.0

var _brake_input := 0.0

var _handbrake_input := 0.0

var speed = 0

func get_speed(unit := METERS_PER_SECOND) -> float:
	return -linear_velocity.dot(global_transform.basis.z) * unit


func _init() -> void:
	child_entered_tree.connect(_on_child_entered)
	child_exiting_tree.connect(_on_child_exiting)


func _ready() -> void:
	if transmission != null and motor != null:
		transmission.torque_curve = motor.power_torque_curve


func _process(delta : float) -> void:
	_update_inputs(delta)
	_update_audio()


func _integrate_forces(state : PhysicsDirectBodyState3D) -> void:
	_apply_drive_input(state.step)
	for axle in _axles:
		axle.update(state, mass / _axles.size())
	_apply_drag(state)


func _unhandled_input(event : InputEvent) -> void:
	if transmission != null:
		if event.is_action_pressed(&"shift_up"):
			transmission.shift_relative(+1)
		elif event.is_action_pressed(&"shift_down"):
			transmission.shift_relative(-1)


func _update_inputs(delta : float) -> void:
	_engine_input = move_toward(_engine_input, Input.get_action_strength(&"accelerate"), delta * input_speed)
	_brake_input = move_toward(_brake_input, Input.get_action_strength(&"brake"), delta * input_speed)
	_handbrake_input = move_toward(_handbrake_input, Input.get_action_strength(&"handbrake"), delta * input_speed)
	_steering_input = move_toward(_steering_input, Input.get_axis(&"steer_right", &"steer_left"), delta * input_speed)

	_apply_steering_input()


func _apply_drive_input(delta : float) -> void:
	var gear_ratio := transmission.get_current_gear_ratio() if transmission != null else 1.0
	var torque_output = 0.0

	if motor != null:
		motor.throttle = _engine_input
		if transmission != null and transmission.is_shifting():
			motor.throttle = 0.0

		motor.is_engaged = not is_zero_approx(gear_ratio)

		if not motor.is_engaged:
			motor.rpm_feedback = 0.0
		else:
			var feedback_rpm := INF
			for axle in _axles:
				if axle.is_driven:
					for wheel in axle.get_wheels():
						feedback_rpm = minf(feedback_rpm, gear_ratio * wheel.get_rpm())
			motor.rpm_feedback = feedback_rpm

		motor.update(delta)
		torque_output = motor.get_torque_output()

	if transmission != null:
		transmission.torque_input = motor.get_torque_output()
		transmission.normalized_rpm_input = motor.rpm / motor.normalization_rpm
		transmission.update(delta)
		torque_output = transmission.get_torque_output()

	if center_differential != null and _axles.size() == 2 and motor.is_engaged:
		center_differential.torque_input = torque_output
		center_differential.velocity_feedback_1 = _axles[0].get_angular_velocity_feedback()
		center_differential.velocity_feedback_2 = _axles[1].get_angular_velocity_feedback()
		center_differential.torque_feedback_1 = _axles[0].get_torque_feedback()
		center_differential.torque_feedback_2 = _axles[1].get_torque_feedback()
		center_differential.update()

		_axles[0].torque_input = center_differential.get_torque_output_1()
		_axles[1].torque_input = center_differential.get_torque_output_2()
	else:
		for axle in _axles:
			axle.torque_input = torque_output / _axles.size()

	var drivetrain_inertia := absf(gear_ratio) * motor.inertia if motor != null else 0.0
	for axle in _axles:
		for wheel in axle.get_wheels():
			wheel.brake_input = _brake_input
			wheel.handbrake_input = _handbrake_input
			if axle.is_driven:
				wheel.drivetrain_inertia = drivetrain_inertia


func _apply_steering_input() -> void:
	var steering_angle := _steering_input * max_steering_angle
	var turn_center := _calculate_turn_center()
	for axle in _axles:
		if axle.is_steering:
			axle.steering_angle = steering_angle
			axle.turn_center = turn_center


func _apply_drag(state : PhysicsDirectBodyState3D) -> void:
	var forward := -state.transform.basis.z
	var longitudinal_velocity := state.linear_velocity.dot(forward)
	var drag_force := 0.5 * air_density * longitudinal_velocity * longitudinal_velocity * drag_coefficient * frontal_area
	state.apply_central_force(-drag_force * forward)


func _calculate_turn_center() -> Vector3:
	var turn_center := Vector3.ZERO
	var num_non_steering_wheels := 0
	for axle in _axles:
		if not axle.is_steering:
			for wheel in axle.get_wheels():
				turn_center += wheel.position
				num_non_steering_wheels += 1
	turn_center /= num_non_steering_wheels
	return turn_center


func _update_audio() -> void:
	if motor_audio_controller != null and motor != null:
		_update_motor_audio()
	if wheel_audio_controller != null:
		_update_wheel_audio()


func _update_motor_audio() -> void:
	motor_audio_controller.rpm = motor.rpm


func _update_wheel_audio() -> void:
	var num_wheels := 0
	var slip := 0.0
	for axle in _axles:
		for wheel in axle.get_wheels():
			slip += wheel.get_slip_velocity().length()
			num_wheels += 1
	slip /= num_wheels
	wheel_audio_controller.slip = slip


func _on_child_entered(child : Node) -> void:
	if child is Axle:
		_axles.push_back(child)


func _on_child_exiting(child : Node) -> void:
	if child is Axle:
		_axles.erase(child)

func _on_vehicle_car_speed_changed(new_speed):
	speed = new_speed
	#print("The car's speed is now: " + str(speed))

func _on_body_entered(body):
	if body is CharacterBody3D and speed > 10:
		body._on_body_entered()
		print(body)

main_world.gd

extends Node3D

@export var mob_scene: PackedScene
@onready var car = $Vehicle

func _on_mob_timer_timeout():
	# Create a new instance of the Mob scene.
	var mob = mob_scene.instantiate()

	# Choose a random location on the SpawnPath.
	# We store the reference to the SpawnLocation node.
	var mob_spawn_location = get_node("ZombieSpawnPath/ZombieSpawnLocation")
	# And give it a random offset.
	mob_spawn_location.progress_ratio = randf()

	var player_position = $Vehicle.position
	
	# Offset the mob_spawn_location to a random position within a range.
	var offset_x = randf_range(-4.5, 4.5)  # Random offset between -10 and 10 for x-axis
	var offset_z = randf_range(-4.5, 4.5)  # Random offset between -10 and 10 for z-axis
	mob_spawn_location.position.x += offset_x
	mob_spawn_location.position.z += offset_z
	
	mob.initialize(mob_spawn_location.position, player_position)


	# Spawn the mob by adding it to the Main scene.
	add_child(mob)
	mob.zombie_killed.connect(hud_increase_zombie_killing_count_method)
	
func hud_increase_zombie_killing_count_method():
	$hud._on_zombie_killed()
	
func _physics_process(delta):
	get_tree().call_group("Enemies", "update_target_location", car.global_transform.origin)
	print(car.global_transform.origin)

try change

to:

nav_agent.target_position= to_global(vehicle.position)

zombie_pathing_to_point_far_away

hmm this changed the point to which the zombie pathed to in the 3D space but didnā€™t change the print(vehicle.global_position) output, still (-9.201, -0.181171, -85.64682) and doesnā€™t change when the Vehicle moves.

Very confusing that we canā€™t seem to get vehicle.global_position to actually be set to the Vehicle nodeā€¦

Thanks for all your help @zdrmlpzdrmlp ! If you have further ideas Iā€™d appreciate it! Cheers!

this could probably a bug, hence why itā€™s converting the position to global position now, try print the

instead in the process
then match the vector3 with the last vector3 in that nav_agent path array

if itā€™s not matched, then the nav_agent is bugged lol

also the reason the zombie is moving so quickly is, it multiplies the direction by random range from 100 to 150, try tone that down to see it moves slower

Thank you @zdrmlpzdrmlp! Can you explain how I do the following? Iā€™m sorry I donā€™t understand how I get the vector3 from the nav_agent path array

then match the vector3 with the last vector3 in that nav_agent path array

Here are the prints currently:

car.global_position.origin = (-9.201, -0.181171, -85.64682)
to_global(vehicle.position) = (17.1716, -0.339399, -193.0888)

basically this line, add it to your physics process code block in zombie.gd

print(nav_agent.get_current_navigation_path())

i assume the latter code printed different when you are moving around, correct?

after you added that one line, it should print the navigation agentā€™s each pathā€™s node position in an array, check the array if it matched with the to_global position of the vehicle

Here are my prints, green is vehicle.position, red is nav_agent.get_current_navigation_path.

print_rich("[color=green]" + str("vehicle pos") + str(to_global(vehicle.position)) + "[/color]")
print_rich("[color=red]" + str("nav agent") + str(nav_agent.get_current_navigation_path()) + "[/color]")

It looks like both to_global(vehicle.position) & nav_agent.get_current_navigation_path() are set to the zombie but in different ways. Once the zombie gets to the point the outputs stay close to

vehicle pos(-18.4021, 0.115335, -179.1054)
nav agent[(-9.201076, 0.396416, -85.65137), (-9.201026, 0.396416, -85.64673)]

Here is the full output at the start of the scene before the zombie gets to the point and while the vehicle remains stationary.

vehicle pos(17.1716, -0.339399, -193.0888)
nav agent[]
vehicle pos(17.17014, -0.339376, -193.0883)
nav agent[(26.3726, 0.396416, -99.63911), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.16733, -0.339332, -193.0871)
nav agent[(26.37115, 0.396416, -99.63855), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.16316, -0.339267, -193.0855)
nav agent[(26.36835, 0.396416, -99.63745), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.15771, -0.339182, -193.0834)
nav agent[(26.36416, 0.396416, -99.6358), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.15104, -0.339078, -193.0807)
nav agent[(26.35873, 0.396416, -99.63365), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.14301, -0.338952, -193.0776)
nav agent[(26.35204, 0.396416, -99.63103), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.1337, -0.338807, -193.0739)
nav agent[(26.34401, 0.396416, -99.62788), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.12306, -0.338641, -193.0697)
nav agent[(26.3347, 0.396416, -99.62421), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.11115, -0.338454, -193.065)
nav agent[(26.32407, 0.396416, -99.62002), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.09792, -0.338248, -193.0598)
nav agent[(26.31216, 0.396416, -99.61533), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.0835, -0.338023, -193.0542)
nav agent[(26.29891, 0.396416, -99.61014), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.06779, -0.337777, -193.048)
nav agent[(26.28449, 0.396416, -99.60446), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.05091, -0.337513, -193.0414)
nav agent[(26.2688, 0.396416, -99.59827), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.03299, -0.337233, -193.0343)
nav agent[(26.25191, 0.396416, -99.59166), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(17.01382, -0.336934, -193.0268)
nav agent[(26.23399, 0.396416, -99.58458), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.99345, -0.336616, -193.0188)
nav agent[(26.21482, 0.396416, -99.57706), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.97194, -0.336279, -193.0103)
nav agent[(26.19444, 0.396416, -99.56905), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.94926, -0.335925, -193.0014)
nav agent[(26.17292, 0.396416, -99.5606), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.92554, -0.335554, -192.992)
nav agent[(26.15025, 0.396416, -99.55166), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.90068, -0.335166, -192.9823)
nav agent[(26.12655, 0.396416, -99.54234), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.87474, -0.334761, -192.9721)
nav agent[(26.10168, 0.396416, -99.53256), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.84771, -0.334338, -192.9614)
nav agent[(26.07574, 0.396416, -99.52235), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.81982, -0.333902, -192.9505)
nav agent[(26.04871, 0.396416, -99.51172), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.79089, -0.33345, -192.9391)
nav agent[(26.02081, 0.396416, -99.50075), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.76106, -0.332984, -192.9273)
nav agent[(25.99188, 0.396416, -99.48938), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.73029, -0.332504, -192.9153)
nav agent[(25.96207, 0.396416, -99.47764), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.69861, -0.332009, -192.9028)
nav agent[(25.93129, 0.396416, -99.46555), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.66614, -0.331501, -192.89)
nav agent[(25.89962, 0.396416, -99.45308), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.63279, -0.33098, -192.8769)
nav agent[(25.86714, 0.396416, -99.44031), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.59853, -0.330445, -192.8634)
nav agent[(25.8338, 0.396416, -99.4272), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.5634, -0.329896, -192.8496)
nav agent[(25.79955, 0.396416, -99.41372), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.52736, -0.329333, -192.8354)
nav agent[(25.76441, 0.396416, -99.3999), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.49047, -0.328757, -192.8209)
nav agent[(25.72837, 0.396416, -99.38573), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.45289, -0.328169, -192.8062)
nav agent[(25.69148, 0.396416, -99.37123), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.41452, -0.32757, -192.791)
nav agent[(25.6539, 0.396416, -99.35645), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.37534, -0.326958, -192.7756)
nav agent[(25.61552, 0.396416, -99.34136), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.33528, -0.326332, -192.7599)
nav agent[(25.57635, 0.396416, -99.32594), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.29448, -0.325694, -192.7438)
nav agent[(25.53629, 0.396416, -99.31018), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.25294, -0.325045, -192.7275)
nav agent[(25.49548, 0.396416, -99.29413), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.2107, -0.324385, -192.7109)
nav agent[(25.45395, 0.396416, -99.27781), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.16785, -0.323716, -192.694)
nav agent[(25.41171, 0.396416, -99.26118), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.12422, -0.323034, -192.6769)
nav agent[(25.36886, 0.396416, -99.24432), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.08, -0.322343, -192.6595)
nav agent[(25.32522, 0.396416, -99.22717), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(16.03516, -0.321643, -192.6418)
nav agent[(25.281, 0.396416, -99.20975), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.98964, -0.320931, -192.6239)
nav agent[(25.23615, 0.396416, -99.19213), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.94345, -0.32021, -192.6058)
nav agent[(25.19063, 0.396416, -99.17422), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.89668, -0.319479, -192.5874)
nav agent[(25.14445, 0.396416, -99.15605), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.84916, -0.318736, -192.5687)
nav agent[(25.09767, 0.396416, -99.13766), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.80102, -0.317984, -192.5497)
nav agent[(25.05017, 0.396416, -99.11896), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.75239, -0.317224, -192.5306)
nav agent[(25.00202, 0.396416, -99.10003), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.70323, -0.316456, -192.5113)
nav agent[(24.95338, 0.396416, -99.0809), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.65342, -0.315678, -192.4917)
nav agent[(24.90423, 0.396416, -99.06156), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.60314, -0.314892, -192.4719)
nav agent[(24.85442, 0.396416, -99.04198), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.55237, -0.314099, -192.4519)
nav agent[(24.80413, 0.396416, -99.0222), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.5011, -0.313298, -192.4318)
nav agent[(24.75338, 0.396416, -99.00221), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.44932, -0.312489, -192.4114)
nav agent[(24.7021, 0.396416, -98.98208), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.39709, -0.311673, -192.3909)
nav agent[(24.65032, 0.396416, -98.9617), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.34434, -0.310849, -192.3701)
nav agent[(24.59808, 0.396416, -98.94115), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.29104, -0.310016, -192.3492)
nav agent[(24.54534, 0.396416, -98.92041), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.23726, -0.309176, -192.328)
nav agent[(24.49203, 0.396416, -98.89944), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.18295, -0.308327, -192.3066)
nav agent[(24.43827, 0.396416, -98.8783), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.12818, -0.307471, -192.2851)
nav agent[(24.38396, 0.396416, -98.85694), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.07291, -0.306608, -192.2634)
nav agent[(24.32918, 0.396416, -98.83539), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(15.01704, -0.305735, -192.2414)
nav agent[(24.27391, 0.396416, -98.81365), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.96067, -0.304854, -192.2192)
nav agent[(24.21804, 0.396416, -98.79167), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.90388, -0.303967, -192.1969)
nav agent[(24.16167, 0.396416, -98.76949), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.8467, -0.303073, -192.1744)
nav agent[(24.10489, 0.396416, -98.74717), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.78911, -0.302173, -192.1517)
nav agent[(24.04771, 0.396416, -98.7247), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.73111, -0.301267, -192.1289)
nav agent[(23.9901, 0.396416, -98.70204), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.67271, -0.300355, -192.106)
nav agent[(23.93211, 0.396416, -98.67921), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.61393, -0.299436, -192.0828)
nav agent[(23.87371, 0.396416, -98.65625), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.55468, -0.298511, -192.0595)
nav agent[(23.81493, 0.396416, -98.63313), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.49511, -0.29758, -192.0361)
nav agent[(23.75568, 0.396416, -98.60982), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.4351, -0.296642, -192.0125)
nav agent[(23.69611, 0.396416, -98.5864), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.37475, -0.295699, -191.9888)
nav agent[(23.6361, 0.396416, -98.56279), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.31391, -0.294749, -191.9648)
nav agent[(23.57574, 0.396416, -98.53905), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.25272, -0.293793, -191.9408)
nav agent[(23.51491, 0.396416, -98.51513), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.19125, -0.292832, -191.9166)
nav agent[(23.45372, 0.396416, -98.49105), (-2.725342, 0.396416, -88.19379), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.12946, -0.291867, -191.8923)
nav agent[(23.39225, 0.396416, -98.46689), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.06729, -0.290895, -191.8678)
nav agent[(23.33046, 0.396416, -98.44259), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]
vehicle pos(14.00483, -0.289919, -191.8433)
nav agent[(23.2683, 0.396416, -98.41811), (-2.725327, 0.396416, -88.19385), (-9.201026, 0.396416, -85.64673)]
vehicle pos(13.94195, -0.288937, -191.8185)
nav agent[(23.20581, 0.396416, -98.39355), (-2.725327, 0.396416, -88.19391), (-9.201026, 0.396416, -85.64673)]

How can I get the ā€œrealā€ position of this Vehicle node?

@zdrmlpzdrmlp so while debugging I put the print_rich("[color=green]" + str("vehicle pos") + str(vehicle.global_transform.origin) + "[/color]") in the vehicleā€™s .gd and I am able to get the correct pos to print!

So now I need to figure out why the zombie.gd canā€™t get the vehicleā€™s correct posā€¦

any thoughts?

this alone means the target position is not correct

how about changing this line to

var direction = nav_agent.get_next_path_position()-to_global(position)