Node origin and target are in same position, look at () failed Godot 4.3

Godot Version

4.3

Question

So i have dug over in the forums for a solution to my problem when this error pops up. i’ve added the “if not global_transform.origin.is_equal_approx(next_nav_point):” (the object is supposed to look at the nav point in the navigation region) and this works for most of the time EXCEPT to when the object is not moving (like at the start of the program) how can i fix this?

			nav_agent.set_target_position(player.global_position)
			var next_nav_point = nav_agent.get_next_path_position()
			velocity = (next_nav_point - global_position).normalized() * SPEED * runSPEED
			move_and_slide()
			if not global_transform.origin.is_equal_approx(next_nav_point):
				look_at(Vector3(next_nav_point.x, global_position.y, next_nav_point.z), Vector3.UP)

You’re actually not comparing origin to the lookat target.
Your lookat target is Vector3(next_nav_point.x, global_position.y, next_nav_point.z), but you compare to next_nav_point