Hi On map scene i have two enemies (Kinemtaic) First one that I copied works fine He follows the path on map I placed second almost the same enemy scene on map with his FollowPath But he doesn't move And don't get it why
here is the code
extends "res://Scene_templates/tank_script.gd"
onready var parent=get_parent()
export (float) var turret_speed
export (int) var detect_radius
var target=null
func _ready():
$Detect/Radius.shape.radius=detect_radius
func control(delta):
if parent is PathFollow2D:
parent.set_offset(parent.get_offset()+speed*delta)
position=Vector2()
else:
#other move code
pass
func _process(delta):
if target:
var target_dir=(target.global_position-global_position).normalized()
var current_dir=Vector2(1,0).rotated($Turret.global_rotation)
$Turret.global_rotation=current_dir.linear_interpolate(target_dir,turret_speed*delta).angle()
func _on_Detect_body_entered(body):
if body.name=="Player":
target=body
func _on_Detect_body_exited(body):
if body==target:
target=null
here is structure
