diff --git a/godot/player.tscn b/godot/player.tscn index b6fb1f0..3e00277 100644 --- a/godot/player.tscn +++ b/godot/player.tscn @@ -1,7 +1,9 @@ -[gd_scene load_steps=10 format=3 uid="uid://dw8q1vqnc657"] +[gd_scene load_steps=15 format=3 uid="uid://dw8q1vqnc657"] [ext_resource type="PackedScene" uid="uid://c8h5f82tunglj" path="res://Models/Characters/ModularCharacters.fbx" id="1_b4mv3"] [ext_resource type="AnimationLibrary" uid="uid://dpa5kel2sewxo" path="res://Models/Characters/Animations/BasicMotions@Idle01.fbx" id="1_wqiit"] +[ext_resource type="AnimationLibrary" uid="uid://du5bljpia3pci" path="res://Models/Characters/Animations/BasicMotions@Run01.fbx" id="2_nqgk0"] +[ext_resource type="AnimationLibrary" uid="uid://c6hvlg3lbhfjs" path="res://Models/Characters/Animations/BasicMotions@Walk01_ClosedHands.fbx" id="2_qsv71"] [sub_resource type="Animation" id="Animation_62nln"] resource_name = "Take 001" @@ -330,22 +332,44 @@ _data = { [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3b5eb"] animation = &"BasicMotions@Idle01/BasicMotions_Idle01_ClosedHands" +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_5ua7i"] + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_p73e4"] +animation = &"BasicMotions@Run01/BasicMotions_Run01 - Forwards" + [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_idcvn"] -graph_offset = Vector2(-154, 108) -nodes/Animation/node = SubResource("AnimationNodeAnimation_3b5eb") -nodes/Animation/position = Vector2(-320, 140) -node_connections = [&"output", 0, &"Animation"] +graph_offset = Vector2(-578.579, 250.949) +nodes/Idle/node = SubResource("AnimationNodeAnimation_3b5eb") +nodes/Idle/position = Vector2(-320, 140) +nodes/IdleWalkBlend/node = SubResource("AnimationNodeBlend2_5ua7i") +nodes/IdleWalkBlend/position = Vector2(140, 140) +nodes/Walk/node = SubResource("AnimationNodeAnimation_p73e4") +nodes/Walk/position = Vector2(-300, 260) +node_connections = [&"IdleWalkBlend", 0, &"Idle", &"IdleWalkBlend", 1, &"Walk", &"output", 0, &"IdleWalkBlend"] [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5wf40"] advance_mode = 2 [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7e1iu"] -states/BlendTree/node = SubResource("AnimationNodeBlendTree_idcvn") -states/BlendTree/position = Vector2(389, 112) +states/Idle/node = SubResource("AnimationNodeBlendTree_idcvn") +states/Idle/position = Vector2(389, 112) states/Start/position = Vector2(227, 112) -transitions = ["Start", "BlendTree", SubResource("AnimationNodeStateMachineTransition_5wf40")] +transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_5wf40")] graph_offset = Vector2(-219, -1) +[sub_resource type="GDScript" id="GDScript_nld2l"] +script/source = "extends AnimationTree + +@onready var player: Player = get_node(advance_expression_base_node) +var idle_walk_blend = 0.0 + +func _process(_delta): + if(player.get_is_moving()): + idle_walk_blend = move_toward(idle_walk_blend, 1.0, _delta * 5.0) + else: idle_walk_blend = move_toward(idle_walk_blend, 0.0, _delta * 5.0) + set(\"parameters/Idle/IdleWalkBlend/blend_amount\", idle_walk_blend) +" + [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_hqeid"] radius = 0.548248 height = 1.85415 @@ -383,11 +407,15 @@ slide_on_ceiling = false root_node = NodePath("../Model") libraries = { "": SubResource("AnimationLibrary_eyw6x"), -"BasicMotions@Idle01": ExtResource("1_wqiit") +"BasicMotions@Idle01": ExtResource("1_wqiit"), +"BasicMotions@Run01": ExtResource("2_nqgk0"), +"BasicMotions@Walk01_ClosedHands": ExtResource("2_qsv71") } tree_root = SubResource("AnimationNodeStateMachine_7e1iu") advance_expression_base_node = NodePath("..") anim_player = NodePath("../Model/AnimationPlayer") +parameters/Idle/IdleWalkBlend/blend_amount = 0 +script = SubResource("GDScript_nld2l") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.925894, 0) @@ -399,17 +427,17 @@ shape = SubResource("CapsuleShape3D_hqeid") [node name="GeneralSkeleton" parent="Model/RootNode" index="0"] bones/0/rotation = Quaternion(-2.98023e-08, 5.55112e-17, 5.55112e-17, 1) -bones/1/position = Vector3(0.00799814, 0.822939, -0.0170919) -bones/1/rotation = Quaternion(-0.0173024, -0.0769098, 0.00854839, 0.996851) -bones/2/rotation = Quaternion(0.00896411, 0.00637054, 0.000265095, 0.99994) -bones/3/rotation = Quaternion(0.00882963, 0.00637047, 0.000267564, 0.999941) -bones/4/rotation = Quaternion(0.00907812, 0.00637071, 0.000262791, 0.999939) -bones/5/rotation = Quaternion(-0.0130848, 0.0288738, -0.00513406, 0.999484) -bones/6/rotation = Quaternion(-0.0130942, 0.0288758, -0.00513693, 0.999484) +bones/1/position = Vector3(0.00655603, 0.823848, -0.0163162) +bones/1/rotation = Quaternion(-0.0184563, -0.0841674, 0.0119519, 0.996209) +bones/2/rotation = Quaternion(0.0087954, 0.00637039, 0.000268324, 0.999941) +bones/3/rotation = Quaternion(0.00863832, 0.00637029, 0.000271212, 0.999942) +bones/4/rotation = Quaternion(0.00889527, 0.00637052, 0.000266287, 0.99994) +bones/5/rotation = Quaternion(-0.0138771, 0.0325252, -0.0066613, 0.999352) +bones/6/rotation = Quaternion(-0.0138652, 0.0325115, -0.00665304, 0.999353) bones/10/rotation = Quaternion(0.519859, 0.470118, 0.477057, -0.530238) -bones/11/rotation = Quaternion(0.24205, 0.842133, -0.4545, -0.160169) -bones/12/rotation = Quaternion(-0.0282314, -0.699896, -0.0284688, 0.713119) -bones/13/rotation = Quaternion(-0.0439467, 0.565119, -0.143898, 0.811174) +bones/11/rotation = Quaternion(0.247026, 0.839357, -0.458215, -0.156513) +bones/12/rotation = Quaternion(-0.0388633, -0.696869, -0.0391896, 0.715072) +bones/13/rotation = Quaternion(-0.0420051, 0.558654, -0.140026, 0.816415) bones/14/rotation = Quaternion(-0.256269, 0.776338, 0.203807, 0.538599) bones/15/rotation = Quaternion(0.14485, 0.51961, 0.145065, 0.829446) bones/16/rotation = Quaternion(0.159353, 0.516644, 0.140377, 0.829446) @@ -420,9 +448,9 @@ bones/21/rotation = Quaternion(0.494946, 0.0399225, 0.106743, 0.861418) bones/22/rotation = Quaternion(0.554517, 0.0271624, 0.0237916, 0.831389) bones/23/rotation = Quaternion(0.554045, 0.0389721, 0.0175394, 0.831389) bones/27/rotation = Quaternion(0.5168, -0.475173, -0.481158, -0.52499) -bones/28/rotation = Quaternion(-0.125884, 0.859315, -0.455472, 0.195646) -bones/29/rotation = Quaternion(0.0109876, 0.709589, -0.0110795, 0.704443) -bones/30/rotation = Quaternion(0.0112271, -0.589384, 0.0652025, 0.805139) +bones/28/rotation = Quaternion(-0.116079, 0.860613, -0.45194, 0.204012) +bones/29/rotation = Quaternion(0.0201014, 0.71151, -0.0202694, 0.702096) +bones/30/rotation = Quaternion(0.00817088, -0.59897, 0.0699655, 0.797667) bones/31/rotation = Quaternion(-0.256268, -0.776338, -0.203807, 0.538599) bones/32/rotation = Quaternion(0.14485, -0.51961, -0.145065, 0.829446) bones/33/rotation = Quaternion(0.159352, -0.516644, -0.140377, 0.829446) @@ -432,19 +460,19 @@ bones/36/rotation = Quaternion(0.49701, -0.238709, -0.0692157, 0.831389) bones/38/rotation = Quaternion(0.494946, -0.0399222, -0.106743, 0.861418) bones/39/rotation = Quaternion(0.554517, -0.0271621, -0.0237913, 0.831389) bones/40/rotation = Quaternion(0.554045, -0.0389717, -0.0175393, 0.831389) -bones/50/rotation = Quaternion(-0.0911938, 0.0463263, 0.991272, 0.0831711) +bones/50/rotation = Quaternion(-0.083346, 0.046056, 0.991826, 0.0849313) bones/50/scale = Vector3(1.00002, 0.999999, 1) -bones/51/rotation = Quaternion(0.00970492, 0.959913, -0.280113, -0.0029922) +bones/51/rotation = Quaternion(0.00967535, 0.960162, -0.279261, -0.00298304) bones/51/scale = Vector3(1.00002, 0.999999, 1.00002) -bones/52/rotation = Quaternion(0.0792991, 0.536526, -0.839989, -0.0164049) +bones/52/rotation = Quaternion(0.0779514, 0.536554, -0.840102, -0.0161721) bones/52/scale = Vector3(0.999948, 0.999973, 1.00001) bones/54/rotation = Quaternion(9.7728e-07, 1, -1.50204e-05, 3.50609e-06) bones/54/scale = Vector3(0.999999, 0.999986, 1.00002) -bones/56/rotation = Quaternion(0.179453, 0.139217, 0.970475, -0.0811989) +bones/56/rotation = Quaternion(0.187667, 0.133003, 0.969895, -0.0799738) bones/56/scale = Vector3(1.00002, 0.999999, 1) -bones/57/rotation = Quaternion(-0.0102556, 0.955128, -0.295999, 0.00316205) +bones/57/rotation = Quaternion(-0.0100425, 0.957016, -0.289844, 0.00309644) bones/57/scale = Vector3(1.00001, 0.999999, 1.00001) -bones/58/rotation = Quaternion(-0.0675913, 0.607901, -0.790822, 0.0220936) +bones/58/rotation = Quaternion(-0.0689188, 0.610305, -0.788841, 0.0225531) bones/58/scale = Vector3(0.999956, 0.999987, 1.00001) bones/60/rotation = Quaternion(-6.79618e-07, 1, -9.98378e-06, -2.30227e-06) bones/60/scale = Vector3(0.999999, 0.999991, 1.00001) @@ -1730,7 +1758,9 @@ visible = false [node name="AnimationPlayer" parent="Model" index="1"] libraries = { "": SubResource("AnimationLibrary_eyw6x"), -"BasicMotions@Idle01": ExtResource("1_wqiit") +"BasicMotions@Idle01": ExtResource("1_wqiit"), +"BasicMotions@Run01": ExtResource("2_nqgk0"), +"BasicMotions@Walk01_ClosedHands": ExtResource("2_qsv71") } [editable path="Model"]