Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • master
2 results

enemy.tscn

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    enemy.tscn 1.34 KiB
    [gd_scene load_steps=5 format=3 uid="uid://dxak1fnnmyn47"]
    
    [ext_resource type="Script" path="res://enemy.gd" id="1_ob2in"]
    
    [sub_resource type="CapsuleMesh" id="CapsuleMesh_d21ya"]
    
    [sub_resource type="PrismMesh" id="PrismMesh_hljx8"]
    
    [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_i14rq"]
    
    [node name="enemy" type="CharacterBody3D"]
    script = ExtResource("1_ob2in")
    
    [node name="body" type="MeshInstance3D" parent="."]
    unique_name_in_owner = true
    mesh = SubResource("CapsuleMesh_d21ya")
    
    [node name="nose" type="MeshInstance3D" parent="body"]
    unique_name_in_owner = true
    transform = Transform3D(0.25, 0, 0, 0, -1.09278e-08, 0.25, 0, -0.25, -1.09278e-08, 0, 0.35, -0.5)
    mesh = SubResource("PrismMesh_hljx8")
    
    [node name="CollisionShape3D" type="CollisionShape3D" parent="."]
    shape = SubResource("CapsuleShape3D_i14rq")
    
    [node name="gun" type="Marker3D" parent="."]
    transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.07, -0.75)
    
    [node name="sight" type="RayCast3D" parent="."]
    transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
    target_position = Vector3(0, -10, 0)
    collision_mask = 3
    
    [node name="engaged" type="Timer" parent="."]
    wait_time = 3.0
    
    [node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
    avoidance_enabled = true
    
    [connection signal="timeout" from="engaged" to="." method="_on_engaged_timeout"]