fixed attack in state machine

This commit is contained in:
Derek
2025-04-21 22:58:54 -05:00
parent 18398e8d4e
commit 362b0a5708
8 changed files with 54 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=77 format=4 uid="uid://djr7vnr1hcx82"]
[gd_scene load_steps=78 format=4 uid="uid://djr7vnr1hcx82"]
[ext_resource type="Script" uid="uid://cdofgtwevbray" path="res://scripts/spider.gd" id="1_7e7fe"]
[ext_resource type="PackedScene" uid="uid://h5ojldugfyyu" path="res://assets/bullet_enemy.tscn" id="2_aew5r"]
@@ -792,6 +792,10 @@ _surfaces = [{
[sub_resource type="BoxShape3D" id="BoxShape3D_xxx55"]
size = Vector3(0.816284, 0.725159, 0.75531)
[sub_resource type="CylinderShape3D" id="CylinderShape3D_gicen"]
height = 0.356583
radius = 0.207031
[node name="spider" type="CharacterBody3D" node_paths=PackedStringArray("nav_agent") groups=["enemy", "persist"]]
collision_layer = 8
collision_mask = 521
@@ -825,8 +829,10 @@ script = ExtResource("9_6mvds")
enemy = NodePath("../..")
metadata/_custom_type_script = "uid://dhxolagi0b5s1"
[node name="Attack" type="Node" parent="StateMachine"]
[node name="Attack" type="Node" parent="StateMachine" node_paths=PackedStringArray("enemy", "enemy_targets")]
script = ExtResource("10_gicen")
enemy = NodePath("../..")
enemy_targets = [NodePath("../../body/backTarget")]
[node name="HealthBarSprite" parent="." node_paths=PackedStringArray("character") instance=ExtResource("7_87l3v")]
transform = Transform3D(0.254412, 0, 0, 0, 0.561068, 0, 0, 0, 1, 0, 2.41498, 0)
@@ -1016,6 +1022,10 @@ visible = false
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0258179, 1.03281, 0.00894165)
shape = SubResource("BoxShape3D_xxx55")
[node name="CollisionShape3D2" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5049, 0)
shape = SubResource("CylinderShape3D_gicen")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
path_height_offset = 0.5
avoidance_enabled = true