Add player leveling up mechanic

This commit is contained in:
Nathan Chapman 2025-05-15 20:26:23 -06:00
parent 7b94a9ea6c
commit 3649a924e3
7 changed files with 331 additions and 185 deletions

View File

@ -15,6 +15,10 @@ run/main_scene="uid://dw0lbkh31rofd"
config/features=PackedStringArray("4.4", "Forward Plus") config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[global_group]
Player=""
[input] [input]
move_forward={ move_forward={

View File

@ -1,5 +1,4 @@
extends Resource class_name CharacterStats extends Resource
class_name CharacterStats
class Ability: class Ability:
var min_modifier: float var min_modifier: float
@ -13,10 +12,46 @@ class Ability:
min_modifier = min_mod min_modifier = min_mod
max_modifier = max_mod max_modifier = max_mod
var level: int = 1 func percentile_lerp(min_bound: float, max_bound: float) -> float:
var xp: int = 0 return lerp(min_bound, max_bound, score / 100.0)
var strength func get_modifier() -> float:
return percentile_lerp(min_modifier, max_modifier)
func inc() -> void:
score += randi_range(2, 5)
var level: int = 1
var xp: int = 0:
set(value):
xp = value
var boundary: int = perc_level_up_boundary()
while xp > boundary:
xp -= boundary
level_up()
boundary = perc_level_up_boundary()
# Damage bonus on attack
var strength: Ability = Ability.new(2.0, 12.0)
# Movement speed meters/second
var speed: Ability = Ability.new(3.0, 7.0) var speed: Ability = Ability.new(3.0, 7.0)
var endurance # HP bonus per level
var agility var endurance: Ability = Ability.new(5.0, 25.0)
# Crit chance
var agility: Ability = Ability.new(0.05, 0.25)
func level_up() -> void:
level += 1
strength.inc()
speed.inc()
endurance.inc()
agility.inc()
print("Leveled up!")
printt(strength.score, speed.score, endurance.score, agility.score)
func perc_level_up_boundary() -> int:
return int(50 * pow(1.2, level))
func cubic_level_up_boundary() -> int:
return int(50 + pow(level, 3))

View File

@ -20,37 +20,114 @@ shape = SubResource("CapsuleShape3D_r8u7w")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
[node name="Skeleton3D" parent="Rig/CharacterRig/GameRig" index="0"] [node name="Skeleton3D" parent="Rig/CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(1.40309e-14, 0.901895, -0.0481735) bones/0/position = Vector3(3.37508e-15, 0.891977, -0.0481736)
bones/2/rotation = Quaternion(0.00127488, -0.000365568, 0.00321358, 0.999994) bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
bones/3/rotation = Quaternion(-0.0936545, -0.000343194, 0.00852187, 0.995568) bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
bones/4/rotation = Quaternion(0.274532, 1.4825e-08, 9.21402e-08, 0.961578) bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
bones/6/rotation = Quaternion(-0.159355, -1.17331e-07, -2.11762e-08, 0.987221) bones/2/rotation = Quaternion(-0.0044224, -0.000457906, 0.00321564, 0.999985)
bones/7/position = Vector3(-3.93029e-08, 0.901894, -0.0481735) bones/3/position = Vector3(-2.01263e-09, 0.202058, -2.51457e-08)
bones/8/position = Vector3(-6.90278e-08, 0.901895, -0.0481735) bones/3/rotation = Quaternion(-0.0994256, -0.000418209, 0.00851803, 0.995009)
bones/9/position = Vector3(0.131144, 0.968099, -0.0351291) bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
bones/9/rotation = Quaternion(0.993444, 0.0206617, -0.0310487, 0.108066) bones/4/rotation = Quaternion(0.27885, 1.43128e-08, 9.57171e-08, 0.960335)
bones/11/rotation = Quaternion(0.412237, -0.000699455, 0.000316629, 0.911076) bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
bones/13/rotation = Quaternion(-0.748148, 0.0118728, 0.0243885, 0.662977) bones/6/rotation = Quaternion(-0.153719, -1.17816e-07, -1.81601e-08, 0.988115)
bones/15/position = Vector3(-0.131144, 0.968099, -0.0351291) bones/7/position = Vector3(-3.16074e-08, 0.891977, -0.0481735)
bones/15/rotation = Quaternion(0.974064, -0.00561789, 0.0274363, 0.224534) bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
bones/17/rotation = Quaternion(0.436839, 0.00324779, -0.00157742, 0.899532) bones/8/position = Vector3(-4.99993e-08, 0.891977, -0.0481735)
bones/19/rotation = Quaternion(-0.684949, -0.0281754, -0.000965934, 0.728045) bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
bones/21/position = Vector3(0.0251286, 1.43186, 0.0441791) bones/9/position = Vector3(0.131144, 0.958181, -0.0351291)
bones/21/rotation = Quaternion(-0.484633, -0.26158, -0.406374, 0.729087) bones/9/rotation = Quaternion(0.992485, 0.0211367, -0.0308257, 0.116517)
bones/22/position = Vector3(0.189651, 1.46953, -0.0186676) bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
bones/22/rotation = Quaternion(0.0391925, -0.161324, 0.974929, -0.148164) bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
bones/23/rotation = Quaternion(1.27927e-07, -0.0246489, 1.05251e-07, 0.999696) bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
bones/24/rotation = Quaternion(0.318849, -0.0246473, -0.019754, 0.947279) bones/11/rotation = Quaternion(0.431587, -0.000700556, 0.000335305, 0.902071)
bones/46/position = Vector3(-0.0113635, 1.43186, 0.0441791) bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
bones/46/rotation = Quaternion(-0.49662, 0.236695, 0.3896, 0.738618) bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
bones/47/position = Vector3(-0.171203, 1.47006, -0.0294488) bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
bones/47/rotation = Quaternion(-0.0518339, -0.140858, 0.974736, 0.165415) bones/13/rotation = Quaternion(-0.756684, 0.0119043, 0.0244322, 0.653216)
bones/48/rotation = Quaternion(1.45659e-08, 0.029473, -1.73869e-08, 0.999566) bones/14/position = Vector3(-3.05481e-08, 0.139877, 1.64787e-08)
bones/49/rotation = Quaternion(0.354693, 0.0294744, 0.0289141, 0.934071) bones/14/rotation = Quaternion(-9.66743e-05, 0.967474, -0.252972, -0.000383447)
bones/71/position = Vector3(0.127191, 1.35125, -0.0256549) bones/15/position = Vector3(-0.131144, 0.958181, -0.0351291)
bones/71/rotation = Quaternion(1.96829e-08, 0.607586, 0.794254, -4.62127e-08) bones/15/rotation = Quaternion(0.972153, -0.00597679, 0.0271866, 0.232687)
bones/72/position = Vector3(-0.113426, 1.35125, -0.025655) bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-08)
bones/72/rotation = Quaternion(1.96835e-08, 0.60758, 0.794259, -4.62121e-08) bones/16/rotation = Quaternion(-3.43227e-08, 0.00314323, 8.33075e-10, 0.999995)
bones/17/position = Vector3(1.83545e-08, 0.265705, 6.98543e-10)
bones/17/rotation = Quaternion(0.454918, 0.0033546, -0.00171376, 0.890526)
bones/18/position = Vector3(1.2807e-08, 0.225719, -8.28774e-09)
bones/18/rotation = Quaternion(-2.29017e-08, -0.00785732, 3.30149e-08, 0.999969)
bones/19/position = Vector3(-1.27748e-08, 0.225719, 1.12004e-08)
bones/19/rotation = Quaternion(-0.692103, -0.0282132, -0.00045305, 0.721247)
bones/20/position = Vector3(-1.30142e-08, 0.139877, -2.77457e-09)
bones/20/rotation = Quaternion(-9.96472e-05, 0.967461, -0.253021, -0.000383039)
bones/21/position = Vector3(0.0251286, 1.42322, 0.0408996)
bones/21/rotation = Quaternion(-0.501573, -0.254503, -0.394023, 0.72691)
bones/22/position = Vector3(0.18743, 1.45871, -0.02859)
bones/22/rotation = Quaternion(0.0604664, -0.158051, 0.973841, -0.15165)
bones/23/position = Vector3(-5.41331e-09, 0.143946, -2.98023e-08)
bones/23/rotation = Quaternion(7.75505e-08, -0.00799807, -1.9496e-08, 0.999968)
bones/24/position = Vector3(-6.33301e-08, 0.143946, 4.3873e-08)
bones/24/rotation = Quaternion(0.277839, -0.00675305, -0.016611, 0.96046)
bones/25/position = Vector3(1.30385e-08, 0.127601, 6.51926e-09)
bones/25/rotation = Quaternion(1.49943e-07, -1.20606e-07, 9.91859e-08, 1)
bones/26/position = Vector3(2.06034e-08, 0.127601, 2.42761e-08)
bones/26/rotation = Quaternion(-0.00824883, -0.00027077, -0.0328667, 0.999426)
bones/28/rotation = Quaternion(0.702583, -0.000939743, -0.00133552, 0.7116)
bones/29/rotation = Quaternion(0.741121, 0.00218291, 0.00265381, 0.671363)
bones/30/rotation = Quaternion(0.32527, 0.890055, 0.295977, -0.119997)
bones/31/rotation = Quaternion(0.514882, -0.114149, 0.114482, 0.841879)
bones/32/rotation = Quaternion(0.592003, -0.0381348, -0.090699, 0.799907)
bones/34/position = Vector3(-0.00316938, 0.0987206, 0.0147918)
bones/34/rotation = Quaternion(-0.0674699, 0.718446, 0.0663966, 0.689112)
bones/35/rotation = Quaternion(0.580803, -0.000892135, -0.0014975, 0.814042)
bones/36/rotation = Quaternion(0.682777, 0.00174509, 0.00256596, 0.73062)
bones/37/rotation = Quaternion(-0.00426514, 0.736714, 0.0394785, 0.675038)
bones/38/position = Vector3(-0.00622951, 0.0926415, -0.0236344)
bones/38/rotation = Quaternion(-0.109873, 0.743351, 0.0333507, 0.658973)
bones/39/rotation = Quaternion(0.630039, 0.00151959, 0.00237944, 0.776559)
bones/40/rotation = Quaternion(0.652643, -0.00308142, -0.00421108, 0.757648)
bones/41/rotation = Quaternion(-0.0684174, 0.72411, 0.0332337, 0.685478)
bones/42/position = Vector3(-0.00715362, 0.0679857, -0.0481983)
bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358921, 0.587807)
bones/43/rotation = Quaternion(0.498693, -0.0202705, -0.0256953, 0.866161)
bones/44/rotation = Quaternion(0.715385, 0.035306, 0.0573145, 0.695481)
bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.0250259, 0.67184)
bones/46/position = Vector3(-0.0113635, 1.42322, 0.0408996)
bones/46/rotation = Quaternion(-0.527917, 0.201754, 0.357521, 0.743491)
bones/47/position = Vector3(-0.162064, 1.45805, -0.0513795)
bones/47/rotation = Quaternion(-0.101804, -0.132181, 0.97079, 0.172428)
bones/48/position = Vector3(1.88476e-07, 0.143946, 1.02445e-08)
bones/48/rotation = Quaternion(-4.01296e-08, -0.00454315, -5.53922e-08, 0.99999)
bones/49/position = Vector3(6.5191e-09, 0.143946, -1.95094e-08)
bones/49/rotation = Quaternion(0.307483, -0.00462726, 0.0284921, 0.951116)
bones/50/position = Vector3(-1.48779e-07, 0.1276, 5.9139e-08)
bones/50/rotation = Quaternion(-8.73115e-08, 2.7474e-08, -1.28057e-07, 1)
bones/51/position = Vector3(1.9461e-07, 0.127601, 6.06248e-08)
bones/51/rotation = Quaternion(-0.00824876, 0.000270832, 0.032867, 0.999426)
bones/52/rotation = Quaternion(-0.2563, 0.855859, 0.0299184, -0.448241)
bones/53/rotation = Quaternion(0.694912, 0.107145, -0.103549, 0.703488)
bones/54/rotation = Quaternion(0.74112, -0.00218237, -0.00265409, 0.671363)
bones/55/rotation = Quaternion(-0.325269, 0.890055, 0.295977, 0.119998)
bones/56/rotation = Quaternion(0.514882, 0.11415, -0.114483, 0.841879)
bones/57/rotation = Quaternion(0.592004, 0.0381346, 0.0906992, 0.799907)
bones/59/position = Vector3(0.00316943, 0.0987207, 0.0147917)
bones/59/rotation = Quaternion(0.138771, -0.704916, 0.15571, 0.677932)
bones/60/rotation = Quaternion(0.579984, 0.0462615, -0.0308755, 0.812727)
bones/61/rotation = Quaternion(0.682777, -0.00174718, -0.00256448, 0.73062)
bones/62/rotation = Quaternion(-0.00426532, -0.736714, -0.0394788, 0.675038)
bones/63/position = Vector3(0.00622955, 0.0926417, -0.0236344)
bones/63/rotation = Quaternion(0.104095, -0.719607, 0.186262, 0.660784)
bones/64/rotation = Quaternion(0.670693, 0.0163391, -0.0185663, 0.741323)
bones/65/rotation = Quaternion(0.692499, 0.00330364, 0.00403917, 0.7214)
bones/66/rotation = Quaternion(-0.0684178, -0.72411, -0.0332339, 0.685477)
bones/67/position = Vector3(0.00715371, 0.0679859, -0.0481984)
bones/67/rotation = Quaternion(0.108364, -0.768224, 0.166291, 0.608635)
bones/68/rotation = Quaternion(0.629954, 0.0295149, 0.0177509, 0.775869)
bones/69/rotation = Quaternion(0.816678, -0.0439534, -0.0509861, 0.573155)
bones/70/rotation = Quaternion(-0.12906, -0.728937, 0.0250258, 0.67184)
bones/71/position = Vector3(0.127191, 1.34027, -0.0269988)
bones/71/rotation = Quaternion(1.89238e-08, 0.618645, 0.785671, -4.66237e-08)
bones/72/position = Vector3(-0.113426, 1.34027, -0.0269989)
bones/72/rotation = Quaternion(1.89238e-08, 0.618645, 0.785671, -4.66237e-08)
[node name="Knight_02" parent="Rig/CharacterRig/GameRig/Skeleton3D" index="1"] [node name="Knight_02" parent="Rig/CharacterRig/GameRig/Skeleton3D" index="1"]
visible = false visible = false
@ -59,10 +136,10 @@ visible = false
visible = true visible = true
[node name="RightHandBone" parent="Rig" index="2"] [node name="RightHandBone" parent="Rig" index="2"]
transform = Transform3D(-0.962335, -0.270835, -0.0236821, 0.234152, -0.869944, 0.434016, -0.138149, 0.412124, 0.900593, -0.345028, 0.993597, -0.00702982) transform = Transform3D(-0.962315, -0.270892, -0.0238454, 0.247477, -0.908725, 0.336118, -0.11272, 0.31755, 0.941518, -0.335903, 0.97153, -0.0524419)
[node name="LeftHandBone" parent="Rig" index="3"] [node name="LeftHandBone" parent="Rig" index="3"]
transform = Transform3D(-0.970511, 0.239118, 0.0305163, -0.217129, -0.922131, 0.320202, 0.104706, 0.304134, 0.946857, 0.346464, 0.979463, -0.0328997) transform = Transform3D(-0.970334, 0.239711, 0.0314789, -0.226046, -0.945695, 0.23359, 0.0857634, 0.219544, 0.971825, 0.344395, 0.962431, -0.0639371)
[node name="tall_shield" parent="Rig/LeftHandBone/OffHandSlot" index="0"] [node name="tall_shield" parent="Rig/LeftHandBone/OffHandSlot" index="0"]
visible = false visible = false

