Add basic animation and state machine for idle and run
This commit is contained in:
parent
7b195558e1
commit
a5dbfe6bbf
File diff suppressed because it is too large
Load Diff
@ -1,120 +1,155 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://ckwydalda0teo"]
|
[gd_scene load_steps=11 format=3 uid="uid://ckwydalda0teo"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://ckjbqjere1jpf" path="res://src/scripts/player/rig.gd" id="1_1br2m"]
|
||||||
[ext_resource type="PackedScene" uid="uid://xivf38sp0l78" path="res://assets/models/character/character_rig.glb" id="1_icnkf"]
|
[ext_resource type="PackedScene" uid="uid://xivf38sp0l78" path="res://assets/models/character/character_rig.glb" id="1_icnkf"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_eek7r"]
|
||||||
|
animation = &"Run"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_gxy77"]
|
||||||
|
animation = &"Idle"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_djdpq"]
|
||||||
|
blend_point_0/node = SubResource("AnimationNodeAnimation_eek7r")
|
||||||
|
blend_point_0/pos = 1.0
|
||||||
|
blend_point_1/node = SubResource("AnimationNodeAnimation_gxy77")
|
||||||
|
blend_point_1/pos = -1.0
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1br2m"]
|
||||||
|
animation = &"Slash"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gkl4x"]
|
||||||
|
advance_mode = 2
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_eek7r"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gxy77"]
|
||||||
|
switch_mode = 2
|
||||||
|
advance_mode = 2
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_mq48a"]
|
||||||
|
states/MoveSpace/node = SubResource("AnimationNodeBlendSpace1D_djdpq")
|
||||||
|
states/MoveSpace/position = Vector2(434, 28)
|
||||||
|
states/Slash/node = SubResource("AnimationNodeAnimation_1br2m")
|
||||||
|
states/Slash/position = Vector2(434, 135)
|
||||||
|
states/Start/position = Vector2(239, 28)
|
||||||
|
transitions = ["Start", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_gkl4x"), "MoveSpace", "Slash", SubResource("AnimationNodeStateMachineTransition_eek7r"), "Slash", "MoveSpace", SubResource("AnimationNodeStateMachineTransition_gxy77")]
|
||||||
|
graph_offset = Vector2(-357, -91)
|
||||||
|
|
||||||
[node name="Rig" type="Node3D"]
|
[node name="Rig" type="Node3D"]
|
||||||
|
script = ExtResource("1_1br2m")
|
||||||
|
|
||||||
[node name="CharacterRig" parent="." instance=ExtResource("1_icnkf")]
|
[node name="CharacterRig" parent="." instance=ExtResource("1_icnkf")]
|
||||||
|
|
||||||
[node name="Skeleton3D" parent="CharacterRig/GameRig" index="0"]
|
[node name="Skeleton3D" parent="CharacterRig/GameRig" index="0"]
|
||||||
bones/0/position = Vector3(0.0276682, 0.903179, 0.0086448)
|
bones/0/position = Vector3(3.37508e-15, 0.891988, -0.0481736)
|
||||||
bones/0/rotation = Quaternion(0.155586, 1.17758e-07, 1.85474e-08, 0.987822)
|
bones/0/rotation = Quaternion(0.12582, 1.18262e-07, 1.49989e-08, 0.992053)
|
||||||
bones/1/rotation = Quaternion(-0.0497934, 0.00362305, 0.058142, 0.997059)
|
bones/1/rotation = Quaternion(-0.0566577, -0.00072973, -0.0117082, 0.998325)
|
||||||
bones/2/position = Vector3(6.23959e-10, 0.140892, 3.06754e-08)
|
bones/2/position = Vector3(3.20474e-09, 0.146689, -1.95578e-08)
|
||||||
bones/2/rotation = Quaternion(0.00933042, 0.000201999, -0.0491224, 0.998749)
|
bones/2/rotation = Quaternion(-0.00441575, -0.000457798, 0.00321564, 0.999985)
|
||||||
bones/3/position = Vector3(2.32707e-09, 0.175705, -2.21538e-07)
|
bones/3/position = Vector3(-2.01263e-09, 0.202058, -2.51457e-08)
|
||||||
bones/3/rotation = Quaternion(-0.265407, 0.0310372, -0.0790426, 0.96039)
|
bones/3/rotation = Quaternion(-0.0994171, -0.000418098, 0.00851803, 0.995009)
|
||||||
bones/4/position = Vector3(-7.45063e-09, 0.0827501, -4.22106e-08)
|
bones/4/position = Vector3(3.02934e-10, 0.0925562, 3.91155e-08)
|
||||||
bones/4/rotation = Quaternion(0.430518, 0.0184732, 0.225987, 0.873638)
|
bones/4/rotation = Quaternion(0.278845, 1.4315e-08, 9.57075e-08, 0.960336)
|
||||||
bones/5/rotation = Quaternion(-0.0948568, -5.65495e-09, -1.01598e-07, 0.995491)
|
bones/5/rotation = Quaternion(-0.0948564, -2.80691e-14, -2.26155e-08, 0.995491)
|
||||||
bones/6/rotation = Quaternion(-0.180423, -0.04801, -0.149312, 0.971004)
|
bones/6/rotation = Quaternion(-0.153723, -1.17812e-07, -1.81868e-08, 0.988114)
|
||||||
bones/7/position = Vector3(0.0276682, 0.903179, 0.00864496)
|
bones/7/position = Vector3(-3.15335e-08, 0.891988, -0.0481735)
|
||||||
bones/7/rotation = Quaternion(-0.0703741, -0.739249, -0.405459, 0.533068)
|
bones/7/rotation = Quaternion(-0.0863677, -0.751104, -0.383052, 0.530711)
|
||||||
bones/8/position = Vector3(0.0276682, 0.903179, 0.00864482)
|
bones/8/position = Vector3(-5.01311e-08, 0.891988, -0.0481735)
|
||||||
bones/8/rotation = Quaternion(-0.070374, 0.739249, 0.405459, 0.533068)
|
bones/8/rotation = Quaternion(-0.0863677, 0.751104, 0.383052, 0.530711)
|
||||||
bones/9/position = Vector3(0.158812, 0.968479, 0.0256444)
|
bones/9/position = Vector3(0.131144, 0.958192, -0.0351291)
|
||||||
bones/9/rotation = Quaternion(0.986866, -0.0347172, -0.036593, -0.153461)
|
bones/9/rotation = Quaternion(0.992486, 0.0211361, -0.030826, 0.116508)
|
||||||
bones/10/position = Vector3(-1.28047e-08, 0.263565, 5.48525e-08)
|
bones/10/position = Vector3(-2.36129e-08, 0.26601, -2.14789e-08)
|
||||||
bones/10/rotation = Quaternion(-4.57173e-08, -0.0075665, 2.94687e-08, 0.999971)
|
bones/10/rotation = Quaternion(-3.13921e-08, -0.000695086, 1.20449e-08, 1)
|
||||||
bones/11/position = Vector3(-7.19732e-09, 0.263565, -7.01984e-08)
|
bones/11/position = Vector3(-4.6306e-08, 0.26601, 2.42145e-08)
|
||||||
bones/11/rotation = Quaternion(0.533853, -0.00756582, 0.00477709, 0.84553)
|
bones/11/rotation = Quaternion(0.431573, -0.000700556, 0.000335292, 0.902078)
|
||||||
bones/12/position = Vector3(-6.11355e-09, 0.223526, 5.72814e-09)
|
bones/12/position = Vector3(3.05151e-08, 0.22603, 5.03768e-08)
|
||||||
bones/12/rotation = Quaternion(2.18907e-08, -0.00327906, 7.14397e-08, 0.999995)
|
bones/12/rotation = Quaternion(-8.19226e-09, -0.00710644, 4.16102e-08, 0.999975)
|
||||||
bones/13/position = Vector3(-1.06738e-08, 0.223526, 1.43191e-08)
|
bones/13/position = Vector3(-2.95495e-08, 0.22603, 2.68392e-09)
|
||||||
bones/13/rotation = Quaternion(-0.486355, 0.0179254, -0.0581729, 0.871638)
|
bones/13/rotation = Quaternion(-0.756674, 0.0119043, 0.0244321, 0.653227)
|
||||||
bones/14/position = Vector3(2.45242e-09, 0.139878, -1.43056e-08)
|
bones/14/position = Vector3(-3.05481e-08, 0.139877, 1.64787e-08)
|
||||||
bones/14/rotation = Quaternion(-0.000103867, 0.96745, -0.253064, -0.000381529)
|
bones/14/rotation = Quaternion(-9.66743e-05, 0.967474, -0.252972, -0.000383447)
|
||||||
bones/15/position = Vector3(-0.103475, 0.968479, 0.0256444)
|
bones/15/position = Vector3(-0.131144, 0.958192, -0.0351291)
|
||||||
bones/15/rotation = Quaternion(0.925588, 1.73114e-05, 0.0210855, 0.377945)
|
bones/15/rotation = Quaternion(0.972155, -0.00597653, 0.0271868, 0.232681)
|
||||||
bones/16/position = Vector3(-1.98544e-08, 0.26553, -1.10504e-07)
|
bones/16/position = Vector3(-1.10042e-08, 0.265705, -3.31989e-08)
|
||||||
bones/16/rotation = Quaternion(1.83106e-08, 0.00524275, -7.19832e-08, 0.999986)
|
bones/16/rotation = Quaternion(-3.43227e-08, 0.00314323, 8.33075e-10, 0.999995)
|
||||||
bones/17/position = Vector3(1.9963e-08, 0.26553, 2.04309e-08)
|
bones/17/position = Vector3(1.83545e-08, 0.265705, 6.98543e-10)
|
||||||
bones/17/rotation = Quaternion(0.428998, 0.00524208, -0.00248965, 0.903287)
|
bones/17/rotation = Quaternion(0.454904, 0.00335452, -0.00171366, 0.890532)
|
||||||
bones/18/position = Vector3(2.07135e-08, 0.225541, 2.05872e-08)
|
bones/18/position = Vector3(1.2807e-08, 0.225719, -8.28774e-09)
|
||||||
bones/18/rotation = Quaternion(6.82911e-08, -0.00656821, 1.66762e-09, 0.999978)
|
bones/18/rotation = Quaternion(-2.29017e-08, -0.00785732, 3.30149e-08, 0.999969)
|
||||||
bones/19/position = Vector3(6.57201e-09, 0.225541, -9.83437e-09)
|
bones/19/position = Vector3(-1.27748e-08, 0.225719, 1.12004e-08)
|
||||||
bones/19/rotation = Quaternion(-0.676712, -0.0268497, 0.00119576, 0.735757)
|
bones/19/rotation = Quaternion(-0.692097, -0.0282132, -0.000453438, 0.721253)
|
||||||
bones/20/position = Vector3(1.26393e-08, 0.139878, -1.33116e-08)
|
bones/20/position = Vector3(-1.30142e-08, 0.139877, -2.77457e-09)
|
||||||
bones/20/rotation = Quaternion(-9.94648e-05, 0.967459, -0.253029, -0.00038312)
|
bones/20/rotation = Quaternion(-9.96472e-05, 0.967461, -0.253021, -0.000383039)
|
||||||
bones/21/position = Vector3(0.0318322, 1.38876, 0.13565)
|
bones/21/position = Vector3(0.0251286, 1.42323, 0.0409021)
|
||||||
bones/21/rotation = Quaternion(-0.498675, -0.214179, -0.455467, 0.705692)
|
bones/21/rotation = Quaternion(-0.50156, -0.254509, -0.394033, 0.726912)
|
||||||
bones/22/position = Vector3(0.198838, 1.40388, 0.0699175)
|
bones/22/position = Vector3(0.187432, 1.45872, -0.0285825)
|
||||||
bones/22/rotation = Quaternion(-0.208708, 0.364962, 0.899386, -0.119786)
|
bones/22/rotation = Quaternion(0.06045, -0.158053, 0.973842, -0.151647)
|
||||||
bones/23/position = Vector3(-9.60146e-08, 0.140731, 1.69161e-07)
|
bones/23/position = Vector3(-5.41331e-09, 0.143946, -2.98023e-08)
|
||||||
bones/23/rotation = Quaternion(-1.48099e-08, -0.153514, -5.42637e-08, 0.988147)
|
bones/23/rotation = Quaternion(7.73339e-08, -0.0080107, -1.99305e-08, 0.999968)
|
||||||
bones/24/position = Vector3(-5.41769e-08, 0.140731, 9.8138e-08)
|
bones/24/position = Vector3(-6.33301e-08, 0.143946, 4.3873e-08)
|
||||||
bones/24/rotation = Quaternion(0.52553, -0.153514, -0.276021, 0.789977)
|
bones/24/rotation = Quaternion(0.277839, -0.00675305, -0.016611, 0.96046)
|
||||||
bones/25/position = Vector3(1.8073e-08, 0.124275, 4.49017e-08)
|
bones/25/position = Vector3(1.30385e-08, 0.127601, 6.51926e-09)
|
||||||
bones/25/rotation = Quaternion(-4.36853e-07, 0.0212255, 1.16255e-07, 0.999775)
|
bones/25/rotation = Quaternion(1.49943e-07, -1.20606e-07, 9.91859e-08, 1)
|
||||||
bones/26/position = Vector3(1.16654e-07, 0.124275, 2.52368e-07)
|
bones/26/position = Vector3(2.06034e-08, 0.127601, 2.42761e-08)
|
||||||
bones/26/rotation = Quaternion(-0.139349, 0.0209606, -0.253272, 0.957077)
|
bones/26/rotation = Quaternion(-0.00824883, -0.00027077, -0.0328667, 0.999426)
|
||||||
bones/28/rotation = Quaternion(0.702583, -0.000939986, -0.00133528, 0.7116)
|
bones/28/rotation = Quaternion(0.702583, -0.000939743, -0.00133552, 0.7116)
|
||||||
bones/29/rotation = Quaternion(0.74112, 0.00218249, 0.00265346, 0.671364)
|
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/30/rotation = Quaternion(0.32527, 0.890055, 0.295977, -0.119997)
|
||||||
bones/31/rotation = Quaternion(0.514882, -0.114149, 0.114483, 0.841879)
|
bones/31/rotation = Quaternion(0.514882, -0.114149, 0.114482, 0.841879)
|
||||||
bones/32/rotation = Quaternion(0.592003, -0.038135, -0.0906995, 0.799907)
|
bones/32/rotation = Quaternion(0.592003, -0.0381348, -0.090699, 0.799907)
|
||||||
bones/34/position = Vector3(-0.00316934, 0.0987206, 0.0147916)
|
bones/34/position = Vector3(-0.00316938, 0.0987206, 0.0147918)
|
||||||
bones/34/rotation = Quaternion(-0.0674701, 0.718446, 0.0663974, 0.689112)
|
bones/34/rotation = Quaternion(-0.0674699, 0.718446, 0.0663966, 0.689112)
|
||||||
bones/35/rotation = Quaternion(0.580804, -0.000892605, -0.0014976, 0.814042)
|
bones/35/rotation = Quaternion(0.580803, -0.000892135, -0.0014975, 0.814042)
|
||||||
bones/36/rotation = Quaternion(0.682777, 0.00174459, 0.00256601, 0.730621)
|
bones/36/rotation = Quaternion(0.682777, 0.00174509, 0.00256596, 0.73062)
|
||||||
bones/37/rotation = Quaternion(-0.00426538, 0.736714, 0.0394789, 0.675038)
|
bones/37/rotation = Quaternion(-0.00426514, 0.736714, 0.0394785, 0.675038)
|
||||||
bones/38/position = Vector3(-0.00622947, 0.0926414, -0.0236346)
|
bones/38/position = Vector3(-0.00622951, 0.0926415, -0.0236344)
|
||||||
bones/38/rotation = Quaternion(-0.109874, 0.743351, 0.0333518, 0.658973)
|
bones/38/rotation = Quaternion(-0.109873, 0.743351, 0.0333507, 0.658973)
|
||||||
bones/39/rotation = Quaternion(0.63004, 0.00151927, 0.00238002, 0.776557)
|
bones/39/rotation = Quaternion(0.630039, 0.00151959, 0.00237944, 0.776559)
|
||||||
bones/40/rotation = Quaternion(0.652642, -0.00308157, -0.0042118, 0.757649)
|
bones/40/rotation = Quaternion(0.652643, -0.00308142, -0.00421108, 0.757648)
|
||||||
bones/41/rotation = Quaternion(-0.0684189, 0.72411, 0.0332352, 0.685477)
|
bones/41/rotation = Quaternion(-0.0684174, 0.72411, 0.0332337, 0.685478)
|
||||||
bones/42/position = Vector3(-0.00715369, 0.0679858, -0.0481985)
|
bones/42/position = Vector3(-0.00715362, 0.0679857, -0.0481983)
|
||||||
bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358923, 0.587807)
|
bones/42/rotation = Quaternion(-0.120913, 0.799109, 0.0358921, 0.587807)
|
||||||
bones/43/rotation = Quaternion(0.498693, -0.020271, -0.0256949, 0.866161)
|
bones/43/rotation = Quaternion(0.498693, -0.0202705, -0.0256953, 0.866161)
|
||||||
bones/44/rotation = Quaternion(0.715384, 0.0353053, 0.0573144, 0.695481)
|
bones/44/rotation = Quaternion(0.715385, 0.035306, 0.0573145, 0.695481)
|
||||||
bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.0250262, 0.67184)
|
bones/45/rotation = Quaternion(-0.129059, 0.728936, -0.0250259, 0.67184)
|
||||||
bones/46/position = Vector3(-0.00423753, 1.39393, 0.137642)
|
bones/46/position = Vector3(-0.0113635, 1.42323, 0.0409021)
|
||||||
bones/46/rotation = Quaternion(-0.437715, 0.32082, 0.377528, 0.750302)
|
bones/46/rotation = Quaternion(-0.527917, 0.201754, 0.357521, 0.743491)
|
||||||
bones/47/position = Vector3(-0.166419, 1.45619, 0.090094)
|
bones/47/position = Vector3(-0.162072, 1.45806, -0.0513614)
|
||||||
bones/47/rotation = Quaternion(-0.165904, -0.456877, 0.803189, 0.344421)
|
bones/47/rotation = Quaternion(-0.101804, -0.132181, 0.97079, 0.172428)
|
||||||
bones/48/position = Vector3(-1.79147e-07, 0.142917, 7.63032e-08)
|
bones/48/position = Vector3(1.88476e-07, 0.143946, 1.02445e-08)
|
||||||
bones/48/rotation = Quaternion(-2.96833e-08, -0.0422389, 4.1837e-08, 0.999108)
|
bones/48/rotation = Quaternion(-3.76897e-08, -0.00451446, -5.02688e-08, 0.99999)
|
||||||
bones/49/position = Vector3(1.0754e-07, 0.142917, 2.90456e-08)
|
bones/49/position = Vector3(6.5191e-09, 0.143946, -1.95094e-08)
|
||||||
bones/49/rotation = Quaternion(0.316857, -0.0422384, 0.415565, 0.851542)
|
bones/49/rotation = Quaternion(0.307483, -0.00462726, 0.0284921, 0.951116)
|
||||||
bones/50/position = Vector3(5.42904e-08, 0.126555, 7.38829e-09)
|
bones/50/position = Vector3(-1.48779e-07, 0.1276, 5.9139e-08)
|
||||||
bones/50/rotation = Quaternion(-1.10793e-07, 0.0256502, 2.23855e-08, 0.999671)
|
bones/50/rotation = Quaternion(-8.73115e-08, 2.7474e-08, -1.28057e-07, 1)
|
||||||
bones/51/position = Vector3(-9.53121e-09, 0.126556, 5.9332e-09)
|
bones/51/position = Vector3(1.9461e-07, 0.127601, 6.06248e-08)
|
||||||
bones/51/rotation = Quaternion(-0.0783404, 0.0259177, 0.201201, 0.976068)
|
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/52/rotation = Quaternion(-0.2563, 0.855859, 0.0299184, -0.448241)
|
||||||
bones/53/rotation = Quaternion(0.694912, 0.107144, -0.103548, 0.703488)
|
bones/53/rotation = Quaternion(0.694912, 0.107145, -0.103549, 0.703488)
|
||||||
bones/54/rotation = Quaternion(0.741121, -0.00218248, -0.00265434, 0.671363)
|
bones/54/rotation = Quaternion(0.74112, -0.00218237, -0.00265409, 0.671363)
|
||||||
bones/55/rotation = Quaternion(-0.32527, 0.890055, 0.295976, 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.592004, 0.038134, 0.0906991, 0.799907)
|
bones/57/rotation = Quaternion(0.592004, 0.0381346, 0.0906992, 0.799907)
|
||||||
bones/59/position = Vector3(0.00316948, 0.0987208, 0.0147918)
|
bones/59/position = Vector3(0.00316943, 0.0987207, 0.0147917)
|
||||||
bones/59/rotation = Quaternion(0.138771, -0.704916, 0.15571, 0.677932)
|
bones/59/rotation = Quaternion(0.138771, -0.704916, 0.15571, 0.677932)
|
||||||
bones/60/rotation = Quaternion(0.579985, 0.0462612, -0.0308753, 0.812727)
|
bones/60/rotation = Quaternion(0.579984, 0.0462615, -0.0308755, 0.812727)
|
||||||
bones/61/rotation = Quaternion(0.682777, -0.00174739, -0.00256467, 0.730621)
|
bones/61/rotation = Quaternion(0.682777, -0.00174718, -0.00256448, 0.73062)
|
||||||
bones/62/rotation = Quaternion(-0.0042654, -0.736714, -0.0394787, 0.675038)
|
bones/62/rotation = Quaternion(-0.00426532, -0.736714, -0.0394788, 0.675038)
|
||||||
bones/63/position = Vector3(0.00622964, 0.0926415, -0.0236343)
|
bones/63/position = Vector3(0.00622955, 0.0926417, -0.0236344)
|
||||||
bones/63/rotation = Quaternion(0.104096, -0.719607, 0.186262, 0.660785)
|
bones/63/rotation = Quaternion(0.104095, -0.719607, 0.186262, 0.660784)
|
||||||
bones/64/rotation = Quaternion(0.670693, 0.0163393, -0.0185665, 0.741323)
|
bones/64/rotation = Quaternion(0.670693, 0.0163391, -0.0185663, 0.741323)
|
||||||
bones/65/rotation = Quaternion(0.692499, 0.00330374, 0.0040394, 0.7214)
|
bones/65/rotation = Quaternion(0.692499, 0.00330364, 0.00403917, 0.7214)
|
||||||
bones/66/rotation = Quaternion(-0.0684177, -0.72411, -0.033234, 0.685477)
|
bones/66/rotation = Quaternion(-0.0684178, -0.72411, -0.0332339, 0.685477)
|
||||||
bones/67/position = Vector3(0.00715371, 0.0679857, -0.0481984)
|
bones/67/position = Vector3(0.00715371, 0.0679859, -0.0481984)
|
||||||
bones/67/rotation = Quaternion(0.108364, -0.768224, 0.166291, 0.608635)
|
bones/67/rotation = Quaternion(0.108364, -0.768224, 0.166291, 0.608635)
|
||||||
bones/68/rotation = Quaternion(0.629954, 0.0295146, 0.0177509, 0.775868)
|
bones/68/rotation = Quaternion(0.629954, 0.0295149, 0.0177509, 0.775869)
|
||||||
bones/69/rotation = Quaternion(0.816677, -0.0439534, -0.0509862, 0.573155)
|
bones/69/rotation = Quaternion(0.816678, -0.0439534, -0.0509861, 0.573155)
|
||||||
bones/70/rotation = Quaternion(-0.12906, -0.728936, 0.0250259, 0.67184)
|
bones/70/rotation = Quaternion(-0.12906, -0.728937, 0.0250258, 0.67184)
|
||||||
bones/71/position = Vector3(0.118584, 1.30715, 0.0484368)
|
bones/71/position = Vector3(0.127191, 1.34028, -0.0269978)
|
||||||
bones/71/rotation = Quaternion(0.0614123, 0.53913, 0.83878, 0.0449082)
|
bones/71/rotation = Quaternion(1.89247e-08, 0.618632, 0.785681, -4.66233e-08)
|
||||||
bones/72/position = Vector3(-0.119248, 1.34121, 0.0615744)
|
bones/72/position = Vector3(-0.113426, 1.34028, -0.0269979)
|
||||||
bones/72/rotation = Quaternion(0.0614123, 0.53913, 0.83878, 0.0449082)
|
bones/72/rotation = Quaternion(1.89247e-08, 0.618632, 0.785681, -4.66232e-08)
|
||||||
|
|
||||||
[node name="Knight_01" parent="CharacterRig/GameRig/Skeleton3D" index="0"]
|
[node name="Knight_01" parent="CharacterRig/GameRig/Skeleton3D" index="0"]
|
||||||
visible = false
|
visible = false
|
||||||
@ -125,4 +160,10 @@ visible = false
|
|||||||
[node name="Villager_02" parent="CharacterRig/GameRig/Skeleton3D" index="3"]
|
[node name="Villager_02" parent="CharacterRig/GameRig/Skeleton3D" index="3"]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
|
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||||
|
root_node = NodePath("../CharacterRig")
|
||||||
|
tree_root = SubResource("AnimationNodeStateMachine_mq48a")
|
||||||
|
anim_player = NodePath("../CharacterRig/AnimationPlayer")
|
||||||
|
parameters/MoveSpace/blend_position = -5.743
|
||||||
|
|
||||||
[editable path="CharacterRig"]
|
[editable path="CharacterRig"]
|
||||||
|
|||||||
@ -15,6 +15,7 @@ var _look := Vector2.ZERO
|
|||||||
@onready var horizontal_pivot: Node3D = $HorizontalPivot
|
@onready var horizontal_pivot: Node3D = $HorizontalPivot
|
||||||
@onready var vertical_pivot: Node3D = $HorizontalPivot/VerticalPivot
|
@onready var vertical_pivot: Node3D = $HorizontalPivot/VerticalPivot
|
||||||
@onready var rig_pivot: Node3D = $RigPivot
|
@onready var rig_pivot: Node3D = $RigPivot
|
||||||
|
@onready var rig: Node3D = $RigPivot/Rig
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||||
@ -30,6 +31,7 @@ func _physics_process(delta: float) -> void:
|
|||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
|
|
||||||
var direction := get_movement_direction()
|
var direction := get_movement_direction()
|
||||||
|
rig.update_animation_tree(direction)
|
||||||
if direction:
|
if direction:
|
||||||
velocity.x = direction.x * SPEED
|
velocity.x = direction.x * SPEED
|
||||||
velocity.z = direction.z * SPEED
|
velocity.z = direction.z * SPEED
|
||||||
|
|||||||
21
src/scripts/player/rig.gd
Normal file
21
src/scripts/player/rig.gd
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
@export var animation_speed: float = 10.0
|
||||||
|
|
||||||
|
@onready var animation_tree: AnimationTree = $AnimationTree
|
||||||
|
|
||||||
|
var run_path: String = "parameters/MoveSpace/blend_position"
|
||||||
|
var run_weight_target: float = -1.0
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
animation_tree[run_path] = move_toward(
|
||||||
|
animation_tree[run_path],
|
||||||
|
run_weight_target,
|
||||||
|
delta * animation_speed
|
||||||
|
)
|
||||||
|
|
||||||
|
func update_animation_tree(direction: Vector3) -> void:
|
||||||
|
if direction.is_zero_approx():
|
||||||
|
run_weight_target = -1.0
|
||||||
|
else:
|
||||||
|
run_weight_target = 1.0
|
||||||
1
src/scripts/player/rig.gd.uid
Normal file
1
src/scripts/player/rig.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://ckjbqjere1jpf
|
||||||
Loading…
x
Reference in New Issue
Block a user