extends CharacterBody3D @export var speed = 2 @export var accel = 2 @onready var nav: NavigationAgent3D = $NavigationAgent3D @export var cam: Camera3D @export var navres: NavigationRegion3D @export var block: PackedScene var canMove var current = 0 var path: PackedVector3Array signal redid_navmesh var destroy: Array var rayOrigin= Vector3() var rayEnd= Vector3() var pathDone = true func _ready(): canMove = false destroy = Array() print("new drone!") func _physics_process(delta): var direction = Vector3() #if Input.is_action_just_pressed("left_click"): # _do_path(_click_intersect()) if Time.get_ticks_msec()> 20 && current < (path.size()-1) && canMove: var next = path[current+1] look_at(Vector3(next.x,global_position.y,next.z)) direction = next - global_position direction = direction.normalized() velocity = velocity.lerp(direction*speed, accel * delta); if self.position.distance_to(next)