diff --git a/assets/models/characters/batrix.glb b/assets/models/characters/batrix.glb index 8a6b19d..33e8a8c 100644 --- a/assets/models/characters/batrix.glb +++ b/assets/models/characters/batrix.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46e095fc27416a1850c32e8fd07ede7e0147e92a010e9e077af5a459b9944770 -size 321956 +oid sha256:c9f93a218faf0209581bb6f1344bfad9b044ad41e4140f31ddfa17ff224bc181 +size 446788 diff --git a/assets/models/characters/batrix.glb.import b/assets/models/characters/batrix.glb.import index 783473d..fd7743d 100644 --- a/assets/models/characters/batrix.glb.import +++ b/assets/models/characters/batrix.glb.import @@ -3,7 +3,7 @@ importer="scene" importer_version=1 type="PackedScene" -uid="uid://h7nclbup16w3" +uid="uid://b4q85h3ndkh5u" path="res://.godot/imported/batrix.glb-2a26ce30df79829d9ecd076dc9b45214.scn" [deps] @@ -29,7 +29,7 @@ animation/import=true animation/fps=30 animation/trimming=false animation/remove_immutable_tracks=true -animation/import_rest_as_RESET=true +animation/import_rest_as_RESET=false import_script/path="" _subresources={ "materials": { @@ -41,11 +41,6 @@ _subresources={ "use_external/enabled": true, "use_external/path": "res://resources/materials/characters/batrix_mat.tres" } -}, -"nodes": { -"PATH:Armature/Skeleton3D": { -"rest_pose/external_animation_library": null -} } } gltf/naming_version=1 diff --git a/scenes/player.tscn b/scenes/player.tscn index b2452aa..0dafa50 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -1,11 +1,42 @@ -[gd_scene load_steps=10 format=3 uid="uid://b73y71y3efmv"] +[gd_scene load_steps=18 format=3 uid="uid://b73y71y3efmv"] [ext_resource type="Script" path="res://scripts/player/player.gd" id="1_xt3i8"] [ext_resource type="Material" uid="uid://cc18ee0wbfoud" path="res://resources/materials/debug/debug_player.tres" id="2_0p422"] -[ext_resource type="PackedScene" uid="uid://h7nclbup16w3" path="res://assets/models/characters/batrix.glb" id="3_7s4q6"] [ext_resource type="Script" path="res://scripts/player/player_attack.gd" id="3_8pbtx"] +[ext_resource type="PackedScene" uid="uid://b4q85h3ndkh5u" path="res://assets/models/characters/batrix.glb" id="3_ld2i8"] +[ext_resource type="Script" path="res://scripts/player/player_animator.gd" id="4_adlgp"] [ext_resource type="Material" uid="uid://bdi02rpvdukem" path="res://resources/materials/debug/debug_attack.tres" id="4_ll2ct"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_tes4q"] +animation = &"+idle_L" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_rdhgj"] +animation = &"+idle_R" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_tdamk"] +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gk5g1"] +advance_mode = 2 +advance_condition = &"side_L" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_v3m8c"] +advance_mode = 2 +advance_condition = &"side_R" + +[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_yk01a"] +states/+idle_L/node = SubResource("AnimationNodeAnimation_tes4q") +states/+idle_L/position = Vector2(351, 62) +states/+idle_R/node = SubResource("AnimationNodeAnimation_rdhgj") +states/+idle_R/position = Vector2(351, 168) +transitions = ["Start", "+idle_L", SubResource("AnimationNodeStateMachineTransition_tdamk"), "+idle_R", "+idle_L", SubResource("AnimationNodeStateMachineTransition_gk5g1"), "+idle_L", "+idle_R", SubResource("AnimationNodeStateMachineTransition_v3m8c")] + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_f4bn3"] +graph_offset = Vector2(-369.559, 150.503) +nodes/StateMachine/node = SubResource("AnimationNodeStateMachine_yk01a") +nodes/StateMachine/position = Vector2(40, 140) +node_connections = [&"output", 0, &"StateMachine"] + [sub_resource type="CylinderShape3D" id="CylinderShape3D_apl1i"] height = 1.8 @@ -26,150 +57,250 @@ collision_layer = 16 script = ExtResource("1_xt3i8") _collision_debug_material = ExtResource("2_0p422") -[node name="Model" parent="." instance=ExtResource("3_7s4q6")] +[node name="Model" parent="." instance=ExtResource("3_ld2i8")] [node name="Skeleton3D" parent="Model/Armature" index="0"] -bones/0/rotation = Quaternion(0.500003, -0.499997, -0.499997, 0.500003) -bones/1/rotation = Quaternion(-0.500006, 0.5, 0.499994, 0.5) -bones/6/rotation = Quaternion(-0.0323581, 2.46001e-07, 8.00608e-09, 0.999476) -bones/7/rotation = Quaternion(0.123965, -2.40098e-07, -2.92456e-09, 0.992287) -bones/7/scale = Vector3(1, 1, 1) -bones/8/rotation = Quaternion(-0.0917916, -2.67583e-15, 2.18848e-08, 0.995778) -bones/9/rotation = Quaternion(1.15202e-07, 0.707107, 0.707107, -5.33851e-08) -bones/9/scale = Vector3(1, 1, 1) -bones/12/rotation = Quaternion(-1.03251e-07, -3.17865e-08, 3.28198e-15, 1) -bones/13/rotation = Quaternion(-1.37668e-07, -3.17865e-08, 4.37597e-15, 1) -bones/14/rotation = Quaternion(-1.03251e-07, -3.17865e-08, 3.28198e-15, 1) -bones/18/rotation = Quaternion(-1.37668e-07, -3.17865e-08, 4.37597e-15, 1) -bones/20/rotation = Quaternion(0.19747, 0.678974, 0.678974, -0.19747) -bones/20/scale = Vector3(1, 1, 1) -bones/30/rotation = Quaternion(-6.21725e-15, -5.94129e-08, -1.49012e-07, 1) -bones/36/rotation = Quaternion(0.19747, 0.678974, 0.678974, -0.19747) -bones/36/scale = Vector3(1, 1, 1) -bones/40/rotation = Quaternion(-0.19747, 0.678974, 0.678974, 0.19747) -bones/40/scale = Vector3(1, 1, 1) -bones/44/rotation = Quaternion(4.66323e-07, -0.535908, 0.844276, -1.6823e-07) -bones/44/scale = Vector3(1, 1, 1) -bones/45/rotation = Quaternion(-0.0181733, 2.38379e-07, 1.14098e-08, 0.999835) -bones/46/rotation = Quaternion(-1.20807e-07, 0.993087, -0.117383, 7.85287e-07) -bones/48/rotation = Quaternion(-0.034235, -3.57418e-07, 8.86969e-08, 0.999414) -bones/50/rotation = Quaternion(0.403888, -2.98082e-07, -3.85178e-07, 0.914808) -bones/51/rotation = Quaternion(-0.512846, 3.82068e-07, 4.27952e-07, 0.858481) -bones/51/scale = Vector3(1, 1, 1) -bones/52/rotation = Quaternion(0.0772044, -1.03801e-06, -1.2885e-07, 0.997015) -bones/52/scale = Vector3(1, 1, 1) -bones/55/rotation = Quaternion(0.000780555, -0.0237052, 0.0502717, 0.998454) -bones/55/scale = Vector3(1, 1, 1) -bones/56/scale = Vector3(1, 1, 1) -bones/58/rotation = Quaternion(0.00161688, 2.38418e-07, 1.03441e-09, 0.999999) -bones/58/scale = Vector3(1, 1, 1) -bones/59/rotation = Quaternion(0.228541, 0.947226, 0.209053, -0.0826344) -bones/60/rotation = Quaternion(0.133438, -0.0949905, -0.147138, 0.97546) -bones/61/rotation = Quaternion(0.0362919, -0.00490006, -0.0475428, 0.998198) -bones/63/rotation = Quaternion(-0.497004, -0.574613, 0.266856, 0.592954) -bones/64/rotation = Quaternion(-0.0266082, 0.706555, -0.0266833, 0.706654) -bones/65/rotation = Quaternion(-8.29555e-05, 9.48293e-05, 0.0141926, 0.999899) -bones/65/scale = Vector3(1, 1, 1) -bones/66/rotation = Quaternion(2.73443e-05, -2.92389e-05, 0.0202266, 0.999795) -bones/66/scale = Vector3(1, 1, 1) -bones/69/rotation = Quaternion(-0.706943, -0.0143225, 0.0142829, 0.706981) -bones/70/rotation = Quaternion(-0.706726, -0.024286, 0.0243834, 0.70665) -bones/72/rotation = Quaternion(-7.74054e-05, 9.75834e-05, -0.00343725, 0.999994) -bones/72/scale = Vector3(1, 1, 1) -bones/73/rotation = Quaternion(2.5122e-05, -2.6431e-05, 0.00184074, 0.999998) -bones/73/scale = Vector3(1, 1, 1) -bones/76/rotation = Quaternion(-0.707088, -0.00131944, 0.00128381, 0.707123) -bones/77/rotation = Quaternion(-0.707143, 0.0011801, -0.00107765, 0.707069) -bones/78/rotation = Quaternion(0.0361992, 0.706123, 0.0361283, 0.70624) -bones/80/rotation = Quaternion(-8.66251e-06, 9.56188e-06, -0.0155723, 0.999879) -bones/83/rotation = Quaternion(-0.707027, 0.0110055, -0.0109902, 0.707015) -bones/84/rotation = Quaternion(-0.706096, 0.0385178, -0.038402, 0.706024) -bones/85/rotation = Quaternion(0.0569009, 0.704803, 0.0568902, 0.704825) -bones/85/scale = Vector3(1, 1, 1) -bones/86/rotation = Quaternion(-7.06026e-06, 1.40335e-05, -0.0424302, 0.999099) -bones/87/rotation = Quaternion(-1.06996e-07, 1.17384e-07, -0.0413655, 0.999144) -bones/89/rotation = Quaternion(-0.707107, 8.47153e-07, 9.00539e-07, 0.707107) -bones/90/rotation = Quaternion(-0.706502, 0.0292507, -0.0292488, 0.706501) -bones/91/rotation = Quaternion(-0.70463, 0.0592111, -0.0591898, 0.704619) -bones/92/rotation = Quaternion(-0.708275, 5.03263e-14, -2.84259e-07, 0.705936) -bones/93/rotation = Quaternion(-0.705843, -3.79543e-06, -5.06699e-05, 0.708368) -bones/96/rotation = Quaternion(-0.704198, -0.0522797, 0.0188281, 0.707826) -bones/97/rotation = Quaternion(0.0365982, -0.0425263, 0.740578, 0.669624) -bones/97/scale = Vector3(1, 1, 1) -bones/98/rotation = Quaternion(0.000780569, 0.0237052, -0.0502716, 0.998454) -bones/98/scale = Vector3(1, 1, 1) -bones/99/rotation = Quaternion(0.00234516, 3.8331e-05, 3.29257e-05, 0.999997) -bones/99/scale = Vector3(1, 1, 1) -bones/101/rotation = Quaternion(0.00161688, -2.38418e-07, -1.03441e-09, 0.999999) -bones/101/scale = Vector3(1, 1, 1) -bones/103/rotation = Quaternion(0.133438, 0.0949905, 0.147138, 0.97546) -bones/104/rotation = Quaternion(0.0362919, 0.00490006, 0.0475427, 0.998198) -bones/105/rotation = Quaternion(-0.467553, 0.526138, -0.458035, 0.542933) -bones/106/rotation = Quaternion(-0.497004, 0.574613, -0.266856, 0.592954) -bones/107/rotation = Quaternion(-0.0266082, -0.706555, 0.0266833, 0.706654) -bones/108/rotation = Quaternion(-8.29556e-05, -9.48397e-05, -0.0141926, 0.999899) -bones/108/scale = Vector3(1, 1, 1) -bones/109/scale = Vector3(1, 1, 1) -bones/111/rotation = Quaternion(-0.707107, -8.48703e-07, -8.9898e-07, 0.707107) -bones/112/rotation = Quaternion(-0.706943, 0.0143225, -0.0142829, 0.706981) -bones/115/rotation = Quaternion(-7.74053e-05, -9.75928e-05, 0.00343725, 0.999994) -bones/115/scale = Vector3(1, 1, 1) -bones/116/rotation = Quaternion(2.5122e-05, 2.64312e-05, -0.00184074, 0.999998) -bones/116/scale = Vector3(1, 1, 1) -bones/118/rotation = Quaternion(-0.707107, -8.47159e-07, -9.00524e-07, 0.707107) -bones/119/rotation = Quaternion(-0.707088, 0.00131944, -0.00128381, 0.707123) -bones/120/rotation = Quaternion(-0.707143, -0.00118011, 0.00107765, 0.707069) -bones/121/rotation = Quaternion(0.0361992, -0.706123, -0.0361283, 0.70624) -bones/122/scale = Vector3(1, 1, 1) -bones/125/rotation = Quaternion(-0.707107, -8.47681e-07, -9.00015e-07, 0.707107) -bones/126/rotation = Quaternion(-0.707027, -0.0110055, 0.0109902, 0.707015) -bones/127/rotation = Quaternion(-0.706096, -0.0385178, 0.038402, 0.706024) -bones/128/rotation = Quaternion(0.0569009, -0.704803, -0.0568902, 0.704825) -bones/128/scale = Vector3(1, 1, 1) -bones/130/rotation = Quaternion(-1.06334e-07, -1.19982e-07, 0.0413655, 0.999144) -bones/132/rotation = Quaternion(-0.707107, -8.49787e-07, -8.97905e-07, 0.707107) -bones/133/rotation = Quaternion(-0.706502, -0.0292508, 0.0292488, 0.706501) -bones/134/rotation = Quaternion(-0.70463, -0.0592111, 0.0591898, 0.704619) -bones/139/rotation = Quaternion(-0.704198, 0.0522797, -0.018828, 0.707826) -bones/140/rotation = Quaternion(0.0323581, -3.23524e-09, 4.47963e-09, 0.999476) -bones/141/rotation = Quaternion(0.0323581, -3.23524e-09, 4.47954e-09, 0.999476) -bones/142/rotation = Quaternion(0.0323581, -3.23524e-09, 4.47955e-09, 0.999476) -bones/143/rotation = Quaternion(0.0323581, -3.23524e-09, 4.47962e-09, 0.999476) -bones/144/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/145/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/146/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/147/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/148/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/149/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/150/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/151/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99411e-11, 0.999476) -bones/152/rotation = Quaternion(0.032358, -3.08697e-09, -9.99404e-11, 0.999476) -bones/153/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99409e-11, 0.999476) -bones/154/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/155/rotation = Quaternion(0.0323581, -3.08697e-09, -9.99408e-11, 0.999476) -bones/156/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81471e-09, 0.999476) -bones/157/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/158/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/159/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/160/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/161/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/162/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/163/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81471e-09, 0.999476) -bones/164/rotation = Quaternion(0.032358, -2.41381e-07, -7.81469e-09, 0.999476) -bones/165/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81471e-09, 0.999476) -bones/166/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/167/rotation = Quaternion(0.0323581, -2.41381e-07, -7.81472e-09, 0.999476) -bones/168/rotation = Quaternion(0.999437, 1.66876e-08, 3.38767e-07, -0.0335376) -bones/168/scale = Vector3(1, 1, 1.00001) -bones/169/rotation = Quaternion(0.0296713, -1.19064e-07, 1.37491e-08, 0.99956) -bones/173/rotation = Quaternion(-0.730424, -1.13568e-07, -2.27149e-07, 0.682994) -bones/174/rotation = Quaternion(0.999437, 3.26797e-08, -1.37802e-07, -0.0335376) -bones/174/scale = Vector3(1, 1, 1.00001) -bones/175/rotation = Quaternion(0.0296713, 1.1925e-07, -7.47368e-09, 0.99956) -bones/179/rotation = Quaternion(-0.730424, 1.08982e-07, 2.31437e-07, 0.682994) +bones/0/position = Vector3(0.494326, 1.05095, -0.0063748) +bones/0/rotation = Quaternion(-0.699429, -0.104116, -0.699564, 0.102804) +bones/1/position = Vector3(9.7502e-05, 0.0319144, -0.124525) +bones/1/rotation = Quaternion(0.000141498, 0.789452, 0.613812, -0.000224441) +bones/4/position = Vector3(0.0106248, 0.943688, -0.060074) +bones/4/rotation = Quaternion(0.34774, -0.156246, -0.00732459, 0.924451) +bones/5/rotation = Quaternion(-0.0714071, 0.441915, -0.181066, 0.875687) +bones/6/rotation = Quaternion(-0.348023, 0.140409, 0.0786429, 0.923569) +bones/7/rotation = Quaternion(0.374014, -0.0621726, -0.084335, 0.921486) +bones/8/rotation = Quaternion(-0.150476, -0.519175, 0.048826, 0.839899) +bones/9/rotation = Quaternion(1.16849e-07, 0.707107, 0.707107, -6.02998e-08) +bones/10/position = Vector3(0.00921999, -2.61864e-08, -0.00588939) +bones/11/position = Vector3(0.00823874, -2.49299e-08, -0.0102091) +bones/12/position = Vector3(-0.013704, 1.28724e-08, 0.015537) +bones/13/position = Vector3(-0.0271835, 2.07455e-08, 0.00727785) +bones/14/position = Vector3(-0.0138113, -4.4584e-08, -0.0106828) +bones/15/position = Vector3(0.0195011, -2.44352e-09, 0.00592815) +bones/16/position = Vector3(0.0322901, -8.57577e-09, -0.00263738) +bones/17/position = Vector3(0.0186913, 7.26905e-09, -0.0116521) +bones/18/position = Vector3(-0.0319375, 1.10374e-08, -0.00811325) +bones/19/position = Vector3(0.0299649, -4.00949e-08, -0.011494) +bones/20/rotation = Quaternion(0.197471, 0.678974, 0.678974, -0.19747) +bones/21/position = Vector3(0.00653459, 0.000225205, 0.000792979) +bones/21/rotation = Quaternion(2.82912e-08, -0.00986666, -1.30163e-07, 0.999951) +bones/21/scale = Vector3(0.999923, 1, 0.397172) +bones/22/position = Vector3(0.0392888, -1.19762e-06, -0.00333344) +bones/23/position = Vector3(-0.0495715, -2.69006e-06, 0.0147187) +bones/24/position = Vector3(-0.00910762, -8.28212e-08, 0.000409588) +bones/25/position = Vector3(-0.0134209, -2.50165e-08, -0.0184934) +bones/29/position = Vector3(-0.0243873, 0.000225207, 0.00180588) +bones/29/rotation = Quaternion(-8.17624e-09, -0.00810695, 6.36745e-08, 0.999967) +bones/29/scale = Vector3(0.999935, 1, 0.538658) +bones/30/position = Vector3(-0.0392888, -1.14066e-06, 0.00778625) +bones/31/position = Vector3(0.0495715, -2.68375e-06, 0.0400534) +bones/32/position = Vector3(0.00910765, -3.96837e-08, 0.0211827) +bones/33/position = Vector3(0.013421, 3.66567e-08, -0.0283992) +bones/36/position = Vector3(0.0443015, 0.0755768, 0.0940306) +bones/36/rotation = Quaternion(0.161417, 0.667625, 0.688436, -0.232975) +bones/40/position = Vector3(-0.0437322, 0.0915897, 0.0943924) +bones/40/rotation = Quaternion(-0.160114, 0.667183, 0.68874, 0.234237) +bones/44/rotation = Quaternion(-0.102447, -0.522071, 0.843502, -0.0738329) +bones/46/rotation = Quaternion(-0.00282362, 0.992799, -0.117349, 0.0238882) +bones/50/rotation = Quaternion(0.408327, 0.0439888, -0.262991, 0.873023) +bones/51/rotation = Quaternion(-0.557133, 3.81469e-07, 4.66623e-07, 0.830423) +bones/52/rotation = Quaternion(0.05766, 0.0761452, -0.0209147, 0.995209) +bones/53/rotation = Quaternion(-0.467516, 4.66644e-07, 8.9985e-07, 0.883985) +bones/54/rotation = Quaternion(0.0487203, 0.0278252, -0.473765, 0.878863) +bones/55/rotation = Quaternion(-0.112273, -0.503668, -0.729497, 0.448941) +bones/56/position = Vector3(4.19883e-10, 0.281682, -9.63389e-08) +bones/56/rotation = Quaternion(0.0189077, -4.88213e-05, -5.1644e-05, 0.999821) +bones/57/rotation = Quaternion(0.00109414, -0.000160432, 1.90888e-07, 0.999999) +bones/58/position = Vector3(1.29355e-09, 0.0684659, -0.000149869) +bones/58/rotation = Quaternion(-0.40695, -0.000253698, 0.000176486, 0.91345) +bones/59/rotation = Quaternion(0.272953, 0.938437, 0.146393, 0.152973) +bones/60/rotation = Quaternion(0.58496, -0.153924, -0.0835467, 0.791928) +bones/61/rotation = Quaternion(0.510623, -0.0271032, -0.0393668, 0.858475) +bones/62/rotation = Quaternion(-0.329205, -0.636159, 0.303971, 0.628115) +bones/62/scale = Vector3(1, 1.10703, 1) +bones/63/rotation = Quaternion(-0.343634, -0.682552, 0.10805, 0.635896) +bones/63/scale = Vector3(1, 1.10703, 1) +bones/65/rotation = Quaternion(0.535794, 0.00768613, 0.0119316, 0.84423) +bones/66/rotation = Quaternion(0.620821, 0.0125363, 0.0158731, 0.783692) +bones/67/rotation = Quaternion(0.620926, -3.05073e-08, -2.61043e-10, 0.783869) +bones/68/rotation = Quaternion(-0.435358, 5.33891e-07, 1.09405e-06, 0.900257) +bones/68/scale = Vector3(1, 1.25706, 1) +bones/69/rotation = Quaternion(-0.435245, -0.00883201, 0.0181977, 0.900085) +bones/69/scale = Vector3(1, 1.25706, 1) +bones/70/rotation = Quaternion(-0.481355, -0.0244881, 0.0222001, 0.875902) +bones/70/scale = Vector3(1, 1.15469, 1) +bones/72/rotation = Quaternion(0.535935, -0.00176, -0.00295408, 0.844252) +bones/73/rotation = Quaternion(0.620952, 0.00112222, 0.00145932, 0.783846) +bones/74/rotation = Quaternion(0.620933, -1.42703e-08, -7.2116e-09, 0.783863) +bones/75/rotation = Quaternion(-0.435354, 5.25291e-07, 1.08623e-06, 0.900259) +bones/75/scale = Vector3(1, 1.25707, 1) +bones/76/rotation = Quaternion(-0.435331, -0.000824686, 0.00164675, 0.900269) +bones/76/scale = Vector3(1, 1.25707, 1) +bones/77/rotation = Quaternion(-0.481709, 0.0001158, -0.00210063, 0.876329) +bones/77/scale = Vector3(1, 1.15478, 1) +bones/79/rotation = Quaternion(0.535625, -0.0207677, -0.0328375, 0.843561) +bones/80/rotation = Quaternion(0.620848, -0.00966186, -0.0122126, 0.783776) +bones/81/rotation = Quaternion(0.62093, 3.64978e-08, 5.16494e-08, 0.783866) +bones/82/rotation = Quaternion(-0.435356, 5.09165e-07, 1.15419e-06, 0.900258) +bones/82/scale = Vector3(1, 1.25706, 1) +bones/83/rotation = Quaternion(-0.435312, 0.00677159, -0.0140056, 0.900145) +bones/83/scale = Vector3(1, 1.25706, 1) +bones/84/rotation = Quaternion(-0.480723, 0.0323989, -0.041488, 0.875291) +bones/84/scale = Vector3(1, 1.15483, 1) +bones/86/rotation = Quaternion(0.535597, -0.0227344, -0.0358256, 0.843407) +bones/87/rotation = Quaternion(0.620342, -0.0256826, -0.032427, 0.78324) +bones/88/rotation = Quaternion(0.620873, 3.56417e-08, -4.75202e-09, 0.783911) +bones/89/rotation = Quaternion(-0.435389, 5.80474e-07, 1.10904e-06, 0.900243) +bones/89/scale = Vector3(0.999999, 1.25698, 1) +bones/90/rotation = Quaternion(-0.435016, 0.0180108, -0.0372378, 0.899472) +bones/90/scale = Vector3(1, 1.25698, 1) +bones/91/rotation = Quaternion(-0.479242, 0.0566498, -0.05705, 0.873993) +bones/91/scale = Vector3(1, 1.15486, 1) +bones/92/position = Vector3(1.30883e-09, 0.0684659, -0.000149859) +bones/92/rotation = Quaternion(-0.840073, -0.000155525, -2.87357e-05, 0.542474) +bones/93/position = Vector3(4.23221e-10, 0.281682, -1.06767e-07) +bones/93/rotation = Quaternion(-0.699952, -9.07941e-07, -6.10241e-05, 0.714189) +bones/93/scale = Vector3(1, 1, 1) +bones/94/position = Vector3(0.000777229, -0.00447135, -0.00741903) +bones/94/rotation = Quaternion(0.0564853, 0.0014349, 0.0734803, 0.995695) +bones/94/scale = Vector3(1.12362, 1, 1) +bones/95/position = Vector3(-1.96742e-08, 0.0159596, 0.000181376) +bones/95/rotation = Quaternion(-0.0876969, 0.00686066, 0.0793036, 0.992962) +bones/96/rotation = Quaternion(-0.652292, 0.0627295, -0.505824, 0.561002) +bones/97/rotation = Quaternion(0.199115, -0.0146144, 0.640587, 0.741477) +bones/98/rotation = Quaternion(0.525306, 0.0109409, 0.572324, 0.629586) +bones/99/position = Vector3(8.50288e-08, 0.213917, -1.63076e-09) +bones/99/rotation = Quaternion(0.285901, 0.00296396, 0.0663008, 0.955958) +bones/100/rotation = Quaternion(0.00108106, 0.154044, -0.000168514, 0.988063) +bones/101/position = Vector3(-1.25285e-09, 0.0789402, -0.00017284) +bones/101/rotation = Quaternion(-0.268394, 0.14702, 0.0462904, 0.950898) +bones/102/rotation = Quaternion(-0.493569, 0.84346, 0.0982745, 0.1879) +bones/103/rotation = Quaternion(0.528039, 0.147693, 0.0941254, 0.830964) +bones/104/rotation = Quaternion(0.449223, 0.0242785, 0.0411689, 0.89214) +bones/105/rotation = Quaternion(-0.350045, 0.622991, -0.32694, 0.618434) +bones/105/scale = Vector3(1, 1.06804, 1) +bones/106/rotation = Quaternion(-0.366656, 0.669855, -0.130949, 0.632226) +bones/106/scale = Vector3(1, 1.06804, 1) +bones/108/rotation = Quaternion(0.588385, -0.00842918, -0.0114187, 0.808456) +bones/109/rotation = Quaternion(0.68884, -0.0139141, -0.0146803, 0.724631) +bones/110/rotation = Quaternion(0.688961, 8.58627e-09, 8.01324e-09, 0.724798) +bones/111/rotation = Quaternion(-0.394359, -4.68339e-07, -1.14389e-06, 0.918956) +bones/111/scale = Vector3(1, 1.37539, 1) +bones/112/rotation = Quaternion(-0.394254, 0.00800334, -0.0185771, 0.918779) +bones/112/scale = Vector3(1, 1.37539, 1) +bones/113/rotation = Quaternion(-0.453245, 0.024388, -0.0218396, 0.890785) +bones/113/scale = Vector3(1, 1.21299, 1) +bones/115/rotation = Quaternion(0.542349, 0.00178241, 0.00294052, 0.840146) +bones/116/rotation = Quaternion(0.647331, -0.0011714, -0.0014202, 0.762207) +bones/117/rotation = Quaternion(0.647313, 2.79644e-08, 1.53425e-09, 0.762224) +bones/118/rotation = Quaternion(-0.419933, -5.38787e-07, -1.06318e-06, 0.907555) +bones/118/scale = Vector3(1, 1.29838, 1) +bones/119/rotation = Quaternion(-0.419909, 0.000796512, -0.00166062, 0.907564) +bones/119/scale = Vector3(1, 1.29838, 1) +bones/120/rotation = Quaternion(-0.478369, -0.00010121, 0.00211336, 0.878156) +bones/120/scale = Vector3(1, 1.16111, 1) +bones/122/rotation = Quaternion(0.461439, 0.0178802, 0.034495, 0.886321) +bones/123/rotation = Quaternion(0.573377, 0.00892217, 0.0127629, 0.819144) +bones/124/rotation = Quaternion(0.573453, -3.62117e-09, -1.44262e-08, 0.819238) +bones/125/rotation = Quaternion(-0.461815, -4.64358e-07, -1.16372e-06, 0.886976) +bones/125/scale = Vector3(1, 1.19475, 1) +bones/126/rotation = Quaternion(-0.461767, -0.0071837, 0.013798, 0.886865) +bones/126/scale = Vector3(1, 1.19475, 1) +bones/127/rotation = Quaternion(-0.517809, -0.0335061, 0.0412294, 0.853845) +bones/127/scale = Vector3(1, 1.09458, 1) +bones/129/rotation = Quaternion(0.394028, 0.0167211, 0.0389965, 0.918119) +bones/130/rotation = Quaternion(0.510242, 0.0211244, 0.0355649, 0.859035) +bones/131/rotation = Quaternion(0.510679, -1.34729e-09, -8.17124e-09, 0.859771) +bones/132/rotation = Quaternion(-0.494632, -5.47321e-07, -1.11026e-06, 0.869103) +bones/132/scale = Vector3(1, 1.13164, 1) +bones/133/rotation = Quaternion(-0.494208, -0.0204614, 0.0359497, 0.868359) +bones/133/scale = Vector3(1, 1.13164, 1) +bones/134/rotation = Quaternion(-0.547852, -0.057849, 0.0581314, 0.832546) +bones/134/scale = Vector3(1, 1.05697, 1) +bones/135/position = Vector3(-2.65929e-08, 0.0789402, -0.000172745) +bones/135/rotation = Quaternion(-0.795928, 0.0358362, 0.0693259, 0.60034) +bones/136/position = Vector3(7.13892e-08, 0.213917, 1.5181e-07) +bones/136/rotation = Quaternion(-0.596572, -0.0226518, 0.0247718, 0.801857) +bones/136/scale = Vector3(1, 1.02026, 1) +bones/137/position = Vector3(0.00409766, -0.0115429, -0.00384409) +bones/137/rotation = Quaternion(-0.0935765, -0.00903352, 0.157673, 0.983006) +bones/138/position = Vector3(1.10012e-08, 0.0159595, 0.000181388) +bones/138/rotation = Quaternion(-0.0586372, 0.00568236, 0.12181, 0.990804) +bones/139/rotation = Quaternion(-0.433995, -0.192252, 0.22041, 0.852119) +bones/140/position = Vector3(0.0107762, 0.110115, 0.0665259) +bones/141/position = Vector3(0.00887026, 0.0514272, 0.0891168) +bones/142/position = Vector3(0.0041804, -0.00171393, 0.0839392) +bones/143/position = Vector3(-0.0157922, 0.0560186, -0.101222) +bones/144/position = Vector3(0.101209, 0.0705554, -0.0656777) +bones/144/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/145/position = Vector3(0.0981173, 0.127364, -0.0633936) +bones/145/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/146/position = Vector3(0.0948122, 0.150891, 0.0295007) +bones/146/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/147/position = Vector3(0.100561, 0.0620289, 0.0258209) +bones/147/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/148/position = Vector3(0.0555162, 0.0784489, 0.065882) +bones/149/position = Vector3(0.058558, 0.0250886, 0.0617265) +bones/150/position = Vector3(0.05726, 0.143644, 0.0533884) +bones/150/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/151/position = Vector3(0.0620707, 0.184404, 0.0200446) +bones/151/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/152/position = Vector3(0.0541359, 0.198768, -0.0177982) +bones/152/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/153/position = Vector3(0.0558328, 0.19551, -0.0454424) +bones/153/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/154/position = Vector3(0.0887056, 0.167335, -0.0635147) +bones/154/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/155/position = Vector3(0.056176, 0.149521, -0.0743278) +bones/155/rotation = Quaternion(0.0314104, -0.0267035, 0.333607, 0.94181) +bones/156/position = Vector3(-0.114468, 0.0611706, -0.052233) +bones/156/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/157/position = Vector3(-0.108893, 0.106154, -0.0498362) +bones/157/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/158/position = Vector3(-0.095276, 0.0996294, 0.0315971) +bones/158/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/159/position = Vector3(-0.118151, 0.0295104, 0.0190655) +bones/159/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/160/position = Vector3(-0.0585888, 0.0613172, 0.0664555) +bones/161/position = Vector3(-0.0679349, 0.00486292, 0.064717) +bones/162/position = Vector3(-0.0388572, 0.119161, 0.0545544) +bones/162/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/163/position = Vector3(-0.0670809, 0.147832, 0.0349824) +bones/163/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/164/position = Vector3(-0.0729914, 0.172027, 0.00210291) +bones/164/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/165/position = Vector3(-0.0785256, 0.174421, -0.0251247) +bones/165/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/166/position = Vector3(-0.103009, 0.140493, -0.0457483) +bones/166/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/167/position = Vector3(-0.0657942, 0.137751, -0.0669098) +bones/167/rotation = Quaternion(0.121402, 0.142053, -0.116894, 0.975407) +bones/168/rotation = Quaternion(0.772222, 0.0554567, -0.309364, 0.552171) +bones/169/rotation = Quaternion(0.284937, 8.07405e-07, 3.14972e-07, 0.958546) +bones/170/position = Vector3(-2.36032e-09, 0.418116, -1.89366e-07) +bones/170/rotation = Quaternion(-0.404457, -0.00928664, 0.0249438, 0.91417) +bones/172/position = Vector3(-1.16423e-08, 0.418116, -1.47129e-07) +bones/172/rotation = Quaternion(-0.74262, -0.00638893, 0.006785, 0.669648) +bones/173/rotation = Quaternion(-0.636004, 9.57005e-08, 2.32847e-07, 0.771686) +bones/173/scale = Vector3(1, 1.0149, 1) +bones/174/rotation = Quaternion(0.90767, -0.0420115, 0.0557188, 0.413842) +bones/175/rotation = Quaternion(0.317475, 5.12614e-07, 1.84504e-07, 0.948267) +bones/176/position = Vector3(4.56668e-08, 0.418116, 5.19234e-07) +bones/176/rotation = Quaternion(-0.358905, -0.00420068, -0.11647, 0.926069) +bones/177/rotation = Quaternion(-0.607671, 1.51412e-07, 1.85934e-07, 0.794189) +bones/178/position = Vector3(3.07338e-08, 0.418116, 5.2755e-07) +bones/178/rotation = Quaternion(-0.731044, 0.014523, -0.0382473, 0.681103) +bones/179/rotation = Quaternion(-0.622745, 1.37788e-07, 4.58174e-07, 0.782425) +bones/179/scale = Vector3(1, 1.02159, 1) -[node name="AnimationPlayer" parent="Model" index="1"] -autoplay = "+idle" +[node name="AnimationTree" type="AnimationTree" parent="." node_paths=PackedStringArray("player")] +root_node = NodePath("../Model") +tree_root = SubResource("AnimationNodeBlendTree_f4bn3") +anim_player = NodePath("../Model/AnimationPlayer") +parameters/StateMachine/conditions/side_L = false +parameters/StateMachine/conditions/side_R = false +script = ExtResource("4_adlgp") +player = NodePath("..") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0) diff --git a/scenes/test.tscn b/scenes/test.tscn index 17e5565..f286de7 100644 --- a/scenes/test.tscn +++ b/scenes/test.tscn @@ -28,6 +28,7 @@ size = Vector3(50, 1, 50) [node name="DirectionalLight3D" type="DirectionalLight3D" parent="Lights"] transform = Transform3D(0.994881, 0.0858869, -0.0532522, 0, 0.526956, 0.849893, 0.101056, -0.845542, 0.524258, 0, 0, 0) shadow_enabled = true +shadow_bias = 0.025 shadow_blur = 6.0 [node name="WorldEnvironment" type="WorldEnvironment" parent="."] diff --git a/scripts/debug/debugger.gd b/scripts/debug/debugger.gd index 3727a6e..72f801d 100644 --- a/scripts/debug/debugger.gd +++ b/scripts/debug/debugger.gd @@ -137,30 +137,30 @@ func _update_controls_label() -> void: func _append_text(key: String, value: Variant, label_index: int) -> void: - var line := str(value) + var line_text := str(value) if value is int: - line = (" " if value >= 0 else "") + line + line_text = (" " if value >= 0 else "") + line_text if (value as int) > 0: - line = "[color=sky_blue]%s[/color]" % line + line_text = "[color=sky_blue]%s[/color]" % line_text elif (value as int) < 0: - line = "[color=salmon]%s[/color]" % line + line_text = "[color=salmon]%s[/color]" % line_text elif value is float: - line = (" " if value >= 0 else "") + "%.6f" % value + line_text = (" " if value >= 0 else "") + "%.6f" % value if value > 0: - line = "[color=sky_blue]%s[/color]" % line + line_text = "[color=sky_blue]%s[/color]" % line_text elif value < 0: - line = "[color=salmon]%s[/color]" % line + line_text = "[color=salmon]%s[/color]" % line_text elif value is bool: if value: - line = "[color=sky_blue]%s[/color]" % line + line_text = "[color=sky_blue]%s[/color]" % line_text else: - line = "[color=salmon]%s[/color]" % line + line_text = "[color=salmon]%s[/color]" % line_text elif value is Vector3: - line = ( + line_text = ( "(%s, %s, %s)" % [ (" " if value.x >= 0 else "") + ("%.6f" % value.x), @@ -170,7 +170,7 @@ func _append_text(key: String, value: Variant, label_index: int) -> void: ) elif value is Vector2: - line = ( + line_text = ( "(%s, %s)" % [ (" " if value.x >= 0 else "") + ("%.6f" % value.x), @@ -178,19 +178,19 @@ func _append_text(key: String, value: Variant, label_index: int) -> void: ] ) - line = "%s: %s\n" % [key, line] + line_text = "%s: %s\n" % [key, line_text] if label_index == 2: - _label2_text += line + _label2_text += line_text else: - _label1_text += line + _label1_text += line_text func _append_event(key: String, frame: int, args: Array[Variant]) -> void: - var line := key + var line_text := key if args.size() > 0: - line += "(%s)" % ", ".join(args.map(str)) + line_text += "(%s)" % ", ".join(args.map(str)) var physics_frame := Engine.get_physics_frames() var color := Color.SALMON.lerp( @@ -199,9 +199,9 @@ func _append_event(key: String, frame: int, args: Array[Variant]) -> void: if physics_frame - frame < 5: color = Color.SKY_BLUE - line = "[color=#%s]%s[/color]\n" % [color.to_html(), line] + line_text = "[color=#%s]%s[/color]\n" % [color.to_html(), line_text] - _label3_text += line + _label3_text += line_text func _draw_vector(from: Vector3, to: Vector3, color: Color) -> void: diff --git a/scripts/player/player.gd b/scripts/player/player.gd index f0188e5..16390fc 100644 --- a/scripts/player/player.gd +++ b/scripts/player/player.gd @@ -20,8 +20,7 @@ func _ready() -> void: func _process(_delta: float) -> void: - aiming.controller_aiming(movement.move_input) - call_deferred("_mouse_aiming") + call_deferred("_aiming") _process_respawning() var aim_pos := global_position + aiming.aim_offset @@ -39,9 +38,13 @@ func _physics_process(delta: float) -> void: move_and_slide() -func _mouse_aiming() -> void: +func _aiming() -> void: + + aiming.controller_aiming(movement.move_input) var mouse_pos := get_viewport().get_mouse_position() aiming.mouse_aiming(mouse_pos, global_position, is_on_floor()) + if attack.is_hitting(): + return if aiming.aim_offset.length() > 0: look_at(global_position + aiming.aim_offset, Vector3.UP, true) diff --git a/scripts/player/player_animator.gd b/scripts/player/player_animator.gd new file mode 100644 index 0000000..6bfc0ff --- /dev/null +++ b/scripts/player/player_animator.gd @@ -0,0 +1,25 @@ +extends AnimationTree + +const SUFFIX_LEFT := "_L" +const SUFFIX_RIGHT := "_R" + +@export var player: Player + + +func _ready() -> void: + assert(player, "player missing!") + + +func _process(_delta: float) -> void: + set(&"parameters/StateMachine/conditions/side_L", _is_left()) + set(&"parameters/StateMachine/conditions/side_R", not _is_left()) + + +func _is_left() -> bool: + return player.attack.side == PlayerAttack.Side.LEFT + + +func _suffix(invert: bool) -> String: + if not invert: + return SUFFIX_LEFT if _is_left() else SUFFIX_RIGHT + return SUFFIX_LEFT if not _is_left() else SUFFIX_RIGHT diff --git a/scripts/player/player_attack.gd b/scripts/player/player_attack.gd index 2ce50ca..4de0964 100644 --- a/scripts/player/player_attack.gd +++ b/scripts/player/player_attack.gd @@ -19,7 +19,7 @@ enum Side { RIGHT, LEFT } @export var _hit_projectile_speed: float = 35 @export var _direction_angles: Dictionary = {-PI / 6: 0, PI / 6: PI / 4, PI: PI / 2} -var _side := Side.RIGHT +var side := Side.RIGHT var _debug_collision_shapes := DebugCollisionShapes.new() @@ -103,7 +103,7 @@ func _physics_process(_delta: float) -> void: func is_hitting() -> bool: - return _hit_window_timer > 0 + return _cooldown_timer > 0 func _attack() -> void: @@ -115,7 +115,7 @@ func _attack() -> void: _hit_window_timer = _hit_window_time _swoop_effect_timer = _swoop_effect_time _debug_collision_shapes.set_visibility(true) - _side = Side.LEFT if _side == Side.RIGHT else Side.RIGHT + side = Side.LEFT if side == Side.RIGHT else Side.RIGHT func _hit_projectile(projectile: Projectile) -> void: @@ -128,10 +128,10 @@ func _hit_projectile(projectile: Projectile) -> void: if angle > _attack_max_angle or angle < -_attack_max_angle: return - var angle_sign := 1.0 if _side == Side.RIGHT else -1.0 + var angle_sign := -1.0 if side == Side.RIGHT else 1.0 var angle_signed := angle * angle_sign - Debugger.text("side", Side.find_key(_side), 2) + Debugger.text("side", Side.find_key(side), 2) Debugger.text("angle_signed", rad_to_deg(angle_signed), 2) var prev_dir_angle: float = -_attack_max_angle