From aef30cbd889a9f76d9a4861bf6b43f57511d0fe7 Mon Sep 17 00:00:00 2001 From: teatov Date: Sun, 27 Jul 2025 05:10:58 +1000 Subject: [PATCH] move aiming processing to physics process to fix jitter --- scenes/player.tscn | 230 +++++++++++++++++++------------------- scenes/test.tscn | 6 +- scenes/ui/cursor.tscn | 2 - scripts/globals/cursor.gd | 8 +- scripts/main_camera.gd | 7 +- scripts/player/player.gd | 2 +- 6 files changed, 131 insertions(+), 124 deletions(-) diff --git a/scenes/player.tscn b/scenes/player.tscn index 26afa34..7be353d 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -107,57 +107,57 @@ _collision_debug_material = ExtResource("2_0p422") [node name="Model" parent="." instance=ExtResource("3_f1ej7")] [node name="Skeleton3D" parent="Model/Armature" index="0"] -bones/0/position = Vector3(-0.541533, 1.05864, -0.100116) -bones/0/rotation = Quaternion(0.722245, -0.12663, -0.669413, -0.11922) +bones/0/position = Vector3(-0.509322, 0.994931, -0.0478182) +bones/0/rotation = Quaternion(0.709228, -0.0727934, -0.698967, -0.056058) bones/0/scale = Vector3(1, 1, 1) bones/1/position = Vector3(-9.75365e-05, 0.0319142, -0.124525) bones/1/rotation = Quaternion(-0.000141591, 0.789452, 0.613812, 0.000224233) bones/2/rotation = Quaternion(6.24507e-10, 4.41808e-08, -6.03351e-10, 1) bones/2/scale = Vector3(1, 1, 1) bones/3/rotation = Quaternion(1.74623e-10, -2.60798e-10, -1.30968e-10, 1) -bones/4/position = Vector3(-0.0283301, 0.942187, -0.0505917) -bones/4/rotation = Quaternion(0.281384, -0.313188, -0.0830446, 0.903239) +bones/4/position = Vector3(0.0410619, 0.92757, -0.0356457) +bones/4/rotation = Quaternion(0.223396, -0.0946728, 0.0350542, 0.969486) bones/5/position = Vector3(6.05363e-09, 0.111695, -8.19564e-08) -bones/5/rotation = Quaternion(0.0652783, -0.108281, 0.238493, 0.962879) -bones/6/rotation = Quaternion(-0.419289, -0.129259, 0.0222242, 0.898329) -bones/7/rotation = Quaternion(0.327528, 0.277733, -0.270032, 0.861785) -bones/8/rotation = Quaternion(-0.235427, 0.304483, 0.140588, 0.912195) +bones/5/rotation = Quaternion(0.0735332, -0.199554, 0.125582, 0.96902) +bones/6/rotation = Quaternion(-0.419307, -0.128549, 0.021893, 0.898431) +bones/7/rotation = Quaternion(0.350038, 0.103815, -0.281842, 0.887277) +bones/8/rotation = Quaternion(-0.205147, 0.350995, 0.0975189, 0.908409) bones/9/rotation = Quaternion(1.13474e-07, 0.707107, 0.707107, -5.23149e-08) bones/10/scale = Vector3(1, 1, 1) -bones/11/position = Vector3(-0.00968189, -1.10066e-08, -0.00662707) -bones/11/scale = Vector3(1.03751, 1, 1) +bones/11/position = Vector3(-0.0110016, -3.04479e-08, -0.00873453) +bones/11/scale = Vector3(1.2664, 1, 0.772095) bones/12/position = Vector3(-0.00823868, 6.83734e-08, -0.0102097) -bones/13/position = Vector3(-0.0200816, 4.99951e-08, 0.00489414) -bones/13/scale = Vector3(1.03751, 1, 0.938816) -bones/14/position = Vector3(-0.0333505, -4.48834e-08, -0.00314677) -bones/14/scale = Vector3(1.03751, 1, 0.938816) +bones/13/position = Vector3(-0.023624, -1.3441e-09, -0.000726155) +bones/13/scale = Vector3(1.2664, 1, 0.772095) +bones/14/position = Vector3(-0.0398201, 2.06584e-08, -0.00621833) +bones/14/scale = Vector3(1.2664, 1, 0.772096) bones/15/position = Vector3(-0.0186913, 1.4579e-07, -0.0116523) -bones/16/position = Vector3(0.014369, -4.96565e-08, 0.0139151) -bones/16/scale = Vector3(1.03751, 1, 0.938816) -bones/17/position = Vector3(0.028354, -1.53965e-07, 0.00616163) -bones/17/scale = Vector3(1.03751, 1, 1) +bones/16/position = Vector3(0.0184269, 1.72027e-07, 0.00634607) +bones/16/scale = Vector3(1.2664, 1, 0.772096) +bones/17/position = Vector3(0.0354973, 7.84004e-08, 0.000267413) +bones/17/scale = Vector3(1.2664, 1, 0.772096) bones/18/position = Vector3(0.0138112, -1.99382e-07, -0.0106829) bones/19/position = Vector3(-0.029965, -6.74833e-08, -0.0114938) bones/20/position = Vector3(0.0319374, 2.70462e-10, -0.00811319) -bones/21/position = Vector3(0.0451344, 0.0764403, 0.0935013) +bones/21/position = Vector3(0.0451364, 0.0764193, 0.0935001) bones/21/rotation = Quaternion(0.160115, 0.667183, 0.68874, -0.234237) bones/22/position = Vector3(-0.00351833, -2.67936e-08, 0.0010112) -bones/25/position = Vector3(-0.0442944, 0.0756561, 0.0940351) +bones/25/position = Vector3(-0.0442962, 0.0756351, 0.094034) bones/25/rotation = Quaternion(-0.161417, 0.667625, 0.688436, 0.232975) bones/26/position = Vector3(0.00351835, 2.9417e-08, 0.00101115) -bones/29/rotation = Quaternion(0.0368552, -0.575229, 0.815792, 0.0472857) -bones/30/rotation = Quaternion(-0.108088, -0.00354989, -0.0453683, 0.993099) +bones/29/rotation = Quaternion(0.0358131, -0.592919, 0.803027, 0.0480797) +bones/30/rotation = Quaternion(-0.05837, -0.00548176, -0.0421818, 0.997388) bones/31/rotation = Quaternion(0.00282337, 0.992799, -0.117349, -0.0238866) -bones/32/rotation = Quaternion(0.545772, -1.8273e-08, -1.29429e-06, 0.837934) +bones/32/rotation = Quaternion(0.559291, -4.29134e-08, -1.29076e-06, 0.828972) bones/33/rotation = Quaternion(-0.0342351, -3.5846e-07, 8.54711e-08, 0.999414) -bones/35/rotation = Quaternion(0.276827, -0.0807105, 0.250242, 0.924247) -bones/36/rotation = Quaternion(-0.702843, 2.56602e-07, 5.08529e-07, 0.711345) -bones/37/rotation = Quaternion(-0.0739623, -0.0905844, 0.0836716, 0.989608) -bones/38/rotation = Quaternion(-0.62257, 2.79147e-07, 9.92318e-07, 0.782564) +bones/35/rotation = Quaternion(0.303073, -0.108151, 0.308508, 0.895138) +bones/36/rotation = Quaternion(-0.649846, 3.16898e-07, 4.62288e-07, 0.760066) +bones/37/rotation = Quaternion(-0.0486405, -0.104208, 0.204466, 0.972095) +bones/38/rotation = Quaternion(-0.645978, 2.48e-07, 1.00563e-06, 0.763356) bones/39/rotation = Quaternion(0.197471, 0.678974, 0.678974, -0.19747) -bones/39/scale = Vector3(1.02957, 1, 0.966884) -bones/41/position = Vector3(0.0139192, 0.000225329, -0.00384292) -bones/41/rotation = Quaternion(-9.69781e-10, -0.00708393, -1.34122e-07, 0.999975) +bones/39/scale = Vector3(1.11231, 1, 0.867862) +bones/41/position = Vector3(0.0170023, 0.00022532, -0.00384271) +bones/41/rotation = Quaternion(-2.2793e-08, 0.00598484, -1.22011e-07, 0.999982) bones/41/scale = Vector3(0.999981, 1, 0.538573) bones/42/position = Vector3(0.0392888, -1.17533e-06, -0.00209796) bones/43/position = Vector3(-0.0495715, -2.58908e-06, 0.0301691) @@ -165,9 +165,9 @@ bones/44/position = Vector3(-0.00910762, -1.30386e-08, 0.00452032) bones/45/position = Vector3(-0.013421, 6.33299e-08, -0.0283991) bones/46/position = Vector3(-0.0513805, 8.90344e-07, -0.0104124) bones/47/position = Vector3(0.0446487, -1.27684e-06, -0.0177286) -bones/48/scale = Vector3(1.02957, 1, 0.947149) -bones/50/position = Vector3(-0.0170028, 0.000225411, -0.00485537) -bones/50/rotation = Quaternion(-6.48622e-09, -0.00862222, 1.11814e-08, 0.999963) +bones/48/scale = Vector3(1.11231, 1, 0.867862) +bones/50/position = Vector3(-0.0139197, 0.000225418, -0.00485518) +bones/50/rotation = Quaternion(-3.14144e-08, 0.00728461, 7.8241e-08, 0.999973) bones/50/scale = Vector3(0.999977, 1, 0.397035) bones/51/position = Vector3(-0.0392888, -1.22121e-06, -0.00333335) bones/52/position = Vector3(0.0495715, -2.68185e-06, 0.0147188) @@ -175,16 +175,16 @@ bones/53/position = Vector3(0.00910765, -7.47593e-08, 0.000409614) bones/54/position = Vector3(0.0134209, 4.70912e-08, -0.0184937) bones/55/position = Vector3(0.0513805, 9.29226e-07, -0.0104125) bones/56/position = Vector3(-0.0446488, -1.30966e-06, -0.0177287) -bones/57/rotation = Quaternion(0.243229, -0.0128453, -0.703734, 0.667408) -bones/58/rotation = Quaternion(0.529042, 0.0617581, -0.372489, 0.759969) +bones/57/rotation = Quaternion(0.273654, -0.0435965, -0.711669, 0.645554) +bones/58/rotation = Quaternion(0.658261, 0.173487, -0.20396, 0.703559) bones/58/scale = Vector3(1, 1, 1) -bones/59/position = Vector3(-7.5881e-08, 0.286249, 9.45707e-09) -bones/59/rotation = Quaternion(0.473626, -0.0141986, -0.0570725, 0.87876) +bones/59/position = Vector3(5.40815e-09, 0.307144, -9.06498e-09) +bones/59/rotation = Quaternion(0.395933, -0.398605, -0.162316, 0.811175) bones/59/scale = Vector3(1, 1, 1) -bones/60/rotation = Quaternion(0.0010631, -0.236687, 0.000258942, 0.971585) +bones/60/rotation = Quaternion(0.00108256, -0.144928, 0.000158582, 0.989442) bones/60/scale = Vector3(1, 1, 1) -bones/61/position = Vector3(-2.93877e-08, 0.0549805, -0.000120363) -bones/61/rotation = Quaternion(-0.291355, -0.330415, 0.107755, 0.89125) +bones/61/position = Vector3(-2.59791e-08, 0.046591, -0.000102098) +bones/61/rotation = Quaternion(-0.276157, -0.198124, 0.116921, 0.933174) bones/61/scale = Vector3(1, 1, 1) bones/62/rotation = Quaternion(0.493569, 0.84346, 0.0982726, -0.187901) bones/63/rotation = Quaternion(0.52804, -0.147693, -0.0941254, 0.830964) @@ -229,28 +229,28 @@ bones/93/rotation = Quaternion(-0.494209, 0.0204614, -0.0359497, 0.868359) bones/93/scale = Vector3(1, 1.13164, 1) bones/94/rotation = Quaternion(-0.547852, 0.057849, -0.0581314, 0.832546) bones/94/scale = Vector3(1, 1.05697, 1) -bones/95/position = Vector3(-2.1694e-08, 0.0549805, -0.00012031) -bones/95/rotation = Quaternion(-0.794955, -0.159062, -0.0814849, 0.579747) +bones/95/position = Vector3(-1.22626e-08, 0.0465911, -0.000102191) +bones/95/rotation = Quaternion(-0.795959, -0.113211, -0.0295759, 0.593934) bones/95/scale = Vector3(1, 1, 1) -bones/96/position = Vector3(4.66365e-10, 0.286249, 6.49633e-10) -bones/96/rotation = Quaternion(-0.512042, 0.0156477, -0.0260083, 0.858424) -bones/96/scale = Vector3(1, 1.10131, 1) +bones/96/position = Vector3(-4.57976e-08, 0.307144, 5.04497e-09) +bones/96/rotation = Quaternion(-0.52525, -0.08765, -0.208418, 0.820361) +bones/96/scale = Vector3(1, 1.15055, 1) bones/97/position = Vector3(-0.00645471, 0.000163305, -0.00321278) bones/97/rotation = Quaternion(0.248427, 0.0258538, -0.267814, 0.930533) bones/97/scale = Vector3(1, 1, 1) bones/98/position = Vector3(-5.76256e-09, 0.0159596, 0.000181361) bones/98/rotation = Quaternion(-0.0586372, -0.00568235, -0.12181, 0.990804) -bones/99/rotation = Quaternion(-0.464283, 0.136417, -0.108035, 0.868424) +bones/99/rotation = Quaternion(-0.399689, 0.116779, -0.0017598, 0.90918) bones/99/scale = Vector3(1, 1, 1) -bones/100/rotation = Quaternion(0.0484101, -0.0283616, 0.483438, 0.873579) -bones/101/rotation = Quaternion(0.0775702, 0.449346, 0.727588, 0.51253) +bones/100/rotation = Quaternion(0.0474244, -0.0299806, 0.512671, 0.85675) +bones/101/rotation = Quaternion(0.00919888, 0.49081, 0.646158, 0.584381) bones/102/position = Vector3(6.2732e-09, 0.281682, 9.00968e-08) -bones/102/rotation = Quaternion(0.0545003, 5.02601e-05, 4.98569e-05, 0.998514) +bones/102/rotation = Quaternion(0.0266923, 4.91408e-05, 5.12579e-05, 0.999644) bones/102/scale = Vector3(1, 1, 1) -bones/103/rotation = Quaternion(0.00109412, 0.000158973, -1.86224e-07, 0.999999) +bones/103/rotation = Quaternion(0.00109832, 0.00601476, -2.36188e-05, 0.999981) bones/103/scale = Vector3(0.999997, 0.999997, 1) bones/104/position = Vector3(-1.97803e-07, 0.068466, -0.000150014) -bones/104/rotation = Quaternion(-0.422172, 0.000257926, -0.000178401, 0.906516) +bones/104/rotation = Quaternion(-0.440103, 0.0120994, -0.0111051, 0.897797) bones/104/scale = Vector3(1, 1, 1) bones/105/rotation = Quaternion(-0.272954, 0.938438, 0.146391, -0.152973) bones/106/rotation = Quaternion(0.58496, 0.153924, 0.0835466, 0.791928) @@ -296,96 +296,96 @@ bones/136/scale = Vector3(1, 1.25698, 1) bones/137/rotation = Quaternion(-0.479239, -0.0566498, 0.0570499, 0.873994) bones/137/scale = Vector3(1, 1.15486, 1) bones/138/position = Vector3(-1.96072e-07, 0.068466, -0.000149977) -bones/138/rotation = Quaternion(-0.84458, 0.000158066, 2.97161e-05, 0.535429) +bones/138/rotation = Quaternion(-0.849839, 0.00842519, 0.000387153, 0.526974) bones/138/scale = Vector3(1, 1, 1) bones/139/position = Vector3(3.48513e-09, 0.281682, 1.40144e-07) -bones/139/rotation = Quaternion(-0.687123, 2.04686e-06, 6.09266e-05, 0.726541) +bones/139/rotation = Quaternion(-0.697167, 1.14246e-06, 6.09538e-05, 0.716909) bones/139/scale = Vector3(1, 1, 1) bones/140/position = Vector3(-0.00091601, -0.00419344, -0.00166352) bones/140/rotation = Quaternion(0.180101, -0.00275761, 0.0409847, 0.98279) bones/140/scale = Vector3(1.12362, 1, 1) bones/141/position = Vector3(2.32831e-10, 0.0159594, 0.000181319) bones/141/rotation = Quaternion(-0.0876969, -0.00686066, -0.0793036, 0.992962) -bones/142/rotation = Quaternion(-0.586466, -0.0829426, 0.472056, 0.652947) +bones/142/rotation = Quaternion(-0.627963, -0.0317508, 0.444244, 0.638202) bones/142/scale = Vector3(1, 1, 0.999999) -bones/143/position = Vector3(-0.0157509, 0.110076, 0.070133) -bones/144/position = Vector3(-0.0190343, 0.0529374, 0.105173) -bones/145/position = Vector3(-0.0266134, -0.0164902, 0.117919) -bones/146/position = Vector3(0.00819016, 0.0447055, -0.139111) -bones/147/position = Vector3(0.119555, 0.0326258, -0.0724638) -bones/147/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/148/position = Vector3(0.11106, 0.0912614, -0.0495486) -bones/148/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/149/position = Vector3(0.0821867, 0.0712662, 0.0489647) -bones/149/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/150/position = Vector3(0.103737, -0.00711405, 0.0367808) -bones/150/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/151/position = Vector3(0.0377796, 0.0585217, 0.0855623) -bones/152/position = Vector3(0.0399445, -0.0143235, 0.0879967) -bones/153/position = Vector3(0.0355741, 0.111537, 0.0531744) -bones/153/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/154/position = Vector3(0.0633671, 0.134132, 0.0386836) -bones/154/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/155/position = Vector3(0.0763992, 0.158268, 0.00787786) -bones/155/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/156/position = Vector3(0.0843317, 0.16087, -0.0187304) -bones/156/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/157/position = Vector3(0.103789, 0.124986, -0.0455307) -bones/157/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/158/position = Vector3(0.0641229, 0.130076, -0.0663504) -bones/158/rotation = Quaternion(0.13055, -0.190863, 0.0184021, 0.972723) -bones/159/position = Vector3(-0.12052, 0.0578499, -0.090591) -bones/159/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/160/position = Vector3(-0.0887008, 0.112145, -0.0823898) -bones/160/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/161/position = Vector3(-0.105785, 0.130835, 0.0235307) -bones/161/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/162/position = Vector3(-0.133833, 0.0680465, -0.0008802) -bones/162/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/163/position = Vector3(-0.0678342, 0.0768959, 0.0902058) -bones/164/position = Vector3(-0.0909648, 0.00810681, 0.101005) -bones/165/position = Vector3(-0.054279, 0.147907, 0.053614) -bones/165/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/166/position = Vector3(-0.0629728, 0.18342, 0.0201805) -bones/166/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/167/position = Vector3(-0.055519, 0.197924, -0.0178972) -bones/167/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/168/position = Vector3(-0.0570758, 0.194628, -0.0455452) -bones/168/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/169/position = Vector3(-0.0892776, 0.165738, -0.0636963) -bones/169/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/170/position = Vector3(-0.0563384, 0.148642, -0.0744274) -bones/170/rotation = Quaternion(0.0314996, 0.0258716, -0.323216, 0.945447) -bones/171/rotation = Quaternion(0.73484, 0.207791, -0.431409, 0.480332) +bones/143/position = Vector3(-0.00977684, 0.110009, 0.0700904) +bones/144/position = Vector3(0.0101174, 0.0525767, 0.104673) +bones/145/position = Vector3(0.00678728, -0.0164962, 0.105971) +bones/146/position = Vector3(-0.00780965, 0.0439172, -0.136987) +bones/147/position = Vector3(0.119088, 0.0274, -0.0567642) +bones/147/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/148/position = Vector3(0.108078, 0.0874024, -0.0470377) +bones/148/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/149/position = Vector3(0.08159, 0.0713088, 0.0240798) +bones/149/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/150/position = Vector3(0.102804, -0.00488756, 0.0119127) +bones/150/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/151/position = Vector3(0.0505875, 0.0595045, 0.0702025) +bones/152/position = Vector3(0.0655902, -0.0127084, 0.0607059) +bones/153/position = Vector3(0.0363261, 0.110584, 0.0532361) +bones/153/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/154/position = Vector3(0.0575689, 0.131111, 0.0422142) +bones/154/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/155/position = Vector3(0.0743553, 0.154664, 0.0128061) +bones/155/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/156/position = Vector3(0.0845406, 0.156977, -0.0130514) +bones/156/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/157/position = Vector3(0.101361, 0.12102, -0.0430962) +bones/157/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/158/position = Vector3(0.0563635, 0.128918, -0.0695375) +bones/158/rotation = Quaternion(0.128323, -0.233519, -0.00414657, 0.963839) +bones/159/position = Vector3(-0.111627, 0.0615783, -0.0653986) +bones/159/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/160/position = Vector3(-0.102933, 0.113319, -0.0592115) +bones/160/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/161/position = Vector3(-0.106708, 0.122461, 0.0361705) +bones/161/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/162/position = Vector3(-0.129211, 0.0573469, 0.0261901) +bones/162/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/163/position = Vector3(-0.0525523, 0.0764716, 0.0970148) +bones/164/position = Vector3(-0.0807715, 0.00876589, 0.0907723) +bones/165/position = Vector3(-0.0495015, 0.142372, 0.0563151) +bones/165/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/166/position = Vector3(-0.0661212, 0.180157, 0.0201212) +bones/166/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/167/position = Vector3(-0.0596306, 0.195154, -0.0182209) +bones/167/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/168/position = Vector3(-0.0607534, 0.191763, -0.0458784) +bones/168/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/169/position = Vector3(-0.0908062, 0.160779, -0.0642596) +bones/169/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/170/position = Vector3(-0.0567139, 0.145932, -0.074734) +bones/170/rotation = Quaternion(0.0317483, 0.0233073, -0.291181, 0.955857) +bones/171/rotation = Quaternion(0.854971, 0.00733622, -0.260115, 0.448677) bones/171/scale = Vector3(0.999998, 0.999997, 1.00001) bones/172/position = Vector3(3.62338e-10, 0.531431, 3.56619e-08) -bones/172/rotation = Quaternion(0.261712, -3.34694e-06, -7.10597e-07, 0.965146) +bones/172/rotation = Quaternion(0.258803, -2.06746e-06, -4.1853e-07, 0.96593) bones/172/scale = Vector3(1, 0.999998, 1.00001) bones/173/position = Vector3(6.48577e-09, 0.418112, 8.79831e-08) -bones/173/rotation = Quaternion(-0.3691, -0.0218226, 0.0524658, 0.927651) +bones/173/rotation = Quaternion(-0.376693, -0.00422509, 0.0103832, 0.926271) bones/173/scale = Vector3(1, 0.999992, 0.999996) bones/174/rotation = Quaternion(-0.388439, -1.7287e-07, -1.04265e-07, 0.921475) bones/175/position = Vector3(1.16517e-08, 0.418112, 8.45817e-08) -bones/175/rotation = Quaternion(-0.733582, -0.0141893, 0.013972, 0.679309) +bones/175/rotation = Quaternion(-0.735503, -0.00277704, 0.00277694, 0.67751) bones/175/scale = Vector3(1, 1, 1) bones/176/position = Vector3(1.15382e-08, 0.531431, 3.0748e-08) -bones/176/rotation = Quaternion(-0.645273, -9.31133e-07, -1.69466e-06, 0.763952) -bones/176/scale = Vector3(1, 1.01111, 1) -bones/177/rotation = Quaternion(0.934745, 0.0476274, -0.10747, 0.335311) +bones/176/rotation = Quaternion(-0.646424, -5.9335e-07, -1.08843e-06, 0.762979) +bones/176/scale = Vector3(1, 1.01069, 1) +bones/177/rotation = Quaternion(0.942402, -0.134367, 0.108775, 0.286342) bones/177/scale = Vector3(1, 0.999998, 1.00001) bones/178/position = Vector3(2.73163e-08, 0.531431, 1.20327e-09) -bones/178/rotation = Quaternion(0.280932, -1.7813e-06, -7.15777e-07, 0.959728) +bones/178/rotation = Quaternion(0.329132, 1.76459e-06, 3.5229e-07, 0.944284) bones/178/scale = Vector3(1, 0.999999, 1.00001) bones/179/position = Vector3(8.4155e-09, 0.418112, 3.97981e-07) -bones/179/rotation = Quaternion(-0.36438, 0.000318822, -0.0991704, 0.925955) +bones/179/rotation = Quaternion(-0.431379, -0.000697695, -0.137163, 0.891683) bones/179/scale = Vector3(1, 0.99999, 0.999998) -bones/180/rotation = Quaternion(-0.587981, 1.5399e-07, 1.64871e-07, 0.808875) +bones/180/rotation = Quaternion(-0.556989, 1.6083e-07, 1.64943e-07, 0.83052) bones/181/position = Vector3(2.69973e-08, 0.418112, 4.26027e-07) -bones/181/rotation = Quaternion(-0.732421, 0.013617, -0.0320139, 0.679963) +bones/181/rotation = Quaternion(-0.749706, 0.0184746, -0.0444561, 0.660017) bones/181/scale = Vector3(1, 1, 1) bones/182/position = Vector3(1.89344e-08, 0.531431, -1.32203e-08) -bones/182/rotation = Quaternion(-0.637614, -2.66766e-07, -6.81691e-07, 0.770356) -bones/182/scale = Vector3(1, 1.01419, 1) +bones/182/rotation = Quaternion(-0.617914, 5.15812e-07, 1.002e-06, 0.786246) +bones/182/scale = Vector3(1, 1.02443, 1) [node name="BoneFlipper" type="SkeletonModifier3D" parent="Model/Armature/Skeleton3D" index="0"] _import_path = NodePath("") diff --git a/scenes/test.tscn b/scenes/test.tscn index 8e062cd..3a2e7ed 100644 --- a/scenes/test.tscn +++ b/scenes/test.tscn @@ -102,13 +102,13 @@ size = Vector3(16.9418, 8.64539, 28.0487) [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) -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = SubResource("Environment_wctar") - [node name="MainCamera" parent="." instance=ExtResource("3_74lek")] transform = Transform3D(0.866025, -0.321394, 0.383022, 0, 0.766044, 0.642788, -0.5, -0.55667, 0.663414, 4.894, 6.43, 6.963) _angle_degrees = Vector3(-45, -45, 0) +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_wctar") + [node name="ProjectileSpawner" parent="." instance=ExtResource("4_84n74")] transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 10, 0, -7) diff --git a/scenes/ui/cursor.tscn b/scenes/ui/cursor.tscn index 9acc71a..1800bb5 100644 --- a/scenes/ui/cursor.tscn +++ b/scenes/ui/cursor.tscn @@ -5,8 +5,6 @@ [node name="Cursor" type="CanvasLayer"] process_mode = 3 -process_priority = 1000 -process_physics_priority = 1000 layer = 128 script = ExtResource("1_tkygf") diff --git a/scripts/globals/cursor.gd b/scripts/globals/cursor.gd index 77987a0..1ec3d39 100644 --- a/scripts/globals/cursor.gd +++ b/scripts/globals/cursor.gd @@ -14,7 +14,7 @@ func _ready() -> void: Input.mouse_mode = Input.MOUSE_MODE_HIDDEN -func _process(delta: float) -> void: +func _process(_delta: float) -> void: if not Referencer.players or not Referencer.main_camera: var mouse_pos := get_viewport().get_mouse_position() _single_cursor.position = mouse_pos - _single_cursor.size / 2 @@ -22,6 +22,8 @@ func _process(delta: float) -> void: return _single_cursor.visible = false + +func _physics_process(delta: float) -> void: call_deferred("_handle_cursors", delta) @@ -87,6 +89,10 @@ func _handle_cursor(player_index: int, delta: float) -> void: ) cursor.base.modulate = player.cursor_color + if player.input_mode_is(Inputer.Mode.KB_MOUSE): + cursor.base.position = ( + get_viewport().get_mouse_position() - cursor.base.size / 2 + ) class PlayerCursor: diff --git a/scripts/main_camera.gd b/scripts/main_camera.gd index 68841a2..4247ff4 100644 --- a/scripts/main_camera.gd +++ b/scripts/main_camera.gd @@ -13,11 +13,11 @@ extends Camera3D @export_group("Damage shake") @export var _damage_shake_duration: float = 0.5 @export_exp_easing var _damage_shake_ease: float = 2 -@export var _damage_shake_amplitude: float = 0.02 +@export var _damage_shake_amplitude: float = 0.1 @export var _damage_shake_frequency: float = 50 @export_group("Hit shake") -@export var _hit_shake_fov: float = 0.5 +@export var _hit_shake_fov: float = 1 @export var _hit_shake_duration: float = 0.5 @export_exp_easing var _hit_shake_ease: float = 4 @@ -40,6 +40,9 @@ func _process(delta: float) -> void: fov = _fov _damage_shake(delta) _hit_shake(delta) + + +func _physics_process(delta: float) -> void: call_deferred("_process_following", delta) diff --git a/scripts/player/player.gd b/scripts/player/player.gd index 1f44cf7..91b723b 100644 --- a/scripts/player/player.gd +++ b/scripts/player/player.gd @@ -27,7 +27,6 @@ func _ready() -> void: func _process(_delta: float) -> void: - call_deferred("_aiming") var aim_pos := global_position + aiming.aim_offset Debugger.marker("aim", aim_pos + Vector3.UP) @@ -35,6 +34,7 @@ func _process(_delta: float) -> void: func _physics_process(delta: float) -> void: + _aiming() var can_move := not attack.is_hitting() velocity = movement.movement(velocity, delta, is_on_floor(), can_move)