Now About Social Code
summaryrefslogtreecommitdiff
path: root/prefabs/enemy.tscn
blob: 415b9b8b6713b602292374d119079d29216269af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[gd_scene load_steps=6 format=3 uid="uid://cuad3khwmhnsa"]

[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_aut2k"]

[sub_resource type="CapsuleMesh" id="CapsuleMesh_xh601"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7r0x4"]

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_s5qw4"]

[sub_resource type="BoxShape3D" id="BoxShape3D_cyd43"]
size = Vector3(20, 2, 20)

[node name="Enemy" type="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.54414, -1.58742)
motion_mode = 1
wall_min_slide_angle = 0.0872665
script = ExtResource("1_aut2k")

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
mesh = SubResource("CapsuleMesh_xh601")
surface_material_override/0 = SubResource("StandardMaterial3D_7r0x4")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_s5qw4")

[node name="HitTimer" type="Timer" parent="."]
wait_time = 0.2

[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]

[node name="VisionVolume" type="Area3D" parent="."]
collision_layer = 4
collision_mask = 4
input_ray_pickable = false

[node name="VisionVolumeShape" type="CollisionShape3D" parent="VisionVolume"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("BoxShape3D_cyd43")

[connection signal="timeout" from="HitTimer" to="." method="_on_hit_timer_timeout"]
[connection signal="body_entered" from="VisionVolume" to="." method="_on_body_entered"]
[connection signal="body_exited" from="VisionVolume" to="." method="_on_body_exited"]