Finish adding dash and all player movements

This commit is contained in:
Nathan Chapman 2025-05-11 08:00:17 -06:00
parent 37825f0679
commit 77400cd494
6 changed files with 127 additions and 159 deletions

View File

@ -1,7 +1,32 @@
[gd_scene load_steps=2 format=3 uid="uid://cwdsfw1g1607y"]
[gd_scene load_steps=7 format=3 uid="uid://cwdsfw1g1607y"]
[ext_resource type="Script" uid="uid://ekvwb7r88vda" path="res://src/scripts/characters/dash.gd" id="1_bwbfr"]
[sub_resource type="Curve" id="Curve_bwbfr"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -3.16471, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_b7rfo"]
curve = SubResource("Curve_bwbfr")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_go161"]
emission_shape_scale = Vector3(1, 0.25, 1)
emission_shape = 1
emission_sphere_radius = 0.5
gravity = Vector3(0, 1, 0)
damping_max = 1.0
scale_min = 0.2
scale_max = 0.4
scale_curve = SubResource("CurveTexture_b7rfo")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_o2xxc"]
emission_enabled = true
emission = Color(1, 1, 1, 1)
emission_energy_multiplier = 0.5
[sub_resource type="SphereMesh" id="SphereMesh_ahh2q"]
material = SubResource("StandardMaterial3D_o2xxc")
[node name="Dash" type="Node3D"]
script = ExtResource("1_bwbfr")
@ -9,3 +34,9 @@ script = ExtResource("1_bwbfr")
one_shot = true
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
cast_shadow = 0
emitting = false
amount = 64
lifetime = 0.5
process_material = SubResource("ParticleProcessMaterial_go161")
draw_pass_1 = SubResource("SphereMesh_ahh2q")

View File

@ -18,9 +18,6 @@ script = ExtResource("1_swhsd")
[node name="HealthComponent" parent="." instance=ExtResource("2_0xash")]
[node name="Dash" parent="." node_paths=PackedStringArray("player") instance=ExtResource("7_yvk1n")]
player = NodePath("..")
[node name="CollisionShape" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_yx56f")
@ -43,123 +40,46 @@ 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="Skeleton3D" parent="RigPivot/Rig/CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(8.58084e-15, 0.895019, -0.0481735)
bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
bones/2/rotation = Quaternion(-0.00317971, -0.000437766, 0.00321522, 0.99999)
bones/3/position = Vector3(-2.01263e-09, 0.202058, -2.51457e-08)
bones/3/rotation = Quaternion(-0.0976733, -0.000395437, 0.00851928, 0.995182)
bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
bones/4/rotation = Quaternion(0.278136, 1.46012e-08, 9.44328e-08, 0.960542)
bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
bones/6/rotation = Quaternion(-0.154729, -1.17525e-07, -2.00353e-08, 0.987957)
bones/7/position = Vector3(-2.84857e-08, 0.895019, -0.0481735)
bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
bones/8/position = Vector3(-5.26355e-08, 0.895019, -0.0481735)
bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
bones/9/position = Vector3(0.131144, 0.961223, -0.0351291)
bones/9/rotation = Quaternion(0.992778, 0.0209935, -0.0308923, 0.114003)
bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
bones/11/rotation = Quaternion(0.425702, -0.000700662, 0.000329784, 0.904863)
bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
bones/13/rotation = Quaternion(-0.753959, 0.0118942, 0.0244169, 0.65636)
bones/14/position = Vector3(-3.05481e-08, 0.139877, 1.64787e-08)
bones/14/rotation = Quaternion(-9.66743e-05, 0.967474, -0.252972, -0.000383447)
bones/15/position = Vector3(-0.131144, 0.961223, -0.0351291)
bones/15/rotation = Quaternion(0.972608, -0.00589253, 0.0272454, 0.230776)
bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-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.449409, 0.00332206, -0.00167137, 0.893319)
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.690431, -0.0282045, -0.000573799, 0.722848)
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.42531, 0.0416884)
bones/21/rotation = Quaternion(-0.496275, -0.25675, -0.397875, 0.727658)
bones/22/position = Vector3(0.188079, 1.46182, -0.0257931)
bones/22/rotation = Quaternion(0.0538374, -0.159079, 0.97423, -0.150571)
bones/23/position = Vector3(-5.41331e-09, 0.143946, -2.98023e-08)
bones/23/rotation = Quaternion(9.26843e-08, -0.0127032, -8.73232e-09, 0.999919)
bones/24/position = Vector3(-6.33301e-08, 0.143946, 4.3873e-08)
bones/24/rotation = Quaternion(0.291547, -0.0127039, -0.0177098, 0.956308)
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.42531, 0.0416884)
bones/46/rotation = Quaternion(-0.517535, 0.213485, 0.368233, 0.742284)
bones/47/position = Vector3(-0.165302, 1.46218, -0.0442294)
bones/47/rotation = Quaternion(-0.0852349, -0.135102, 0.972385, 0.170149)
bones/48/position = Vector3(1.88476e-07, 0.143946, 1.02445e-08)
bones/48/rotation = Quaternion(-7.81787e-08, 0.00673743, -1.28125e-07, 0.999977)
bones/49/position = Vector3(6.5191e-09, 0.143946, -1.95094e-08)
bones/49/rotation = Quaternion(0.323275, 0.00673785, 0.0288427, 0.945841)
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.34338, -0.0266229)
bones/71/rotation = Quaternion(1.91721e-08, 0.615034, 0.788501, -4.64921e-08)
bones/72/position = Vector3(-0.113426, 1.34338, -0.026623)
bones/72/rotation = Quaternion(1.91783e-08, 0.614945, 0.78857, -4.64886e-08)
bones/0/position = Vector3(3.37508e-15, 0.892173, -0.0481736)
bones/2/rotation = Quaternion(-0.00490343, -0.000465701, 0.00321581, 0.999983)
bones/3/rotation = Quaternion(-0.0993242, -0.000416891, 0.00851811, 0.995019)
bones/4/rotation = Quaternion(0.279233, 1.41584e-08, 9.64048e-08, 0.960223)
bones/6/rotation = Quaternion(-0.15339, -1.18116e-07, -1.62303e-08, 0.988166)
bones/7/position = Vector3(-3.78592e-08, 0.892173, -0.0481735)
bones/8/position = Vector3(-5.52418e-08, 0.892173, -0.0481735)
bones/9/position = Vector3(0.131144, 0.958378, -0.0351291)
bones/9/rotation = Quaternion(0.992504, 0.0211274, -0.03083, 0.116356)
bones/11/rotation = Quaternion(0.431171, -0.000700576, 0.000334929, 0.90227)
bones/13/rotation = Quaternion(-0.756295, 0.0119028, 0.0244299, 0.653666)
bones/15/position = Vector3(-0.131144, 0.958378, -0.0351291)
bones/15/rotation = Quaternion(0.972048, -0.00599614, 0.0271731, 0.233126)
bones/17/rotation = Quaternion(0.454528, 0.00335229, -0.00171074, 0.890724)
bones/19/rotation = Quaternion(-0.692486, -0.0282152, -0.00042531, 0.720879)
bones/21/position = Vector3(0.0251286, 1.42274, 0.040718)
bones/21/rotation = Quaternion(-0.501196, -0.254664, -0.394297, 0.726965)
bones/22/position = Vector3(0.187382, 1.45848, -0.028795)
bones/22/rotation = Quaternion(0.0599954, -0.158124, 0.97387, -0.151574)
bones/23/rotation = Quaternion(7.46642e-08, -0.00765281, -1.69737e-09, 0.999971)
bones/24/rotation = Quaternion(0.279781, -0.0075944, -0.0167693, 0.959887)
bones/46/position = Vector3(-0.0113635, 1.42274, 0.0407179)
bones/46/rotation = Quaternion(-0.526451, 0.203419, 0.359039, 0.743344)
bones/47/position = Vector3(-0.162513, 1.45862, -0.0504209)
bones/47/rotation = Quaternion(-0.0994647, -0.132596, 0.971032, 0.172109)
bones/48/rotation = Quaternion(3.80976e-08, -0.00301965, 8.65723e-09, 0.999995)
bones/49/rotation = Quaternion(0.309721, -0.00301923, 0.0285536, 0.950394)
bones/71/position = Vector3(0.127191, 1.34004, -0.0270263)
bones/71/rotation = Quaternion(1.89594e-08, 0.618127, 0.786078, -4.6605e-08)
bones/72/position = Vector3(-0.113426, 1.34004, -0.0270264)
bones/72/rotation = Quaternion(1.89594e-08, 0.618127, 0.786078, -4.6605e-08)
[node name="RightHandBone" parent="RigPivot/Rig" index="2"]
transform = Transform3D(-0.962343, -0.270803, -0.0237132, 0.24331, -0.896965, 0.369126, -0.12123, 0.349456, 0.929077, -0.339119, 0.978719, -0.037363)
transform = Transform3D(-0.962344, -0.270799, -0.0237169, 0.246871, -0.907156, 0.340768, -0.113795, 0.322081, 0.939848, -0.336329, 0.972504, -0.0503546)
[node name="LeftHandBone" parent="RigPivot/Rig" index="3"]
transform = Transform3D(-0.970513, 0.239108, 0.0305211, -0.223046, -0.938818, 0.262434, 0.091404, 0.247888, 0.964467, 0.34489, 0.967359, -0.0540491)
transform = Transform3D(-0.97052, 0.239086, 0.030488, -0.225323, -0.944923, 0.237385, 0.0855642, 0.223517, 0.970937, 0.344187, 0.962403, -0.063131)
[node name="RayAttachment" type="BoneAttachment3D" parent="RigPivot/Rig"]
transform = Transform3D(-0.962343, -0.270803, -0.0237132, 0.24331, -0.896965, 0.369126, -0.12123, 0.349456, 0.929077, -0.339119, 0.978719, -0.037363)
transform = Transform3D(-0.962344, -0.270799, -0.0237169, 0.246871, -0.907156, 0.340768, -0.113795, 0.322081, 0.939848, -0.336329, 0.972504, -0.0503546)
bone_name = "DEF-hand.R"
bone_idx = 51
use_external_skeleton = true
@ -176,6 +96,10 @@ script = ExtResource("4_cx3ie")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1)
collision_mask = 8
[node name="Dash" parent="RigPivot" node_paths=PackedStringArray("player") instance=ExtResource("7_yvk1n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.191783, 0)
player = NodePath("../..")
[connection signal="defeat" from="HealthComponent" to="." method="_on_health_component_defeat"]
[connection signal="heavy_attack" from="RigPivot/Rig" to="." method="_on_rig_heavy_attack"]

View File

@ -75,7 +75,7 @@ states/Slash/node = SubResource("AnimationNodeAnimation_1br2m")
states/Slash/position = Vector2(434, 243)
states/Start/position = Vector2(239, 28)
transitions = ["Start", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_gkl4x"), "MoveSpace", "Slash", SubResource("AnimationNodeStateMachineTransition_eek7r"), "Slash", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_gxy77"), "MoveSpace", "Overhead", SubResource("AnimationNodeStateMachineTransition_isuva"), "Overhead", "OverheadRecover", SubResource("AnimationNodeStateMachineTransition_8x2vi"), "OverheadRecover", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_eqygr"), "MoveSpace", "Dash", SubResource("AnimationNodeStateMachineTransition_yvrik"), "Dash", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_dnffl")]
graph_offset = Vector2(-50, -104)
graph_offset = Vector2(-166, -157)
[node name="Rig" type="Node3D"]
script = ExtResource("1_n80wy")
@ -83,53 +83,53 @@ script = ExtResource("1_n80wy")
[node name="CharacterRig" parent="." instance=ExtResource("2_ow4sk")]
[node name="Skeleton3D" parent="CharacterRig/GameRig" index="0"]
bones/0/position = Vector3(1.38503e-14, 0.899509, -0.0481735)
bones/0/position = Vector3(4.09616e-15, 0.906875, -0.0481736)
bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
bones/2/rotation = Quaternion(-0.000274032, -0.000390671, 0.0032142, 0.999995)
bones/2/rotation = Quaternion(0.00442576, -0.000314505, 0.00321221, 0.999985)
bones/3/position = Vector3(-2.01263e-09, 0.202058, -2.51457e-08)
bones/3/rotation = Quaternion(-0.0950616, -0.00036149, 0.00852097, 0.995435)
bones/3/rotation = Quaternion(-0.0907289, -0.000305136, 0.00852361, 0.995839)
bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
bones/4/rotation = Quaternion(0.275817, 1.47187e-08, 9.30538e-08, 0.96121)
bones/4/rotation = Quaternion(0.271877, 1.53159e-08, 8.92799e-08, 0.962332)
bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
bones/6/rotation = Quaternion(-0.157749, -1.17717e-07, -1.88051e-08, 0.987479)
bones/7/position = Vector3(-2.15034e-08, 0.899509, -0.0481735)
bones/6/rotation = Quaternion(-0.162704, -1.17631e-07, -1.93477e-08, 0.986675)
bones/7/position = Vector3(-2.59348e-08, 0.906875, -0.0481735)
bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
bones/8/position = Vector3(-8.1052e-08, 0.899509, -0.0481735)
bones/8/position = Vector3(-3.25127e-08, 0.906875, -0.0481735)
bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
bones/9/position = Vector3(0.131144, 0.965713, -0.0351291)
bones/9/rotation = Quaternion(0.993206, 0.0207804, -0.030992, 0.110223)
bones/9/position = Vector3(0.131144, 0.973079, -0.0351291)
bones/9/rotation = Quaternion(0.993933, 0.0204123, -0.0311687, 0.103483)
bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
bones/11/rotation = Quaternion(0.417093, -0.000700249, 0.000321492, 0.908864)
bones/11/rotation = Quaternion(0.401896, -0.00069713, 0.000306119, 0.915685)
bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
bones/13/rotation = Quaternion(-0.750237, 0.0118807, 0.0243974, 0.660612)
bones/13/rotation = Quaternion(-0.743767, 0.0118566, 0.0243716, 0.667889)
bones/14/position = Vector3(-3.05481e-08, 0.139877, 1.64787e-08)
bones/14/rotation = Quaternion(-9.66743e-05, 0.967474, -0.252972, -0.000383447)
bones/15/position = Vector3(-0.131144, 0.965713, -0.0351291)
bones/15/rotation = Quaternion(0.973556, -0.00571441, 0.0273692, 0.226731)
bones/15/position = Vector3(-0.131144, 0.973079, -0.0351291)
bones/15/rotation = Quaternion(0.975124, -0.00541354, 0.027578, 0.219871)
bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-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.441277, 0.00327404, -0.0016101, 0.897364)
bones/17/rotation = Quaternion(0.427437, 0.00319219, -0.00150937, 0.904038)
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.686886, -0.0281857, -0.000827966, 0.726218)
bones/19/rotation = Quaternion(-0.6809, -0.0281535, -0.00125255, 0.731834)
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.4296, 0.0433173)
bones/21/rotation = Quaternion(-0.488682, -0.259917, -0.403412, 0.728623)
bones/22/position = Vector3(0.189119, 1.46689, -0.0211361)
bones/22/rotation = Quaternion(0.0442702, -0.16055, 0.974711, -0.149002)
bones/21/position = Vector3(0.0251286, 1.43661, 0.0459832)
bones/21/rotation = Quaternion(-0.476217, -0.264979, -0.412548, 0.729936)
bones/22/position = Vector3(0.190744, 1.47502, -0.0134859)
bones/22/rotation = Quaternion(0.0285396, -0.162933, 0.975299, -0.146392)
bones/23/position = Vector3(-5.41331e-09, 0.143946, -2.98023e-08)
bones/23/rotation = Quaternion(6.47502e-08, -0.0205074, 1.47866e-08, 0.99979)
bones/23/rotation = Quaternion(3.18831e-08, -0.0332867, 6.25233e-08, 0.999446)
bones/24/position = Vector3(-6.33301e-08, 0.143946, 4.3873e-08)
bones/24/rotation = Quaternion(0.309387, -0.0204933, -0.0190713, 0.950524)
bones/24/rotation = Quaternion(0.338416, -0.0332876, -0.0211057, 0.940171)
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)
@ -154,14 +154,14 @@ 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.4296, 0.0433173)
bones/46/rotation = Quaternion(-0.503894, 0.228676, 0.382182, 0.740091)
bones/47/position = Vector3(-0.169264, 1.4674, -0.0346418)
bones/47/rotation = Quaternion(-0.0634737, -0.138872, 0.974047, 0.167086)
bones/46/position = Vector3(-0.0113635, 1.43661, 0.0459832)
bones/46/rotation = Quaternion(-0.481394, 0.253217, 0.404934, 0.734963)
bones/47/position = Vector3(-0.174978, 1.47541, -0.0185348)
bones/47/rotation = Quaternion(-0.0275558, -0.144932, 0.975724, 0.161858)
bones/48/position = Vector3(1.88476e-07, 0.143946, 1.02445e-08)
bones/48/rotation = Quaternion(7.3233e-08, 0.0215803, 7.23502e-08, 0.999767)
bones/48/rotation = Quaternion(-5.65813e-08, 0.0458549, -5.67926e-08, 0.998948)
bones/49/position = Vector3(6.5191e-09, 0.143946, -1.95094e-08)
bones/49/rotation = Quaternion(0.343809, 0.0215807, 0.028999, 0.938344)
bones/49/rotation = Quaternion(0.377155, 0.0458556, 0.0284767, 0.924576)
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)
@ -187,10 +187,10 @@ 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.34853, -0.0259919)
bones/71/rotation = Quaternion(1.95051e-08, 0.61018, 0.792263, -4.63113e-08)
bones/72/position = Vector3(-0.113426, 1.34853, -0.0259919)
bones/72/rotation = Quaternion(1.95052e-08, 0.61018, 0.792263, -4.63112e-08)
bones/71/position = Vector3(0.127191, 1.35695, -0.0249443)
bones/71/rotation = Quaternion(2.00532e-08, 0.602166, 0.798371, -4.6003e-08)
bones/72/position = Vector3(-0.113426, 1.35695, -0.0249443)
bones/72/rotation = Quaternion(2.00533e-08, 0.602166, 0.798371, -4.60029e-08)
[node name="Knight_01" parent="CharacterRig/GameRig/Skeleton3D" index="0"]
visible = false
@ -208,7 +208,7 @@ anim_player = NodePath("../CharacterRig/AnimationPlayer")
parameters/MoveSpace/blend_position = -5.743
[node name="RightHandBone" type="BoneAttachment3D" parent="."]
transform = Transform3D(-0.962343, -0.270803, -0.0237137, 0.237444, -0.879849, 0.411686, -0.13235, 0.390553, 0.911017, -0.343081, 0.988376, -0.0175742)
transform = Transform3D(-0.962342, -0.270805, -0.0237103, 0.226727, -0.847696, 0.47959, -0.149975, 0.456154, 0.877172, -0.348796, 1.00468, 0.0147979)
bone_name = "DEF-hand.R"
bone_idx = 51
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="LeftHandBone" type="BoneAttachment3D" parent="."]
transform = Transform3D(-0.970518, 0.239091, 0.0304979, -0.219262, -0.928324, 0.300233, 0.100095, 0.284694, 0.953378, 0.345925, 0.975197, -0.040213)
transform = Transform3D(-0.970513, 0.239109, 0.0305206, -0.212339, -0.907971, 0.36125, 0.11409, 0.344117, 0.931969, 0.347554, 0.988646, -0.0177578)
bone_name = "DEF-hand.L"
bone_idx = 26
use_external_skeleton = true

