Fix the aiming and bullet creation

This commit is contained in:
2025-02-01 18:03:00 +01:00
parent 33f1d57a50
commit bd91818682
19 changed files with 334 additions and 8089 deletions

View File

@ -20,6 +20,11 @@ func _on_head_collision_body_part_hit(dam: Variant) -> void:
owner_placeholder.take_damage(dam)
pass # Replace with function body.
func _hit_detected(dam: Variant) -> void:
print("hit detected")
if owner_placeholder:
owner_placeholder.take_damage(dam)
func _get_owner() -> CharacterBody3D:
var owner_placeholder := find_parent("PlayerPlaceholder*")
return owner_placeholder

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=28 format=4 uid="uid://1txob6jskn5s"]
[ext_resource type="Script" path="res://scenes/characters/blue/dummy.gd" id="1_cyeub"]
[ext_resource type="Script" path="res://scenes/characters/blue/head_collision.gd" id="1_lianf"]
[ext_resource type="Script" path="res://scenes/characters/blue/hit_collision.gd" id="2_jsfjb"]
[ext_resource type="PackedScene" uid="uid://dab7jttp7ywfh" path="res://scenes/weapon/guns/ak/gun.tscn" id="3_div6m"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gqjtb"]
resource_name = "Alpha_Joints_MAT"
@ -258,8 +259,6 @@ blend_shape_mode = 0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_j3emx"]
albedo_color = Color(0, 0, 1, 1)
[sub_resource type="SphereShape3D" id="SphereShape3D_axep3"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_0ptuo"]
radius = 11.7055
height = 28.953
@ -936,7 +935,7 @@ script = ExtResource("1_cyeub")
[node name="Armature" type="Node3D" parent="Body"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, -0.01, 0, 0.01, -4.37114e-10, 0, 0, 0)
[node name="Skeleton3D" type="Skeleton3D" parent="Body/Armature"]
[node name="Skeleton3D" type="Skeleton3D" parent="Body/Armature" groups=["target"]]
bones/0/name = "mixamorig_Hips"
bones/0/parent = -1
bones/0/rest = Transform3D(1, -8.78096e-05, -2.78699e-06, 2.78699e-06, 0, 1, -8.78096e-05, -1, 0, -6.75701e-06, 4.84474e-05, -99.7919)
@ -1402,29 +1401,15 @@ mesh = SubResource("ArrayMesh_8h4ki")
skin = SubResource("Skin_hwx5g")
surface_material_override/0 = SubResource("StandardMaterial3D_j3emx")
[node name="HitCollisions" type="Node3D" parent="Body/Armature/Skeleton3D"]
[node name="PhysicalBoneSimulator3D" type="PhysicalBoneSimulator3D" parent="Body/Armature/Skeleton3D" groups=["target"]]
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="Body/Armature/Skeleton3D"]
transform = Transform3D(0.978017, -0.176546, -0.110973, 0.15839, 0.282801, 0.946011, -0.135631, -0.942791, 0.304547, -11.8203, 17.7472, -135.936)
bone_name = "mixamorig_Head"
bone_idx = 5
[node name="HeadCollision" type="Area3D" parent="Body/Armature/Skeleton3D/BoneAttachment3D" groups=["body"]]
transform = Transform3D(9.90229, 1.3945, -6.09554e-08, 0, -4.37114e-07, -10, -1.3945, 9.90229, -4.32843e-07, 0.58762, 7.43451, 1.4646)
script = ExtResource("1_lianf")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/BoneAttachment3D/HeadCollision"]
shape = SubResource("SphereShape3D_axep3")
[node name="PhysicalBoneSimulator3D" type="PhysicalBoneSimulator3D" parent="Body/Armature/Skeleton3D"]
[node name="Physical Bone mixamorig_Hips" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(82.5044, -54.0559, -16.4615, 55.0482, 83.4649, 1.8195, 12.756, -10.5629, 98.619, 1.31498, 0.290625, -87.4646)
collision_layer = 4
collision_mask = 4
[node name="Physical Bone mixamorig_Hips" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D" groups=["target"]]
transform = Transform3D(82.5044, -54.0559, -16.4615, 55.0482, 83.4649, 1.8195, 12.756, -10.5629, 98.619, 1.315, 0.290634, -87.4646)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.11306e-07, -5.58794e-09, 0.0499956)
body_offset = Transform3D(100, -0.0695305, -0.00860918, -1.4782e-05, 12.2744, -99.2438, 0.0700493, 99.2438, 12.2744, 0.000441551, 4.96175, -0.613665)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.49711e-07, -1.76951e-08, 0.0499957)
body_offset = Transform3D(100, -0.069519, -0.00861847, -2.6226e-05, 12.2744, -99.2438, 0.0700493, 99.2438, 12.2744, 0.000455856, 4.96176, -0.613665)
mass = 20.0
bone_name = "mixamorig_Hips"
joint_constraints/bias = 0.3
@ -1436,12 +1421,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1
shape = SubResource("CapsuleShape3D_0ptuo")
[node name="Physical Bone mixamorig_Spine" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(80.9412, -58.546, -4.56913, 57.6046, 80.6695, -13.1964, 11.4119, 8.04929, 99.0201, 2.40599, 0.973749, -98.2036)
collision_layer = 4
collision_mask = 4
transform = Transform3D(80.9412, -58.546, -4.56914, 57.6046, 80.6695, -13.1964, 11.4119, 8.04927, 99.0201, 2.40599, 0.973749, -98.2036)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.10332e-09, 5.59426e-10, 0.05866)
body_offset = Transform3D(100, 7.62939e-06, 1.09673e-05, 4.76837e-06, 0, -100, -1.52588e-05, 100, -9.53674e-07, -9.53674e-07, 5.866, 0)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.35753e-08, 1.01227e-08, 0.0586602)
body_offset = Transform3D(100, 1.52588e-05, 8.58307e-06, 4.76837e-06, 1.81198e-05, -100, -1.52588e-05, 100, 1.52588e-05, -2.86102e-06, 5.86602, -1.90735e-06)
mass = 20.0
bone_name = "mixamorig_Spine"
joint_constraints/bias = 0.3
@ -1452,30 +1437,31 @@ joint_constraints/impulse_clamp = 0.0
transform = Transform3D(0.0318071, 3.86358e-14, 4.9738e-14, -2.13163e-14, -1.62981e-09, 0.0318071, -4.26326e-14, -0.0318071, -1.62981e-09, -0.00245133, -5.91656e-09, -0.223859)
shape = SubResource("CapsuleShape3D_126jt")
[node name="Physical Bone mixamorig_Head" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
[node name="Physical Bone mixamorig_Head" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D" groups=["target"]]
transform = Transform3D(-97.8019, 4.47329, 20.366, -15.8369, -79.4709, -58.5966, 13.5638, -60.5339, 78.4325, -13.8193, 23.4986, -143.635)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.71765e-08, -1.39698e-07, 0.0981531)
body_offset = Transform3D(-100, -0.00220013, -0.000778198, -5.24521e-06, 33.8066, -94.1122, 0.00232792, -94.1122, -33.8066, 6.86646e-05, 9.23741, 3.31821)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.39306e-07, 5.02914e-08, 0.0981532)
body_offset = Transform3D(-100, -0.00220013, -0.000778198, -5.24521e-06, 33.8066, -94.1122, 0.00232792, -94.1122, -33.8066, 5.24521e-05, 9.23741, 3.31823)
mass = 7.0
bone_name = "mixamorig_Head"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
joint_constraints/impulse_clamp = 0.0
script = ExtResource("2_jsfjb")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_Head"]
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D/Physical Bone mixamorig_Head" groups=["target"]]
transform = Transform3D(0.0099, 2.91038e-10, 0, -3.49246e-10, 9.31323e-10, 0.0099, 1.16415e-10, -0.0099, 4.65661e-10, 0, 0, 0)
shape = SubResource("CapsuleShape3D_1gw5y")
[node name="Physical Bone mixamorig_LeftArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(86.1165, 14.0252, -48.8594, -45.4995, 64.1262, -61.787, 22.6659, 75.4395, 61.6046, 16.1942, 31.0309, -132.592)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.17137e-09, 2.34109e-07, 0.137023)
body_offset = Transform3D(100, -4.19617e-05, -2.47955e-05, 2.86102e-05, 100, -3.8147e-06, 1.71661e-05, -3.8147e-06, 100, 3.8147e-06, -2.28882e-05, -13.7023)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.30788e-08, 1.57815e-07, 0.137023)
body_offset = Transform3D(100, -6.48499e-05, -2.28882e-05, 5.34058e-05, 100, -3.8147e-06, 1.52588e-05, 3.8147e-06, 100, 1.14441e-05, -1.52588e-05, -13.7023)
mass = 3.0
bone_name = "mixamorig_LeftArm"
joint_constraints/bias = 0.3
@ -1488,11 +1474,11 @@ shape = SubResource("CapsuleShape3D_krlof")
[node name="Physical Bone mixamorig_LeftForeArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-48.2566, -12.058, 86.752, -78.7312, -37.4258, -48.997, 38.3757, -91.9452, 8.56699, 1.36484, 46.9033, -104.66)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.99827e-07, 6.04928e-08, 0.138072)
body_offset = Transform3D(100, 3.05176e-05, -4.19617e-05, -3.8147e-05, 0, -100, -3.8147e-06, 100, 1.14441e-05, 4.57764e-05, 13.8072, -7.62939e-06)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.57682e-07, -1.58011e-08, 0.138072)
body_offset = Transform3D(100, 3.05176e-05, -3.8147e-05, -3.8147e-05, 0, -100, -3.8147e-06, 100, 1.14441e-05, 6.10352e-05, 13.8072, 0)
mass = 3.0
bone_name = "mixamorig_LeftForeArm"
joint_constraints/bias = 0.3
@ -1504,12 +1490,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1
shape = SubResource("CapsuleShape3D_2k34c")
[node name="Physical Bone mixamorig_LeftHand" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(9.11563, -98.6768, 13.4089, 23.9481, -10.8976, -96.4766, 96.6612, 12.0056, 22.6379, -10.9685, 56.2242, -106.442)
collision_layer = 4
collision_mask = 4
transform = Transform3D(9.11563, -98.6768, 13.4089, 23.9482, -10.8976, -96.4766, 96.6612, 12.0056, 22.6379, -10.9684, 56.2242, -106.442)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.24797e-07, -1.22003e-07, 0.0264902)
body_offset = Transform3D(-58.5197, 57.9894, 56.6805, 1.62125e-05, 69.899, -71.5132, -81.0891, -41.8493, -40.9047, -1.50148, 1.89441, 1.08356)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.37722e-08, -9.77889e-09, 0.0264902)
body_offset = Transform3D(-58.5197, 57.9894, 56.6805, 2.19345e-05, 69.899, -71.5132, -81.0891, -41.8493, -40.9047, -1.50148, 1.8944, 1.08357)
bone_name = "mixamorig_LeftHand"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
@ -1521,8 +1507,8 @@ shape = SubResource("CapsuleShape3D_5fgdh")
[node name="Physical Bone mixamorig_RightArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(30.7246, 72.8896, 61.1809, 93.7855, -34.092, -6.48192, 16.1331, 59.3704, -78.8345, -27.5296, -1.29566, -110.13)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.63344e-08, 1.16326e-07, 0.137023)
body_offset = Transform3D(100, -5.72205e-06, 1.19209e-05, 6.67572e-06, 1.07288e-05, -100, -1.90735e-06, 100, 2.64645e-05, 0, 13.7023, -1.52588e-05)
@ -1537,12 +1523,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1
shape = SubResource("CapsuleShape3D_8vkyv")
[node name="Physical Bone mixamorig_RightForeArm" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(24.3552, 37.4063, 89.4852, -25.0101, 91.5653, -31.4688, -93.7087, -14.716, 31.6563, -48.2682, 3.93749, -103.698)
collision_layer = 4
collision_mask = 4
transform = Transform3D(24.3552, 37.4063, 89.4852, -25.0101, 91.5653, -31.4688, -93.7087, -14.716, 31.6563, -48.2682, 3.9375, -103.698)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.40737e-07, -5.19106e-08, 0.138072)
body_offset = Transform3D(100, -1.14441e-05, 8.58307e-06, -3.8147e-06, 100, 9.53674e-06, 5.72205e-06, -5.72205e-06, 100, -1.52588e-05, 3.8743e-06, -13.8072)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.53905e-07, -1.44255e-07, 0.138072)
body_offset = Transform3D(100, 9.53674e-06, -9.53674e-07, -2.67029e-05, 100, 2.28882e-05, 1.7643e-05, -2.47955e-05, 100, -1.52588e-05, 1.12653e-05, -13.8072)
mass = 3.0
bone_name = "mixamorig_RightForeArm"
joint_constraints/bias = 0.3
@ -1554,12 +1540,12 @@ transform = Transform3D(0.01, 0, 0, 0, 0.00999714, -0.000239087, 0, 0.000239087,
shape = SubResource("CapsuleShape3D_fh1k4")
[node name="Physical Bone mixamorig_RightHand" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(89.0767, -24.8074, -38.0781, 5.05123, 88.6726, -45.9527, 45.1645, 39.0097, 80.2397, -24.5746, 26.0951, -105.517)
collision_layer = 4
collision_mask = 4
transform = Transform3D(89.0767, -24.8074, -38.0781, 5.05123, 88.6726, -45.9527, 45.1645, 39.0097, 80.2397, -24.5745, 26.0951, -105.517)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.86265e-08, 2.30502e-07, 0.0264903)
body_offset = Transform3D(-58.5197, -57.9893, -56.6805, -1.33514e-05, 69.8991, -71.5131, 81.0891, -41.8492, -40.9048, 1.5015, 1.89439, 1.08359)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.43424e-07, 3.14321e-07, 0.0264904)
body_offset = Transform3D(-58.5197, -57.9893, -56.6805, -1.33514e-05, 69.8991, -71.5131, 81.0891, -41.8492, -40.9048, 1.5015, 1.89439, 1.08361)
bone_name = "mixamorig_RightHand"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
@ -1570,12 +1556,12 @@ transform = Transform3D(0.01, 0, 0, 0, 0.00693402, 0.00720551, 0, -0.00720551, 0
shape = SubResource("CapsuleShape3D_1m8r5")
[node name="Physical Bone mixamorig_LeftUpLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-96.1774, -26.2683, 7.73901, -23.4203, 64.2554, -72.957, 14.1919, -71.9807, -67.9513, 5.83707, 19.601, -60.9754)
collision_layer = 4
collision_mask = 4
transform = Transform3D(-96.1774, -26.2683, 7.73898, -23.4202, 64.2555, -72.957, 14.1919, -71.9806, -67.9513, 5.83708, 19.601, -60.9754)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.78612e-08, -7.74374e-09, 0.202997)
body_offset = Transform3D(100, -4.3869e-05, 9.53674e-06, 9.53674e-06, 7.62939e-06, -100, 4.673e-05, 100, 3.8147e-06, -5.72205e-06, 20.2997, 0)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.02254e-07, -1.71497e-09, 0.202997)
body_offset = Transform3D(100, -7.34329e-05, 2.47955e-05, 2.09808e-05, 6.10352e-05, -100, 7.53403e-05, 100, 5.72205e-05, -1.52588e-05, 20.2997, -1.14441e-05)
mass = 5.0
bone_name = "mixamorig_LeftUpLeg"
joint_constraints/bias = 0.3
@ -1588,11 +1574,11 @@ shape = SubResource("CapsuleShape3D_3cygo")
[node name="Physical Bone mixamorig_LeftLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-97.5216, -11.6193, -18.8291, -22.0483, 58.1427, 78.3154, 1.84805, 80.5259, -59.2635, 8.22949, 17.9261, -34.7068)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.03053e-09, -1.30455e-08, 0.210495)
body_offset = Transform3D(100, 4.76837e-06, 1.33514e-05, 5.72205e-06, 0, -100, -9.53674e-07, 100, 1.52588e-05, -1.90735e-06, 21.0495, -1.90735e-06)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.01576e-09, -2.10753e-08, 0.210495)
body_offset = Transform3D(100, 4.76837e-06, 1.14441e-05, 5.72205e-06, 0, -100, -9.53674e-07, 100, 1.90735e-05, -1.90735e-06, 21.0495, -1.90735e-06)
mass = 5.0
bone_name = "mixamorig_LeftLeg"
joint_constraints/bias = 0.3
@ -1605,11 +1591,11 @@ shape = SubResource("CapsuleShape3D_vwdij")
[node name="Physical Bone mixamorig_LeftFoot" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-93.6712, -34.5296, 5.78095, -34.9451, 91.207, -21.4506, 2.13419, -22.1132, -97.501, 11.7385, 3.12728, -14.5678)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.41225e-09, 7.07881e-08, 0.078608)
body_offset = Transform3D(100, 5.72205e-06, -1.43051e-06, -9.53674e-07, -1.52588e-05, -100, -5.72205e-06, 100, -3.24249e-05, 9.53674e-07, 7.8608, -4.52995e-06)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.91287e-09, 1.35505e-07, 0.0786082)
body_offset = Transform3D(100, 2.86102e-05, 3.33786e-06, 4.29153e-06, -2.47955e-05, -100, -2.28882e-05, 100, -4.19617e-05, -9.53674e-07, 7.86082, -1.0252e-05)
bone_name = "mixamorig_LeftFoot"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
@ -1621,11 +1607,11 @@ shape = SubResource("CapsuleShape3D_qyg6j")
[node name="Physical Bone mixamorig_RightUpLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-83.6898, -51.5224, 18.4786, -50.5592, 59.8312, -62.161, 20.9708, -61.3651, -76.122, -11.4062, 7.37456, -61.646)
collision_layer = 4
collision_mask = 4
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31228e-08, 7.74372e-09, 0.202997)
body_offset = Transform3D(100, -1.52588e-05, 7.62939e-06, 5.72205e-06, -3.8147e-06, -100, 1.14441e-05, 100, -3.8147e-06, -2.86102e-06, 20.2997, 0)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08665e-08, 2.32312e-08, 0.202997)
body_offset = Transform3D(100, -1.52588e-05, 3.8147e-06, 5.72205e-06, -1.14441e-05, -100, 1.14441e-05, 100, -1.14441e-05, -2.86102e-06, 20.2997, 0)
mass = 5.0
bone_name = "mixamorig_RightUpLeg"
joint_constraints/bias = 0.3
@ -1637,12 +1623,12 @@ transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-1
shape = SubResource("CapsuleShape3D_a81km")
[node name="Physical Bone mixamorig_RightLeg" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-91.8175, -23.5086, -31.8888, -36.0103, 83.0805, 42.437, 16.517, 50.4478, -84.7479, -8.44487, 11.0604, -28.3544)
collision_layer = 4
collision_mask = 4
transform = Transform3D(-91.8175, -23.5086, -31.8888, -36.0102, 83.0805, 42.437, 16.517, 50.4478, -84.7479, -8.44487, 11.0604, -28.3544)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.48112e-08, -2.68514e-07, 0.210495)
body_offset = Transform3D(100, -1.71661e-05, 1.33514e-05, -9.53674e-07, 4.19617e-05, -100, 1.90735e-05, 100, 6.86646e-05, -4.29153e-06, 21.0495, 1.23978e-05)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.05739e-08, -3.49823e-07, 0.210495)
body_offset = Transform3D(100, -4.00543e-05, 1.33514e-05, 2.86102e-06, 6.10352e-05, -100, 4.57764e-05, 100, 8.01086e-05, -7.86781e-06, 21.0495, 1.81198e-05)
mass = 5.0
bone_name = "mixamorig_RightLeg"
joint_constraints/bias = 0.3
@ -1653,13 +1639,13 @@ joint_constraints/impulse_clamp = 0.0
transform = Transform3D(0.01, 0, 0, 0, -4.37114e-10, 0.01, 0, -0.01, -4.37114e-10, 0, 0, 0)
shape = SubResource("CylinderShape3D_2binp")
[node name="Physical Bone mixamorig_RightFoot" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D"]
transform = Transform3D(-88.192, -17.3351, 43.8367, -46.8549, 42.4444, -77.4796, -5.17505, -88.8705, -45.5549, -5.17837, 8.21811, -6.93437)
collision_layer = 4
collision_mask = 4
[node name="Physical Bone mixamorig_RightFoot" type="PhysicalBone3D" parent="Body/Armature/Skeleton3D/PhysicalBoneSimulator3D" groups=["target"]]
transform = Transform3D(-88.192, -17.3351, 43.8368, -46.8549, 42.4444, -77.4796, -5.17505, -88.8705, -45.5549, -5.17837, 8.21811, -6.93437)
collision_layer = 8
collision_mask = 9
joint_type = 1
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.24153e-08, -2.70381e-09, 0.078608)
body_offset = Transform3D(100, 1.14441e-05, -7.62939e-06, -7.62939e-06, -1.90735e-05, -100, 0, 100, -5.72205e-05, 5.84126e-06, 7.8608, 4.76837e-06)
joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.6418e-08, 1.82867e-08, 0.078608)
body_offset = Transform3D(100, 1.33514e-05, -1.52588e-05, -7.62939e-06, -6.10352e-05, -100, 0, 100, -8.39233e-05, 5.84126e-06, 7.8608, 4.76837e-06)
bone_name = "mixamorig_RightFoot"
joint_constraints/bias = 0.3
joint_constraints/damping = 1.0
@ -1678,4 +1664,5 @@ libraries = {
"": SubResource("AnimationLibrary_dbxeu")
}
[connection signal="body_part_hit" from="Body/Armature/Skeleton3D/BoneAttachment3D/HeadCollision" to="." method="_on_head_collision_body_part_hit"]
[node name="Gun" parent="." instance=ExtResource("3_div6m")]
transform = Transform3D(-0.12, 0, 1.81195e-08, 0, 0.12, 0, -1.81195e-08, 0, -0.12, -0.176084, 1.11081, 0.405023)

View File

@ -1,10 +1,9 @@
extends Area3D
extends PhysicalBone3D
@export var damage_multiplexer: float = 2.0
@export var damage_multiplexer: float = 1.0
signal body_part_hit(damage: int)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@ -13,5 +12,6 @@ func _process(delta: float) -> void:
pass
func hit(base_damage: int):
print("HEAD")
var final_damage = round(base_damage * damage_multiplexer)
emit_signal("body_part_hit", final_damage)
$"../../../../.."._hit_detected(final_damage)