This commit is contained in:
2025-11-28 15:55:42 -06:00
parent 5573ad815f
commit 5805ac2260
9 changed files with 64 additions and 33 deletions

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=8 format=3 uid="uid://kabs7mopalmo"]
[gd_scene load_steps=9 format=3 uid="uid://kabs7mopalmo"]
[ext_resource type="Script" uid="uid://crw7ls7t8cwct" path="res://entity/npc/NPC.gd" id="1_00k55"]
[ext_resource type="Script" uid="uid://b00rxpveu3v4m" path="res://InteractableArea.gd" id="2_x8luf"]
[ext_resource type="Script" uid="uid://tlfthv88ki0y" path="res://entity/npc/NPCMovement.gd" id="3_1seh5"]
[ext_resource type="Script" uid="uid://dunhfgdwp8wjh" path="res://entity/npc/NPCInteract.gd" id="3_binvk"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_jphom"]
@@ -15,12 +16,12 @@ shading_mode = 0
[sub_resource type="CapsuleMesh" id="CapsuleMesh_jphom"]
material = SubResource("StandardMaterial3D_jphom")
[node name="NPC" type="CharacterBody3D" node_paths=PackedStringArray("_movement")]
[node name="NPC" type="CharacterBody3D" node_paths=PackedStringArray("_movement", "_interact")]
script = ExtResource("1_00k55")
facingDirection = null
walkSpeed = null
runSpeed = null
_movement = NodePath("Scripts/NPCMovement")
_interact = NodePath("Scripts/NPCInteract")
walkSpeed = 8.0
runSpeed = 12.0
[node name="Scripts" type="Node" parent="."]
@@ -28,6 +29,10 @@ _movement = NodePath("Scripts/NPCMovement")
script = ExtResource("3_1seh5")
body = NodePath("../..")
[node name="NPCInteract" type="Node" parent="Scripts"]
script = ExtResource("3_binvk")
metadata/_custom_type_script = "uid://dunhfgdwp8wjh"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_jphom")
@@ -45,4 +50,6 @@ shape = SubResource("BoxShape3D_jphom")
mesh = SubResource("CapsuleMesh_jphom")
skeleton = NodePath("../..")
[connection signal="interactEvent" from="Rotate/InteractableArea" to="." method="onInteract"]
[connection signal="interactEvent" from="Rotate/InteractableArea" to="Scripts/NPCInteract" method="onInteract"]
[connection signal="interactable" from="Rotate/InteractableArea" to="Scripts/NPCInteract" method="onInteractable"]
[connection signal="notInteractable" from="Rotate/InteractableArea" to="Scripts/NPCInteract" method="onNotInteractable"]