View File

@ -1,8 +1,10 @@
extends Node3D
@export var player: Player
@export var speed_multiplier: float = 3.0
@onready var timer: Timer = $Timer
@onready var particles: GPUParticles3D = $GPUParticles3D
var direction: Vector3 = Vector3.ZERO
var dash_duration: float = 0.1
@ -12,12 +14,16 @@ func _physics_process(delta: float) -> void:
if direction.is_zero_approx():
return
player.velocity = direction * player.SPEED * 5.0
player.velocity = direction * player.SPEED * speed_multiplier
time_remaining -= delta
if time_remaining <= 0:
direction = Vector3.ZERO
particles.emitting = false
func _unhandled_input(event: InputEvent) -> void:
if not player.is_physics_processing():
return
if not timer.is_stopped():
return
@ -25,6 +31,7 @@ func _unhandled_input(event: InputEvent) -> void:
direction = player.get_movement_direction()
if not direction.is_zero_approx():
player.rig.playback.travel("Dash")
particles.emitting = true
timer.start(1.0)
time_remaining = dash_duration

View File

@ -2,8 +2,9 @@ extends CharacterBody3D
class_name Player
const SPEED = 5.0
const JUMP_VELOCITY = 4.5
const SPEED: float = 5.0
const JUMP_VELOCITY: float = 4.5
const DECAY: float = 8.0
# Stores the x/y direction of the camera
var _look := Vector2.ZERO
@ -97,16 +98,17 @@ func heavy_attack() -> void:
attack_cast.clear_exceptions()
func handle_idle_physics_frame(delta: float, direction: Vector3) -> void:
if !rig.is_idle():
if !rig.is_idle() and !rig.is_dashing():
return
velocity.x = exponential_decay(velocity.x, direction.x * SPEED, DECAY, delta)
velocity.z = exponential_decay(velocity.z, direction.z * SPEED, DECAY, delta)
if direction:
velocity.x = direction.x * SPEED
velocity.z = direction.z * SPEED
look_toward_direction(direction, delta)
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
func exponential_decay(a: float, b: float, decay: float, delta: float) -> float:
return b + (a - b) * exp(-decay * delta)
func handle_slashing_physics_frame(delta: float) -> void:
if !rig.is_slashing():

View File

@ -28,14 +28,18 @@ func update_animation_tree(direction: Vector3) -> void:
else:
run_weight_target = 1.0
func is_idle() -> bool:
return playback.get_current_node() == "MoveSpace"
func is_dashing() -> bool:
return playback.get_current_node() == "Dash"
func is_slashing() -> bool:
return playback.get_current_node() == "Slash"
func is_overhead() -> bool:
return playback.get_current_node() == "Overhead"
return playback.get_current_node() in ["Overhead", "OverheadRecover"]
func set_active_mesh(active_mesh: MeshInstance3D) -> void:
for child in skeleton_3d.get_children():