View File

@ -17,7 +17,7 @@ metadata/_custom_type_script = "uid://dwysfismpgq07"
[sub_resource type="SeparationRayShape3D" id="SeparationRayShape3D_swhsd"] [sub_resource type="SeparationRayShape3D" id="SeparationRayShape3D_swhsd"]
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D" groups=["Player"]]
collision_layer = 5 collision_layer = 5
script = ExtResource("1_swhsd") script = ExtResource("1_swhsd")
stats = SubResource("Resource_wdvff") stats = SubResource("Resource_wdvff")
@ -46,46 +46,69 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
[node name="Rig" parent="RigPivot" instance=ExtResource("3_n52bt")] [node name="Rig" parent="RigPivot" instance=ExtResource("3_n52bt")]
[node name="Skeleton3D" parent="RigPivot/Rig/CharacterRig/GameRig" index="0"] [node name="Skeleton3D" parent="RigPivot/Rig/CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(3.37508e-15, 0.892251, -0.0481736) bones/0/position = Vector3(7.11598e-15, 0.897536, -0.0481735)
bones/2/rotation = Quaternion(-0.00493103, -0.000466148, 0.00321582, 0.999983) bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
bones/3/rotation = Quaternion(-0.0992712, -0.000416202, 0.00851815, 0.995024) bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
bones/4/rotation = Quaternion(0.279255, 1.41495e-08, 9.64443e-08, 0.960217) bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
bones/6/rotation = Quaternion(-0.153372, -1.18134e-07, -1.61195e-08, 0.988169) bones/2/rotation = Quaternion(-0.00153614, -0.000411126, 0.00321467, 0.999994)
bones/7/position = Vector3(-3.8278e-08, 0.892251, -0.0481735) bones/3/rotation = Quaternion(-0.0962091, -0.000376408, 0.00852023, 0.995325)
bones/8/position = Vector3(-5.65141e-08, 0.892251, -0.0481735) bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
bones/9/position = Vector3(0.131144, 0.958455, -0.0351291) bones/4/rotation = Quaternion(0.276867, 1.54418e-08, 9.09865e-08, 0.960908)
bones/9/rotation = Quaternion(0.992512, 0.0211238, -0.0308317, 0.116292) bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
bones/11/rotation = Quaternion(0.431051, -0.000700582, 0.000334821, 0.902327) bones/6/rotation = Quaternion(-0.156437, -1.17742e-07, -1.86488e-08, 0.987688)
bones/13/rotation = Quaternion(-0.756254, 0.0119027, 0.0244297, 0.653713) bones/7/position = Vector3(-1.77753e-08, 0.897536, -0.0481734)
bones/15/position = Vector3(-0.131144, 0.958455, -0.0351291) bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
bones/15/rotation = Quaternion(0.972042, -0.00599724, 0.0271723, 0.233151) bones/8/position = Vector3(-6.51103e-08, 0.897536, -0.0481735)
bones/17/rotation = Quaternion(0.454416, 0.00335162, -0.00170987, 0.890782) bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
bones/19/rotation = Quaternion(-0.692508, -0.0282153, -0.000423717, 0.720858) bones/9/position = Vector3(0.131144, 0.963741, -0.0351291)
bones/21/position = Vector3(0.0251286, 1.42272, 0.0407075) bones/9/rotation = Quaternion(0.99302, 0.0208734, -0.0309484, 0.111879)
bones/21/rotation = Quaternion(-0.501087, -0.25471, -0.394376, 0.726981) bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
bones/22/position = Vector3(0.187404, 1.45859, -0.0287018) bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
bones/22/rotation = Quaternion(0.0598594, -0.158145, 0.973878, -0.151552) bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
bones/23/rotation = Quaternion(6.87168e-08, -0.00780987, -4.91533e-09, 0.99997) bones/11/rotation = Quaternion(0.42088, -0.000700527, 0.000325171, 0.907116)
bones/24/rotation = Quaternion(0.280093, -0.00772964, -0.0167947, 0.959795) bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
bones/46/position = Vector3(-0.0113635, 1.42272, 0.0407075) bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
bones/46/rotation = Quaternion(-0.526216, 0.203686, 0.359282, 0.74332) bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
bones/47/position = Vector3(-0.162589, 1.45871, -0.0502581) bones/13/rotation = Quaternion(-0.751873, 0.0118866, 0.0244057, 0.658749)
bones/47/rotation = Quaternion(-0.0990885, -0.132663, 0.971071, 0.172058) bones/15/position = Vector3(-0.131144, 0.963741, -0.0351291)
bones/48/rotation = Quaternion(3.90511e-08, -0.00276118, 9.90106e-09, 0.999996) bones/15/rotation = Quaternion(0.973138, -0.00579333, 0.0273144, 0.228523)
bones/49/rotation = Quaternion(0.310081, -0.00276077, 0.0285632, 0.950277) bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-08)
bones/71/position = Vector3(0.127191, 1.34014, -0.0270138) bones/16/rotation = Quaternion(-3.43227e-08, 0.00314323, 8.33075e-10, 0.999995)
bones/71/rotation = Quaternion(1.89631e-08, 0.618074, 0.78612, -4.66031e-08) bones/17/position = Vector3(1.83545e-08, 0.265705, 6.98543e-10)
bones/72/position = Vector3(-0.113426, 1.34014, -0.0270139) bones/17/rotation = Quaternion(0.444873, 0.00329529, -0.00163701, 0.895586)
bones/72/rotation = Quaternion(1.89631e-08, 0.618074, 0.78612, -4.6603e-08) bones/18/position = Vector3(1.2807e-08, 0.225719, -8.28774e-09)
bones/18/rotation = Quaternion(-2.29017e-08, -0.00785732, 3.30149e-08, 0.999969)
bones/19/position = Vector3(-1.27748e-08, 0.225719, 1.12004e-08)
bones/19/rotation = Quaternion(-0.688453, -0.0281941, -0.000715942, 0.724732)
bones/21/position = Vector3(0.0251286, 1.42772, 0.0426046)
bones/21/rotation = Quaternion(-0.491987, -0.258546, -0.401, 0.728218)
bones/22/position = Vector3(0.188672, 1.46469, -0.0231734)
bones/22/rotation = Quaternion(0.0484565, -0.159908, 0.974512, -0.14969)
bones/23/rotation = Quaternion(3.74187e-08, -0.0171016, 3.06328e-08, 0.999854)
bones/24/rotation = Quaternion(0.301635, -0.0171023, -0.0184896, 0.953091)
bones/25/rotation = Quaternion(1.49943e-07, -1.20606e-07, 9.91859e-08, 1)
bones/26/rotation = Quaternion(-0.00824883, -0.00027077, -0.0328667, 0.999426)
bones/46/position = Vector3(-0.0113635, 1.42772, 0.0426046)
bones/46/rotation = Quaternion(-0.509839, 0.222086, 0.376119, 0.741132)
bones/47/position = Vector3(-0.167583, 1.46516, -0.0388371)
bones/47/rotation = Quaternion(-0.0729571, -0.137238, 0.973383, 0.16843)
bones/48/rotation = Quaternion(1.602e-07, 0.0151239, 1.37233e-07, 0.999886)
bones/49/rotation = Quaternion(0.33489, 0.0151244, 0.0289739, 0.94169)
bones/50/rotation = Quaternion(-8.73115e-08, 2.7474e-08, -1.28057e-07, 1)
bones/51/rotation = Quaternion(-0.00824876, 0.000270832, 0.032867, 0.999426)
bones/71/position = Vector3(0.127191, 1.34628, -0.026269)
bones/71/rotation = Quaternion(1.93601e-08, 0.612295, 0.790629, -4.63906e-08)
bones/72/position = Vector3(-0.113426, 1.34628, -0.0262691)
bones/72/rotation = Quaternion(1.93601e-08, 0.612295, 0.790629, -4.63905e-08)
[node name="RightHandBone" parent="RigPivot/Rig" index="2"] [node name="RightHandBone" parent="RigPivot/Rig" index="2"]
transform = Transform3D(-0.962344, -0.270799, -0.0237168, 0.24678, -0.906897, 0.341523, -0.113993, 0.32281, 0.939574, -0.336405, 0.972667, -0.0500108) transform = Transform3D(-0.962343, -0.270803, -0.0237133, 0.240061, -0.887533, 0.393263, -0.127543, 0.372761, 0.91912, -0.3414, 0.984146, -0.0261846)
[node name="LeftHandBone" parent="RigPivot/Rig" index="3"] [node name="LeftHandBone" parent="RigPivot/Rig" index="3"]
transform = Transform3D(-0.970504, 0.239138, 0.0305704, -0.225294, -0.944755, 0.238079, 0.0858153, 0.224169, 0.970764, 0.344222, 0.962552, -0.0628768) transform = Transform3D(-0.970513, 0.239108, 0.0305211, -0.220956, -0.933067, 0.283839, 0.0963466, 0.268726, 0.958386, 0.345483, 0.971752, -0.0462322)
[node name="RayAttachment" type="BoneAttachment3D" parent="RigPivot/Rig"] [node name="RayAttachment" type="BoneAttachment3D" parent="RigPivot/Rig"]
transform = Transform3D(-0.962344, -0.270799, -0.0237168, 0.24678, -0.906897, 0.341523, -0.113993, 0.32281, 0.939574, -0.336405, 0.972667, -0.0500108) transform = Transform3D(-0.962343, -0.270803, -0.0237133, 0.240061, -0.887533, 0.393263, -0.127543, 0.372761, 0.91912, -0.3414, 0.984146, -0.0261846)
bone_name = "DEF-hand.R" bone_name = "DEF-hand.R"
bone_idx = 51 bone_idx = 51
use_external_skeleton = true use_external_skeleton = true

View File

@ -83,114 +83,114 @@ script = ExtResource("1_n80wy")
[node name="CharacterRig" parent="." instance=ExtResource("2_ow4sk")] [node name="CharacterRig" parent="." instance=ExtResource("2_ow4sk")]
[node name="Skeleton3D" parent="CharacterRig/GameRig" index="0"] [node name="Skeleton3D" parent="CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(4.44089e-15, 0.91125, -0.0481736) bones/0/position = Vector3(0.0140593, 0.898822, -0.0195671)
bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053) bones/0/rotation = Quaternion(0.140822, 1.18021e-07, 1.67873e-08, 0.990035)
bones/1/rotation = Quaternion(-0.0566577, -0.000729729, -0.0117082, 0.998325) bones/1/rotation = Quaternion(-0.0532227, 0.00156451, 0.0232373, 0.998311)
bones/2/position = Vector3(2.97554e-09, 0.146689, -1.95578e-08) bones/2/position = Vector3(1.90539e-09, 0.14377, 5.73325e-09)
bones/2/rotation = Quaternion(0.00733142, -0.000267409, 0.00321091, 0.999968) bones/2/rotation = Quaternion(0.00345358, -0.00116844, -0.023215, 0.999724)
bones/3/position = Vector3(-9.86717e-10, 0.202058, 2.23517e-08) bones/3/position = Vector3(3.33439e-10, 0.188847, -1.07277e-07)
bones/3/rotation = Quaternion(-0.0881604, -0.000271712, 0.00852504, 0.99607) bones/3/rotation = Quaternion(-0.182881, 0.00987481, -0.0362806, 0.982416)
bones/4/position = Vector3(2.51568e-10, 0.0925563, 5.09899e-08) bones/4/position = Vector3(-3.60077e-09, 0.0876191, -1.82989e-09)
bones/4/rotation = Quaternion(0.269525, 1.57453e-08, 9.27582e-08, 0.962994) bones/4/rotation = Quaternion(0.36008, -0.00620133, 0.113359, 0.925988)
bones/5/rotation = Quaternion(-0.0948568, -5.16827e-08, -1.52643e-07, 0.995491) bones/5/rotation = Quaternion(-0.0948566, -2.84715e-09, -6.2381e-08, 0.995491)
bones/6/rotation = Quaternion(-0.165644, -1.19832e-07, -1.94743e-08, 0.986186) bones/6/rotation = Quaternion(-0.168375, -0.0216197, -0.0754177, 0.982596)
bones/7/position = Vector3(-4.61005e-08, 0.91125, -0.0481734) bones/7/position = Vector3(0.0140593, 0.898822, -0.019567)
bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711) bones/7/rotation = Quaternion(-0.0783242, -0.74522, -0.394377, 0.531958)
bones/8/position = Vector3(-3.44589e-08, 0.91125, -0.0481735) bones/8/position = Vector3(0.0140592, 0.898822, -0.0195671)
bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711) bones/8/rotation = Quaternion(-0.0783242, 0.74522, 0.394377, 0.531958)
bones/9/position = Vector3(0.131144, 0.977454, -0.0351291) bones/9/position = Vector3(0.145203, 0.964571, -0.00453131)
bones/9/rotation = Quaternion(0.994356, 0.0201895, -0.0312764, 0.099347) bones/9/rotation = Quaternion(0.999212, -0.00627247, -0.0354591, -0.0166688)
bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08) bones/10/position = Vector3(-1.72955e-08, 0.264687, 1.37854e-08)
bones/10/rotation = Quaternion(-3.13339e-08, -0.000695086, 1.27434e-08, 1) bones/10/rotation = Quaternion(-3.53063e-08, -0.00409875, 1.92096e-08, 0.999992)
bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.43891e-08) bones/11/position = Vector3(-2.67353e-08, 0.264687, -1.68611e-08)
bones/11/rotation = Quaternion(0.39263, -0.000694309, 0.000296515, 0.919696) bones/11/rotation = Quaternion(0.485793, -0.00381278, 0.00321418, 0.87406)
bones/12/position = Vector3(1.7011e-08, 0.22603, 3.54757e-08) bones/12/position = Vector3(1.27702e-08, 0.22467, 2.81536e-08)
bones/12/rotation = Quaternion(-1.55848e-08, -0.00710644, 4.23087e-08, 0.999975) bones/12/rotation = Quaternion(1.2276e-08, -0.00508189, 5.25094e-08, 0.999987)
bones/13/position = Vector3(-3.03789e-08, 0.22603, -1.04537e-08) bones/13/position = Vector3(-1.97007e-08, 0.22467, 1.33448e-08)
bones/13/rotation = Quaternion(-0.739731, 0.0118416, 0.0243567, 0.672357) bones/13/rotation = Quaternion(-0.631062, 0.0209205, -0.0164146, 0.775276)
bones/14/position = Vector3(-8.57186e-09, 0.139878, -1.09367e-08) bones/14/position = Vector3(-1.39333e-08, 0.139878, 9.79688e-10)
bones/14/rotation = Quaternion(-9.66752e-05, 0.967474, -0.252972, -0.000383448) bones/14/rotation = Quaternion(-0.000100296, 0.967461, -0.253018, -0.000382481)
bones/15/position = Vector3(-0.131144, 0.977454, -0.0351291) bones/15/position = Vector3(-0.117084, 0.964571, -0.00453133)
bones/15/rotation = Quaternion(0.97605, -0.00523204, 0.0277037, 0.215712) bones/15/rotation = Quaternion(0.952394, -0.00264171, 0.0239404, 0.303916)
bones/16/position = Vector3(-1.42639e-08, 0.265705, 3.58834e-09) bones/16/position = Vector3(-1.43308e-08, 0.265571, -6.92757e-08)
bones/16/rotation = Quaternion(-2.70467e-08, 0.00314323, 5.71139e-10, 0.999995) bones/16/rotation = Quaternion(-8.14423e-09, 0.00421438, -3.3253e-08, 0.999991)
bones/17/position = Vector3(1.55606e-08, 0.265705, -5.01167e-08) bones/17/position = Vector3(1.83513e-08, 0.265571, 1.02388e-08)
bones/17/rotation = Quaternion(0.419063, 0.00314258, -0.00145057, 0.90795) bones/17/rotation = Quaternion(0.438936, 0.00422649, -0.00229088, 0.898505)
bones/18/position = Vector3(-4.18961e-09, 0.225719, -2.13263e-08) bones/18/position = Vector3(1.52612e-08, 0.225583, 5.25791e-09)
bones/18/rotation = Quaternion(-2.30763e-08, -0.00785731, 3.23164e-08, 0.999969) bones/18/rotation = Quaternion(8.17914e-10, -0.00732776, 1.75348e-08, 0.999973)
bones/19/position = Vector3(-9.18953e-09, 0.225719, 1.51431e-09) bones/19/position = Vector3(-3.56256e-09, 0.225583, 1.20612e-09)
bones/19/rotation = Quaternion(-0.677189, -0.0281332, -0.00151302, 0.73527) bones/19/rotation = Quaternion(-0.6846, -0.0278374, 0.000639212, 0.728387)
bones/20/position = Vector3(3.67497e-08, 0.139882, 1.09572e-08) bones/20/position = Vector3(-9.83738e-11, 0.139878, -8.07967e-09)
bones/20/rotation = Quaternion(-9.96472e-05, 0.967461, -0.253021, -0.000383039) bones/20/rotation = Quaternion(-9.95554e-05, 0.96746, -0.253025, -0.00038308)
bones/21/position = Vector3(0.0251286, 1.44073, 0.0475539) bones/21/position = Vector3(0.0287448, 1.40662, 0.0892201)
bones/21/rotation = Quaternion(-0.46887, -0.267885, -0.41796, 0.730553) bones/21/rotation = Quaternion(-0.495034, -0.238634, -0.42903, 0.716888)
bones/22/position = Vector3(0.19165, 1.4797, -0.0089467) bones/22/position = Vector3(0.193844, 1.4327, 0.022984)
bones/22/rotation = Quaternion(0.0191939, -0.164328, 0.975527, -0.144825) bones/22/rotation = Quaternion(-0.0632854, 0.00517029, 0.990995, -0.117883)
bones/23/position = Vector3(2.09082e-07, 0.143946, 5.7742e-08) bones/23/position = Vector3(-5.07683e-09, 0.142328, -5.71693e-08)
bones/23/rotation = Quaternion(6.33718e-08, -0.0408242, -6.79011e-08, 0.999166) bones/23/rotation = Quaternion(4.16081e-08, -0.0586896, 2.86627e-08, 0.998276)
bones/24/position = Vector3(-2.51458e-08, 0.143946, 1.49167e-07) bones/24/position = Vector3(-5.71978e-08, 0.142328, 1.52782e-08)
bones/24/rotation = Quaternion(0.355351, -0.0408248, -0.0221832, 0.933577) bones/24/rotation = Quaternion(0.409209, -0.0685599, -0.168008, 0.894215)
bones/25/position = Vector3(-1.51806e-07, 0.127601, -1.86264e-08) bones/25/position = Vector3(-2.47517e-08, 0.125926, 1.45903e-08)
bones/25/rotation = Quaternion(1.61119e-07, -1.23866e-07, 1.05705e-07, 1) bones/25/rotation = Quaternion(-8.76819e-08, 0.0418146, 9.10994e-08, 0.999125)
bones/26/position = Vector3(-2.38135e-07, 0.127601, 5.02437e-08) bones/26/position = Vector3(2.00073e-08, 0.125926, -2.91277e-09)
bones/26/rotation = Quaternion(-0.00824883, -0.000270768, -0.0328667, 0.999426) bones/26/rotation = Quaternion(-0.0202571, 0.0418303, -0.149081, 0.987732)
bones/28/rotation = Quaternion(0.702584, -0.000940233, -0.00133577, 0.711599) bones/28/rotation = Quaternion(0.702583, -0.00093979, -0.0013355, 0.7116)
bones/29/rotation = Quaternion(0.741121, 0.00218229, 0.00265403, 0.671363) bones/29/rotation = Quaternion(0.741121, 0.00218266, 0.00265398, 0.671363)
bones/30/rotation = Quaternion(0.32527, 0.890055, 0.295977, -0.119997) bones/30/rotation = Quaternion(0.325269, 0.890055, 0.295977, -0.119997)
bones/31/rotation = Quaternion(0.514882, -0.114149, 0.114482, 0.841879) bones/31/rotation = Quaternion(0.514882, -0.114149, 0.114483, 0.841879)
bones/32/rotation = Quaternion(0.592004, -0.0381347, -0.0906988, 0.799907) bones/32/rotation = Quaternion(0.592004, -0.038135, -0.0906987, 0.799907)
bones/34/position = Vector3(-0.00316923, 0.0987205, 0.014792) bones/34/position = Vector3(-0.00316937, 0.0987207, 0.0147917)
bones/34/rotation = Quaternion(-0.0674699, 0.718446, 0.066396, 0.689112) bones/34/rotation = Quaternion(-0.0674701, 0.718446, 0.0663964, 0.689112)
bones/35/rotation = Quaternion(0.580803, -0.00089226, -0.00149663, 0.814042) bones/35/rotation = Quaternion(0.580803, -0.00089188, -0.00149751, 0.814042)
bones/36/rotation = Quaternion(0.682777, 0.00174471, 0.00256546, 0.73062) bones/36/rotation = Quaternion(0.682777, 0.00174519, 0.00256615, 0.73062)
bones/37/rotation = Quaternion(-0.0042649, 0.736714, 0.0394783, 0.675038) bones/37/rotation = Quaternion(-0.00426508, 0.736714, 0.0394785, 0.675038)
bones/38/position = Vector3(-0.00622965, 0.0926412, -0.0236343) bones/38/position = Vector3(-0.00622955, 0.0926415, -0.0236344)
bones/38/rotation = Quaternion(-0.109873, 0.743351, 0.0333506, 0.658973) bones/38/rotation = Quaternion(-0.109873, 0.743351, 0.0333505, 0.658973)
bones/39/rotation = Quaternion(0.630039, 0.0015193, 0.00237975, 0.776558) bones/39/rotation = Quaternion(0.630039, 0.00151964, 0.00237907, 0.776559)
bones/40/rotation = Quaternion(0.652643, -0.00308147, -0.00421165, 0.757648) bones/40/rotation = Quaternion(0.652643, -0.00308124, -0.00421062, 0.757647)
bones/41/rotation = Quaternion(-0.0684173, 0.72411, 0.0332336, 0.685477) bones/41/rotation = Quaternion(-0.0684175, 0.72411, 0.0332339, 0.685477)
bones/42/position = Vector3(-0.00715375, 0.0679857, -0.0481983) bones/42/position = Vector3(-0.0071537, 0.0679858, -0.0481984)
bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358922, 0.587807) bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358921, 0.587807)
bones/43/rotation = Quaternion(0.498693, -0.0202705, -0.0256953, 0.866161) bones/43/rotation = Quaternion(0.498693, -0.0202706, -0.0256952, 0.866161)
bones/44/rotation = Quaternion(0.715385, 0.0353058, 0.0573149, 0.69548) bones/44/rotation = Quaternion(0.715385, 0.0353061, 0.0573143, 0.695481)
bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.0250259, 0.67184) bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.025026, 0.67184)
bones/46/position = Vector3(-0.0113635, 1.44073, 0.0475539) bones/46/position = Vector3(-0.00754272, 1.40917, 0.0902036)
bones/46/rotation = Quaternion(-0.468087, 0.267437, 0.418246, 0.731055) bones/46/rotation = Quaternion(-0.478349, 0.269796, 0.369044, 0.749799)
bones/47/position = Vector3(-0.177885, 1.47982, -0.00886313) bones/47/position = Vector3(-0.166029, 1.45873, 0.0241982)
bones/47/rotation = Quaternion(-0.00629804, -0.148423, 0.976093, 0.158663) bones/47/rotation = Quaternion(-0.154885, -0.291777, 0.90641, 0.263244)
bones/48/position = Vector3(3.3062e-08, 0.143946, -2.79397e-08) bones/48/position = Vector3(3.3883e-09, 0.143428, 4.35032e-08)
bones/48/rotation = Quaternion(-1.87788e-07, 0.0600834, -1.99692e-07, 0.998193) bones/48/rotation = Quaternion(3.80958e-08, 0.00153199, 1.78284e-08, 0.999999)
bones/49/position = Vector3(2.32835e-09, 0.143946, 2.93752e-08) bones/49/position = Vector3(1.70553e-08, 0.143428, 2.30038e-08)
bones/49/rotation = Quaternion(0.396547, 0.0600838, 0.0277103, 0.915627) bones/49/rotation = Quaternion(0.33034, 0.0141226, 0.190567, 0.924316)
bones/50/position = Vector3(2.96393e-07, 0.1276, -8.3819e-08) bones/50/position = Vector3(-9.34286e-08, 0.127074, 3.68351e-08)
bones/50/rotation = Quaternion(-8.184e-08, 2.42144e-08, -1.33645e-07, 1) bones/50/rotation = Quaternion(-7.50417e-08, -0.0210312, -9.77642e-08, 0.999779)
bones/51/position = Vector3(2.1924e-07, 0.1276, 1.47435e-08) bones/51/position = Vector3(1.33174e-07, 0.127074, 7.77374e-09)
bones/51/rotation = Quaternion(-0.00824878, 0.000270832, 0.032867, 0.999426) bones/51/rotation = Quaternion(0.1739, -0.0211118, 0.0284399, 0.984126)
bones/52/rotation = Quaternion(-0.2563, 0.855859, 0.0299185, -0.448241) bones/52/rotation = Quaternion(-0.2563, 0.855859, 0.0299185, -0.448241)
bones/53/rotation = Quaternion(0.694912, 0.107144, -0.103548, 0.703488) bones/53/rotation = Quaternion(0.694912, 0.107145, -0.103548, 0.703488)
bones/54/rotation = Quaternion(0.74112, -0.00218245, -0.0026545, 0.671363) bones/54/rotation = Quaternion(0.741121, -0.00218271, -0.00265401, 0.671363)
bones/55/rotation = Quaternion(-0.325269, 0.890055, 0.295977, 0.119998) bones/55/rotation = Quaternion(-0.325269, 0.890055, 0.295977, 0.119998)
bones/56/rotation = Quaternion(0.514882, 0.11415, -0.114482, 0.841879) bones/56/rotation = Quaternion(0.514882, 0.11415, -0.114483, 0.841879)
bones/57/rotation = Quaternion(0.592005, 0.0381345, 0.0906988, 0.799906) bones/57/rotation = Quaternion(0.592004, 0.0381347, 0.0906991, 0.799907)
bones/59/position = Vector3(0.00316945, 0.0987207, 0.0147919) bones/59/position = Vector3(0.00316937, 0.0987207, 0.0147919)
bones/59/rotation = Quaternion(0.138771, -0.704916, 0.15571, 0.677931) bones/59/rotation = Quaternion(0.138771, -0.704916, 0.15571, 0.677932)
bones/60/rotation = Quaternion(0.579985, 0.0462612, -0.0308756, 0.812727) bones/60/rotation = Quaternion(0.579984, 0.0462614, -0.0308755, 0.812727)
bones/61/rotation = Quaternion(0.682777, -0.00174713, -0.00256477, 0.730621) bones/61/rotation = Quaternion(0.682777, -0.00174714, -0.00256456, 0.73062)
bones/62/rotation = Quaternion(-0.00426538, -0.736714, -0.0394788, 0.675038) bones/62/rotation = Quaternion(-0.00426534, -0.736714, -0.0394788, 0.675038)
bones/63/position = Vector3(0.00622961, 0.0926419, -0.0236345) bones/63/position = Vector3(0.00622955, 0.0926414, -0.0236344)
bones/63/rotation = Quaternion(0.104095, -0.719607, 0.186262, 0.660785) bones/63/rotation = Quaternion(0.104096, -0.719607, 0.186262, 0.660784)
bones/64/rotation = Quaternion(0.670693, 0.0163392, -0.0185666, 0.741323) bones/64/rotation = Quaternion(0.670693, 0.0163391, -0.0185663, 0.741323)
bones/65/rotation = Quaternion(0.692499, 0.0033038, 0.00403946, 0.7214) bones/65/rotation = Quaternion(0.692499, 0.00330366, 0.0040391, 0.7214)
bones/66/rotation = Quaternion(-0.0684176, -0.72411, -0.0332339, 0.685477) bones/66/rotation = Quaternion(-0.0684177, -0.72411, -0.0332339, 0.685477)
bones/67/position = Vector3(0.00715366, 0.0679859, -0.0481984) bones/67/position = Vector3(0.00715367, 0.0679857, -0.0481984)
bones/67/rotation = Quaternion(0.108365, -0.768224, 0.166291, 0.608635) bones/67/rotation = Quaternion(0.108364, -0.768224, 0.166291, 0.608635)
bones/68/rotation = Quaternion(0.629953, 0.0295151, 0.0177509, 0.775869) bones/68/rotation = Quaternion(0.629954, 0.0295148, 0.017751, 0.775869)
bones/69/rotation = Quaternion(0.816678, -0.0439533, -0.0509859, 0.573154) bones/69/rotation = Quaternion(0.816678, -0.0439534, -0.0509861, 0.573155)
bones/70/rotation = Quaternion(-0.12906, -0.728937, 0.0250259, 0.67184) bones/70/rotation = Quaternion(-0.12906, -0.728937, 0.0250258, 0.67184)
bones/71/position = Vector3(0.127191, 1.36191, -0.0243146) bones/71/position = Vector3(0.123263, 1.32509, 0.0113221)
bones/71/rotation = Quaternion(2.28855e-08, 0.597416, 0.801932, -4.88853e-08) bones/71/rotation = Quaternion(0.0290692, 0.577285, 0.815667, 0.0241659)
bones/72/position = Vector3(-0.113426, 1.36191, -0.0243146) bones/72/position = Vector3(-0.116005, 1.34191, 0.0178072)
bones/72/rotation = Quaternion(2.29389e-08, 0.597416, 0.801932, -4.89387e-08) bones/72/rotation = Quaternion(0.0290692, 0.577285, 0.815667, 0.0241659)
[node name="Knight_01" parent="CharacterRig/GameRig/Skeleton3D" index="0"] [node name="Knight_01" parent="CharacterRig/GameRig/Skeleton3D" index="0"]
visible = false visible = false
@ -205,10 +205,10 @@ visible = false
root_node = NodePath("../CharacterRig") root_node = NodePath("../CharacterRig")
tree_root = SubResource("AnimationNodeStateMachine_mq48a") tree_root = SubResource("AnimationNodeStateMachine_mq48a")
anim_player = NodePath("../CharacterRig/AnimationPlayer") anim_player = NodePath("../CharacterRig/AnimationPlayer")
parameters/MoveSpace/blend_position = -5.743 parameters/MoveSpace/blend_position = -0.786036
[node name="RightHandBone" type="BoneAttachment3D" parent="."] [node name="RightHandBone" type="BoneAttachment3D" parent="."]
transform = Transform3D(-0.962344, -0.270798, -0.0237177, 0.219794, -0.826483, 0.518283, -0.159952, 0.493553, 0.85488, -0.351701, 1.01454, 0.0337302) transform = Transform3D(-0.965485, -0.253821, -0.0584302, 0.19966, -0.865306, 0.459763, -0.167257, 0.432228, 0.886117, -0.344329, 1.01654, -0.127315)
bone_name = "DEF-hand.R" bone_name = "DEF-hand.R"
bone_idx = 51 bone_idx = 51
use_external_skeleton = true use_external_skeleton = true
@ -220,7 +220,7 @@ transform = Transform3D(0.16656, 0.0770401, -0.983017, -0.982939, 0.0918653, -0.
[node name="longsword" parent="RightHandBone/WeaponSlot" instance=ExtResource("3_dka8l")] [node name="longsword" parent="RightHandBone/WeaponSlot" instance=ExtResource("3_dka8l")]
[node name="LeftHandBone" type="BoneAttachment3D" parent="."] [node name="LeftHandBone" type="BoneAttachment3D" parent="."]
transform = Transform3D(-0.970514, 0.239107, 0.0305222, -0.207839, -0.89421, 0.396475, 0.122093, 0.37844, 0.917538, 0.34846, 0.996906, -0.00467403) transform = Transform3D(-0.915212, -0.391671, -0.0947697, 0.188873, -0.624672, 0.757701, -0.35597, 0.675558, 0.645683, 0.233604, 0.996937, 0.223621)
bone_name = "DEF-hand.L" bone_name = "DEF-hand.L"
bone_idx = 26 bone_idx = 26
use_external_skeleton = true use_external_skeleton = true

View File

@ -96,6 +96,11 @@ transform = Transform3D(0.910214, 0, 0.414137, 0, 1, 0, -0.414137, 0, 0.910214,
[node name="tree_group_vege" parent="Vegetation" instance=ExtResource("5_eyekk")] [node name="tree_group_vege" parent="Vegetation" instance=ExtResource("5_eyekk")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.01405, 3.8147e-06, 6.12766) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.01405, 3.8147e-06, 6.12766)
[node name="OmniLight3D" type="OmniLight3D" parent="Vegetation"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.8535, 4.698, 7.48507)
light_color = Color(0.976179, 0.672277, 0.443964, 1)
omni_range = 3.44465
[node name="Enemies" type="Node3D" parent="."] [node name="Enemies" type="Node3D" parent="."]
[node name="Enemy1" parent="Enemies" instance=ExtResource("6_uvsco")] [node name="Enemy1" parent="Enemies" instance=ExtResource("6_uvsco")]

View File

@ -2,12 +2,14 @@ extends CharacterBody3D
class_name Enemy class_name Enemy
@export var max_health: float = 20.0 @export var max_health: float = 20.0
@export var xp_value: int = 30
@onready var rig: Node3D = $Rig @onready var rig: Node3D = $Rig
@onready var health_component: HealthComponent = $HealthComponent @onready var health_component: HealthComponent = $HealthComponent
@onready var collision_shape: CollisionShape3D = $CollisionShape3D @onready var collision_shape: CollisionShape3D = $CollisionShape3D
@onready var player_detector: ShapeCast3D = $Rig/PlayerDetector @onready var player_detector: ShapeCast3D = $Rig/PlayerDetector
@onready var area_attack: ShapeCast3D = $Rig/AreaAttack @onready var area_attack: ShapeCast3D = $Rig/AreaAttack
@onready var player: Player = get_tree().get_first_node_in_group("Player")
func _ready() -> void: func _ready() -> void:
var mesh = rig.villager_meshes.pick_random() var mesh = rig.villager_meshes.pick_random()
@ -25,10 +27,10 @@ func check_for_attacks() -> void:
rig.playback.travel("Overhead") rig.playback.travel("Overhead")
func _on_health_component_defeat() -> void: func _on_health_component_defeat() -> void:
player.stats.xp += xp_value
rig.playback.travel("Defeat") rig.playback.travel("Defeat")
collision_shape.disabled = true collision_shape.disabled = true
set_physics_process(false) set_physics_process(false)
func _on_rig_heavy_attack() -> void: func _on_rig_heavy_attack() -> void:
area_attack.deal_damage(20.0) area_attack.deal_damage(20.0)