From ea0aef68ac0182f53a1e432bbf9b5c48d8d9da32 Mon Sep 17 00:00:00 2001 From: ywmaa <68971808+ywmaa@users.noreply.github.com> Date: Wed, 13 Sep 2023 03:51:27 +0300 Subject: [PATCH] bugfix: GroundCheck doesn't change height for crouching --- AMSG_Examples/Character/mixamo_character.tscn | 100 ++++++++---------- AMSG_Examples/Player/Player.tscn | 97 +++++++++-------- .../Components/CharacterMovementComponent.gd | 2 + project.godot | 6 +- 4 files changed, 100 insertions(+), 105 deletions(-) diff --git a/AMSG_Examples/Character/mixamo_character.tscn b/AMSG_Examples/Character/mixamo_character.tscn index 25a9beb..6115268 100644 --- a/AMSG_Examples/Character/mixamo_character.tscn +++ b/AMSG_Examples/Character/mixamo_character.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=76 format=3 uid="uid://cth47yn1duvdh"] +[gd_scene load_steps=74 format=3 uid="uid://cth47yn1duvdh"] [ext_resource type="Script" path="res://addons/AMSG/Components/CharacterMovementComponent.gd" id="1_ewnep"] [ext_resource type="Resource" uid="uid://buhjkpv85gdmi" path="res://AMSG_Examples/Character/standing_movement_values.tres" id="2_c4o7m"] @@ -255,7 +255,7 @@ nodes/standing/node = SubResource("AnimationNodeStateMachine_ieguh") nodes/standing/position = Vector2(-120, 40) node_connections = [&"output", 0, &"crouch", &"crouch", 0, &"standing", &"crouch", 1, &"crouching"] -[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_uekge"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_al4un"] resource_local_to_scene = true nodes/AnimTurnLeft/node = SubResource("AnimationNodeAnimation_mb2kt") nodes/AnimTurnLeft/position = Vector2(500, 1540) @@ -274,10 +274,6 @@ nodes/VelocityDirection/position = Vector2(680, 1400) nodes/output/position = Vector2(1540, 1400) node_connections = [&"output", 0, &"InAir", &"InAir", 0, &"Turn", &"InAir", 1, &"FallAnimation", &"RightOrLeft", 0, &"AnimTurnLeft", &"RightOrLeft", 1, &"AnimTurnRight", &"Turn", 0, &"VelocityDirection", &"Turn", 1, &"RightOrLeft"] -[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_2cqd5"] - -[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_5kb4e"] - [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_70w0s"] resource_local_to_scene = true radius = 0.375 @@ -535,14 +531,12 @@ aim_standing_data = ExtResource("2_c4o7m") aim_crouch_data = ExtResource("3_p3fng") [node name="AnimationTree" parent="." node_paths=PackedStringArray("movement_script") instance=ExtResource("3_86f8p")] -tree_root = SubResource("AnimationNodeBlendTree_uekge") +tree_root = SubResource("AnimationNodeBlendTree_al4un") anim_player = NodePath("../AnimationPlayer") active = true parameters/VelocityDirection/crouch/current_state = "" parameters/VelocityDirection/crouch/transition_request = "" parameters/VelocityDirection/crouch/current_index = 0 -parameters/VelocityDirection/crouching/playback = SubResource("AnimationNodeStateMachinePlayback_2cqd5") -parameters/VelocityDirection/standing/playback = SubResource("AnimationNodeStateMachinePlayback_5kb4e") parameters/VelocityDirection/standing/Jog/FB/current_state = "" parameters/VelocityDirection/standing/Jog/FB/transition_request = "Forward" parameters/VelocityDirection/standing/Jog/FB/current_index = 0 @@ -570,43 +564,43 @@ bones/0/name = "Hips" bones/0/parent = -1 bones/0/rest = Transform3D(0.544576, -0.0348814, -0.837986, 0.0102475, 0.999337, -0.0349382, 0.838649, 0.0104393, 0.544573, -0.000172998, 0.901879, -0.00179914) bones/0/enabled = true -bones/0/position = Vector3(0.0046573, 0.928532, -0.00704415) -bones/0/rotation = Quaternion(-0.0388708, -0.367714, -0.0143724, 0.929015) +bones/0/position = Vector3(-0.00181628, 0.928476, -0.00705356) +bones/0/rotation = Quaternion(-0.0371538, -0.367715, -0.0122042, 0.929116) bones/0/scale = Vector3(1, 1, 1) bones/1/name = "Spine" bones/1/parent = 0 bones/1/rest = Transform3D(0.99963, -0.0129189, 0.0239171, 0.01122, 0.997494, 0.0698543, -0.0247596, -0.0695601, 0.99727, 4.88944e-09, 0.0992349, -0.0122733) bones/1/enabled = true bones/1/position = Vector3(4.88944e-09, 0.0992349, -0.0122733) -bones/1/rotation = Quaternion(-0.0108126, 0.0405103, -0.00590771, 0.999103) +bones/1/rotation = Quaternion(-0.0113944, 0.0399942, -0.00607693, 0.999117) bones/1/scale = Vector3(1, 1, 1) bones/2/name = "Spine1" bones/2/parent = 1 bones/2/rest = Transform3D(0.99985, -0.015446, 0.00786788, 0.0155655, 0.999761, -0.0153596, -0.00762876, 0.0154798, 0.999851, -2.79397e-09, 0.11732, 1.86265e-09) bones/2/enabled = true bones/2/position = Vector3(-2.79397e-09, 0.11732, 1.86265e-09) -bones/2/rotation = Quaternion(0.0997541, 0.0822027, -0.00811827, 0.991578) +bones/2/rotation = Quaternion(0.0987031, 0.0812181, -0.0085175, 0.99176) bones/2/scale = Vector3(1, 1, 1) bones/3/name = "Spine2" bones/3/parent = 2 bones/3/rest = Transform3D(0.999844, -0.014346, 0.0103258, 0.0156141, 0.990645, -0.135571, -0.00828427, 0.135711, 0.990714, -2.79397e-09, 0.134588, -2.51457e-08) bones/3/enabled = true bones/3/position = Vector3(-2.79397e-09, 0.134588, -2.51457e-08) -bones/3/rotation = Quaternion(0.159445, 0.0815607, -0.0131101, 0.983745) +bones/3/rotation = Quaternion(0.158364, 0.0805516, -0.0134215, 0.983998) bones/3/scale = Vector3(1, 1, 1) bones/4/name = "Neck" bones/4/parent = 3 bones/4/rest = Transform3D(0.968778, 0.12654, 0.213204, -0.00181599, 0.863542, -0.504273, -0.247921, 0.488142, 0.836811, 2.48197e-07, 0.150325, 0.00792907) bones/4/enabled = true bones/4/position = Vector3(2.48197e-07, 0.150325, 0.00792907) -bones/4/rotation = Quaternion(0.115686, -0.0106419, 0.00349793, 0.993223) +bones/4/rotation = Quaternion(0.120433, -0.0101668, 0.00296552, 0.992665) bones/4/scale = Vector3(1, 1, 1) bones/5/name = "Head" bones/5/parent = 4 bones/5/rest = Transform3D(0.840773, 0.330252, 0.428993, -0.33245, 0.940342, -0.0723432, -0.427291, -0.0817944, 0.900406, 5.58794e-09, 0.107895, 5.21541e-08) bones/5/enabled = true bones/5/position = Vector3(5.58794e-09, 0.107895, 5.21541e-08) -bones/5/rotation = Quaternion(-0.0349443, 0.164478, -0.0666652, 0.983505) +bones/5/rotation = Quaternion(-0.0192154, 0.165135, -0.0651452, 0.98393) bones/5/scale = Vector3(1, 1, 1) bones/6/name = "HeadTop_End" bones/6/parent = 5 @@ -634,42 +628,42 @@ bones/9/parent = 3 bones/9/rest = Transform3D(-0.250988, 0.959361, -0.128958, 0.025503, -0.126623, -0.991623, -0.967654, -0.252174, 0.0073142, 0.0610582, 0.0911044, 0.00705553) bones/9/enabled = true bones/9/position = Vector3(0.0610582, 0.0911044, 0.00705553) -bones/9/rotation = Quaternion(-0.490549, -0.519819, 0.571963, -0.402502) +bones/9/rotation = Quaternion(-0.488797, -0.521537, 0.571626, -0.402889) bones/9/scale = Vector3(1, 1, 1) bones/10/name = "LeftArm" bones/10/parent = 9 bones/10/rest = Transform3D(0.845869, -0.51692, -0.131522, 0.093338, 0.386222, -0.917671, 0.52516, 0.763954, 0.374941, 7.45058e-09, 0.129223, 3.95812e-08) bones/10/enabled = true bones/10/position = Vector3(7.45058e-09, 0.129223, 3.95812e-08) -bones/10/rotation = Quaternion(0.523509, -0.0831806, 0.144218, 0.835596) +bones/10/rotation = Quaternion(0.522763, -0.0830524, 0.145067, 0.835929) bones/10/scale = Vector3(1, 1, 1) bones/11/name = "LeftForeArm" bones/11/parent = 10 bones/11/rest = Transform3D(0.138967, -0.989426, 0.0415226, 0.989436, 0.140472, 0.0358277, -0.0412816, 0.0361051, 0.998495, -4.47035e-08, 0.274229, -7.45058e-09) bones/11/enabled = true bones/11/position = Vector3(-4.47035e-08, 0.274229, -7.45058e-09) -bones/11/rotation = Quaternion(-0.0122892, 0.0917405, 0.443377, 0.891543) +bones/11/rotation = Quaternion(-0.01138, 0.091277, 0.443243, 0.89167) bones/11/scale = Vector3(1, 1, 1) bones/12/name = "LeftHand" bones/12/parent = 11 bones/12/rest = Transform3D(0.746359, -0.304314, 0.591895, 0.184003, 0.949028, 0.255908, -0.639601, -0.0820888, 0.764311, 6.0536e-09, 0.276326, -1.49012e-08) bones/12/enabled = true bones/12/position = Vector3(6.0536e-09, 0.276326, -1.49012e-08) -bones/12/rotation = Quaternion(-0.118116, 0.122339, -0.0073744, 0.985407) +bones/12/rotation = Quaternion(-0.116642, 0.120629, -0.00691149, 0.985797) bones/12/scale = Vector3(1, 1, 1) bones/13/name = "LeftHandMiddle1" bones/13/parent = 12 bones/13/rest = Transform3D(0.98654, 0.118644, -0.112532, -0.118809, 0.0472127, -0.991794, -0.112357, 0.991814, 0.0606732, -3.12924e-07, 0.127755, -7.63685e-08) bones/13/enabled = true bones/13/position = Vector3(-3.12924e-07, 0.127755, -7.63685e-08) -bones/13/rotation = Quaternion(0.130353, 0.00516825, -0.0806636, 0.988167) +bones/13/rotation = Quaternion(0.128295, 0.00517663, -0.0810072, 0.988409) bones/13/scale = Vector3(1, 1, 1) bones/14/name = "LeftHandMiddle2" bones/14/parent = 13 bones/14/rest = Transform3D(0.980685, 0.110739, -0.161229, -0.112737, -0.353585, -0.928584, -0.159838, 0.928824, -0.334271, -7.45058e-09, 0.0361397, -5.21541e-08) bones/14/enabled = true bones/14/position = Vector3(-7.45058e-09, 0.0361397, -5.21541e-08) -bones/14/rotation = Quaternion(0.193591, -0.00134108, 0.0147623, 0.98097) +bones/14/rotation = Quaternion(0.194681, -0.00135003, 0.0148842, 0.980753) bones/14/scale = Vector3(1, 1, 1) bones/15/name = "LeftHandMiddle3" bones/15/parent = 14 @@ -690,14 +684,14 @@ bones/17/parent = 12 bones/17/rest = Transform3D(0.922249, -0.296379, 0.248225, 0.374682, 0.843413, -0.385056, -0.0952333, 0.448123, 0.888885, -0.0300309, 0.0378879, 0.0216701) bones/17/enabled = true bones/17/position = Vector3(-0.0300309, 0.0378879, 0.0216701) -bones/17/rotation = Quaternion(0.291029, 0.116526, 0.176806, 0.932986) +bones/17/rotation = Quaternion(0.285412, 0.113206, 0.188551, 0.93283) bones/17/scale = Vector3(1, 1, 1) bones/18/name = "LeftHandThumb2" bones/18/parent = 17 bones/18/rest = Transform3D(0.793061, 0.491162, -0.360297, -0.562049, 0.818065, -0.121947, 0.234851, 0.299216, 0.924832, 1.19209e-07, 0.0474499, -2.44938e-07) bones/18/enabled = true bones/18/position = Vector3(1.19209e-07, 0.0474499, -2.44938e-07) -bones/18/rotation = Quaternion(-0.00513924, 0.00128102, -0.00161039, 0.999985) +bones/18/rotation = Quaternion(-0.00803301, 0.00125914, -0.000718717, 0.999967) bones/18/scale = Vector3(1, 1, 1) bones/19/name = "LeftHandThumb3" bones/19/parent = 18 @@ -718,14 +712,14 @@ bones/21/parent = 12 bones/21/rest = Transform3D(0.983723, 0.142189, -0.109869, -0.119058, 0.0577917, -0.991204, -0.134589, 0.988151, 0.0737798, -0.0282207, 0.122666, 0.00231682) bones/21/enabled = true bones/21/position = Vector3(-0.0282207, 0.122666, 0.00231682) -bones/21/rotation = Quaternion(0.0475941, -0.00737054, 0.0610451, 0.996972) +bones/21/rotation = Quaternion(0.0334089, -0.00541945, 0.0614029, 0.997539) bones/21/scale = Vector3(1, 1, 1) bones/22/name = "LeftHandIndex2" bones/22/parent = 21 bones/22/rest = Transform3D(0.978949, 0.10384, -0.175717, -0.111366, -0.44972, -0.8862, -0.171047, 0.887113, -0.428688, 1.11759e-07, 0.0389198, -5.96046e-08) bones/22/enabled = true bones/22/position = Vector3(1.11759e-07, 0.0389198, -5.96046e-08) -bones/22/rotation = Quaternion(0.148575, -0.00087253, -0.00615875, 0.988882) +bones/22/rotation = Quaternion(0.147976, -0.000845157, -0.00623067, 0.988971) bones/22/scale = Vector3(1, 1, 1) bones/23/name = "LeftHandIndex3" bones/23/parent = 22 @@ -746,14 +740,14 @@ bones/25/parent = 12 bones/25/rest = Transform3D(0.991492, 0.0540781, -0.118406, -0.118263, -0.00584495, -0.992965, -0.0543897, 0.99852, 0.000600219, 0.0221662, 0.12147, -9.90927e-05) bones/25/enabled = true bones/25/position = Vector3(0.0221662, 0.12147, -9.90927e-05) -bones/25/rotation = Quaternion(0.270399, -0.0148768, -0.125223, 0.954454) +bones/25/rotation = Quaternion(0.268033, -0.0150797, -0.126019, 0.955013) bones/25/scale = Vector3(1, 1, 1) bones/26/name = "LeftHandRing2" bones/26/parent = 25 bones/26/rest = Transform3D(0.981497, 0.113181, -0.154445, -0.116659, -0.286137, -0.951061, -0.151835, 0.951481, -0.267639, -3.72529e-08, 0.036012, -1.11759e-07) bones/26/enabled = true bones/26/position = Vector3(-3.72529e-08, 0.036012, -1.11759e-07) -bones/26/rotation = Quaternion(0.278802, 0.00168958, 0.0245668, 0.960033) +bones/26/rotation = Quaternion(0.278796, 0.00169043, 0.0245665, 0.960035) bones/26/scale = Vector3(1, 1, 1) bones/27/name = "LeftHandRing3" bones/27/parent = 26 @@ -774,14 +768,14 @@ bones/29/parent = 12 bones/29/rest = Transform3D(0.991785, 0.0101279, -0.127516, -0.126197, -0.0855001, -0.988314, -0.0209122, 0.996287, -0.0835196, 0.0472581, 0.109082, 0.00226384) bones/29/enabled = true bones/29/position = Vector3(0.0472581, 0.109082, 0.00226384) -bones/29/rotation = Quaternion(0.295463, -0.0159181, -0.158852, 0.941921) +bones/29/rotation = Quaternion(0.294029, -0.0160323, -0.159008, 0.942341) bones/29/scale = Vector3(1, 1, 1) bones/30/name = "LeftHandPinky2" bones/30/parent = 29 bones/30/rest = Transform3D(0.989305, 0.129006, -0.068066, -0.049097, -0.144898, -0.988228, -0.13735, 0.981001, -0.137015, -5.96046e-08, 0.0413669, -1.49012e-08) bones/30/enabled = true bones/30/position = Vector3(-5.96046e-08, 0.0413669, -1.49012e-08) -bones/30/rotation = Quaternion(0.339654, 0.0113506, 0.0499343, 0.939155) +bones/30/rotation = Quaternion(0.339897, 0.0113803, 0.0499377, 0.939067) bones/30/scale = Vector3(1, 1, 1) bones/31/name = "LeftHandPinky3" bones/31/parent = 30 @@ -802,42 +796,42 @@ bones/33/parent = 3 bones/33/rest = Transform3D(-0.214833, -0.949432, 0.228968, -0.0511495, -0.223182, -0.973434, 0.975311, -0.220837, -0.000616074, -0.061057, 0.0911053, 0.00705566) bones/33/enabled = true bones/33/position = Vector3(-0.061057, 0.0911053, 0.00705566) -bones/33/rotation = Quaternion(0.542566, -0.479921, 0.539745, 0.428921) +bones/33/rotation = Quaternion(0.539134, -0.483244, 0.539649, 0.429637) bones/33/scale = Vector3(1, 1, 1) bones/34/name = "RightArm" bones/34/parent = 33 bones/34/rest = Transform3D(0.555382, 0.714901, -0.424814, -0.786414, 0.285417, -0.547804, -0.270377, 0.63832, 0.720724, -2.23517e-08, 0.129223, 9.12696e-08) bones/34/enabled = true bones/34/position = Vector3(-2.23517e-08, 0.129223, 9.12696e-08) -bones/34/rotation = Quaternion(0.512736, 0.0870515, 0.0786523, 0.850493) +bones/34/rotation = Quaternion(0.508942, 0.0903112, 0.076779, 0.8526) bones/34/scale = Vector3(1, 1, 1) bones/35/name = "RightForeArm" bones/35/parent = 34 bones/35/rest = Transform3D(-0.491194, 0.870247, -0.0374029, -0.870282, -0.488505, 0.0630281, 0.0365786, 0.0635101, 0.997311, 7.45058e-09, 0.274776, -3.72529e-08) bones/35/enabled = true bones/35/position = Vector3(7.45058e-09, 0.274776, -3.72529e-08) -bones/35/rotation = Quaternion(0.0534985, -0.0509765, -0.427707, 0.900892) +bones/35/rotation = Quaternion(0.0543442, -0.0514812, -0.427994, 0.900676) bones/35/scale = Vector3(1, 1, 1) bones/36/name = "RightHand" bones/36/parent = 35 bones/36/rest = Transform3D(0.953663, 0.121098, 0.275431, -0.18063, 0.962538, 0.202223, -0.240624, -0.242603, 0.939811, 7.45058e-09, 0.276868, 5.96046e-08) bones/36/enabled = true bones/36/position = Vector3(7.45058e-09, 0.276868, 5.96046e-08) -bones/36/rotation = Quaternion(0.108485, -0.0205698, -0.0668447, 0.991635) +bones/36/rotation = Quaternion(0.103228, -0.020103, -0.0644907, 0.992361) bones/36/scale = Vector3(1, 1, 1) bones/37/name = "RightHandMiddle1" bones/37/parent = 36 bones/37/rest = Transform3D(0.986308, -0.119644, 0.1135, 0.119813, 0.0469439, -0.991686, 0.113321, 0.991706, 0.060636, 3.50177e-07, 0.127755, -8.9407e-08) bones/37/enabled = true bones/37/position = Vector3(3.50177e-07, 0.127755, -8.9407e-08) -bones/37/rotation = Quaternion(0.111183, 0.00836547, 0.0255322, 0.993437) +bones/37/rotation = Quaternion(0.11056, 0.00839492, 0.0252075, 0.993514) bones/37/scale = Vector3(1, 1, 1) bones/38/name = "RightHandMiddle2" bones/38/parent = 37 bones/38/rest = Transform3D(0.980361, -0.111685, 0.162538, 0.114835, -0.346749, -0.930902, 0.160328, 0.931285, -0.327114, 6.70552e-08, 0.0361398, -1.02445e-07) bones/38/enabled = true bones/38/position = Vector3(6.70552e-08, 0.0361398, -1.02445e-07) -bones/38/rotation = Quaternion(0.278891, 0.00150967, -0.0184624, 0.960144) +bones/38/rotation = Quaternion(0.265164, 0.00141372, -0.0171991, 0.964049) bones/38/scale = Vector3(1, 1, 1) bones/39/name = "RightHandMiddle3" bones/39/parent = 38 @@ -858,14 +852,14 @@ bones/41/parent = 36 bones/41/rest = Transform3D(0.940404, 0.29207, -0.174168, -0.340048, 0.811489, -0.475239, 0.00253238, 0.506143, 0.862446, 0.0300309, 0.037888, 0.0216703) bones/41/enabled = true bones/41/position = Vector3(0.0300309, 0.037888, 0.0216703) -bones/41/rotation = Quaternion(0.203311, 0.0243947, -0.227643, 0.951971) +bones/41/rotation = Quaternion(0.203718, 0.0229025, -0.223484, 0.952906) bones/41/scale = Vector3(1, 1, 1) bones/42/name = "RightHandThumb2" bones/42/parent = 41 bones/42/rest = Transform3D(0.793791, -0.608189, -0.00159446, 0.595053, 0.777184, -0.204689, 0.125729, 0.161531, 0.978826, -1.2666e-07, 0.0474498, -2.68221e-07) bones/42/enabled = true bones/42/position = Vector3(-1.2666e-07, 0.0474498, -2.68221e-07) -bones/42/rotation = Quaternion(0.00447874, 0.00104979, 0.18107, 0.983459) +bones/42/rotation = Quaternion(0.00535975, 0.0015759, 0.187542, 0.982241) bones/42/scale = Vector3(1, 1, 1) bones/43/name = "RightHandThumb3" bones/43/parent = 42 @@ -886,14 +880,14 @@ bones/45/parent = 36 bones/45/rest = Transform3D(0.978763, -0.172845, 0.110213, 0.120904, 0.0525683, -0.991271, 0.165542, 0.983545, 0.0723496, 0.0282207, 0.122666, 0.00231693) bones/45/enabled = true bones/45/position = Vector3(0.0282207, 0.122666, 0.00231693) -bones/45/rotation = Quaternion(0.0537729, 0.0105712, 0.00586389, 0.99848) +bones/45/rotation = Quaternion(0.0467536, 0.0101119, 0.00825465, 0.998821) bones/45/scale = Vector3(1, 1, 1) bones/46/name = "RightHandIndex2" bones/46/parent = 45 bones/46/rest = Transform3D(0.978593, -0.104714, 0.177172, 0.106914, -0.476935, -0.872412, 0.175853, 0.872679, -0.45553, 1.49012e-07, 0.0389196, -8.75443e-08) bones/46/enabled = true bones/46/position = Vector3(1.49012e-07, 0.0389196, -8.75443e-08) -bones/46/rotation = Quaternion(0.182498, 0.00101699, 0.00607069, 0.983187) +bones/46/rotation = Quaternion(0.168443, 0.000701949, 0.00751201, 0.985683) bones/46/scale = Vector3(1, 1, 1) bones/47/name = "RightHandIndex3" bones/47/parent = 46 @@ -914,14 +908,14 @@ bones/49/parent = 36 bones/49/rest = Transform3D(0.991829, -0.0281871, 0.124419, 0.122843, -0.0520322, -0.991061, 0.0344089, 0.998247, -0.0481446, -0.0221661, 0.12147, -9.89214e-05) bones/49/enabled = true bones/49/position = Vector3(-0.0221661, 0.12147, -9.89214e-05) -bones/49/rotation = Quaternion(0.195053, -0.00785942, 0.0668951, 0.978477) +bones/49/rotation = Quaternion(0.187673, -0.00850179, 0.0672759, 0.979888) bones/49/scale = Vector3(1, 1, 1) bones/50/name = "RightHandRing2" bones/50/parent = 49 bones/50/rest = Transform3D(0.982662, -0.117406, 0.143498, 0.122607, -0.169092, -0.977944, 0.139081, 0.978583, -0.151765, -7.45058e-09, 0.036012, 0) bones/50/enabled = true bones/50/position = Vector3(-7.45058e-09, 0.036012, 0) -bones/50/rotation = Quaternion(0.327979, -0.00241433, -0.0348388, 0.944039) +bones/50/rotation = Quaternion(0.321089, -0.0023649, -0.0342551, 0.946426) bones/50/scale = Vector3(1, 1, 1) bones/51/name = "RightHandRing3" bones/51/parent = 50 @@ -942,14 +936,14 @@ bones/53/parent = 36 bones/53/rest = Transform3D(0.989897, 0.0602255, 0.128364, 0.133612, -0.0931972, -0.986642, -0.0474579, 0.993824, -0.100302, -0.047258, 0.109082, 0.00226358) bones/53/enabled = true bones/53/position = Vector3(-0.047258, 0.109082, 0.00226358) -bones/53/rotation = Quaternion(0.208013, -0.0111828, 0.0923374, 0.973694) +bones/53/rotation = Quaternion(0.208255, -0.0111412, 0.0917045, 0.973702) bones/53/scale = Vector3(1, 1, 1) bones/54/name = "RightHandPinky2" bones/54/parent = 53 bones/54/rest = Transform3D(0.983236, -0.118306, 0.138749, 0.122507, -0.134994, -0.983244, 0.135054, 0.983758, -0.118237, -2.98023e-08, 0.0413665, 4.24334e-08) bones/54/enabled = true bones/54/position = Vector3(-2.98023e-08, 0.0413665, 4.24334e-08) -bones/54/rotation = Quaternion(0.379945, -0.0136072, -0.0710299, 0.922178) +bones/54/rotation = Quaternion(0.349848, -0.0122261, -0.0691096, 0.934174) bones/54/scale = Vector3(1, 1, 1) bones/55/name = "RightHandPinky3" bones/55/parent = 54 @@ -970,28 +964,28 @@ bones/57/parent = 0 bones/57/rest = Transform3D(-0.919821, -0.336213, -0.202214, 0.264978, -0.912457, 0.311783, -0.289337, 0.233202, 0.928386, -0.0912445, -0.0665637, -0.000553781) bones/57/enabled = true bones/57/position = Vector3(-0.0912445, -0.0665637, -0.000553781) -bones/57/rotation = Quaternion(-0.124493, 0.0221161, 0.983488, 0.129478) +bones/57/rotation = Quaternion(-0.124301, 0.0217627, 0.983685, 0.128219) bones/57/scale = Vector3(1, 1, 1) bones/58/name = "RightLeg" bones/58/parent = 57 bones/58/rest = Transform3D(0.997811, 0.0392429, -0.0532304, 0.00932048, 0.713425, 0.70067, 0.0654722, -0.699632, 0.711497, 4.84288e-08, 0.405994, 2.6077e-08) bones/58/enabled = true bones/58/position = Vector3(4.84288e-08, 0.405994, 2.6077e-08) -bones/58/rotation = Quaternion(-0.304963, 0.0727443, -0.0195748, 0.94938) +bones/58/rotation = Quaternion(-0.305533, 0.0740593, -0.0194145, 0.949099) bones/58/scale = Vector3(1, 1, 1) bones/59/name = "RightFoot" bones/59/parent = 58 bones/59/rest = Transform3D(0.96994, -0.122934, 0.210008, 0.229929, 0.180407, -0.95634, 0.0796801, 0.975879, 0.20325, -1.02445e-08, 0.42099, 9.31323e-09) bones/59/enabled = true bones/59/position = Vector3(-1.02445e-08, 0.42099, 9.31323e-09) -bones/59/rotation = Quaternion(0.597411, 0.0611909, 0.112887, 0.791588) +bones/59/rotation = Quaternion(0.600156, 0.0606037, 0.112062, 0.789672) bones/59/scale = Vector3(1, 1, 1) bones/60/name = "RightToeBase" bones/60/parent = 59 bones/60/rest = Transform3D(0.999367, 6.43255e-05, 0.0355612, 0.0227211, 0.768109, -0.639916, -0.027356, 0.640319, 0.767622, -5.51563e-09, 0.16432, -1.09159e-07) bones/60/enabled = true bones/60/position = Vector3(-5.51563e-09, 0.16432, -1.09159e-07) -bones/60/rotation = Quaternion(0.354124, 0.0203921, 0.00401378, 0.934968) +bones/60/rotation = Quaternion(0.354069, 0.0197079, 0.00433378, 0.935002) bones/60/scale = Vector3(1, 1, 1) bones/61/name = "RightToe_End" bones/61/parent = 60 @@ -1005,28 +999,28 @@ bones/62/parent = 0 bones/62/rest = Transform3D(-0.893651, 0.403296, 0.196826, -0.227377, -0.785047, 0.576195, 0.386895, 0.470164, 0.793258, 0.0912445, -0.0665636, -0.000553777) bones/62/enabled = true bones/62/position = Vector3(0.0912445, -0.0665636, -0.000553777) -bones/62/rotation = Quaternion(0.0773969, 0.215585, 0.96776, -0.104758) +bones/62/rotation = Quaternion(0.0789736, 0.214813, 0.967576, -0.106845) bones/62/scale = Vector3(1, 1, 1) bones/63/name = "LeftLeg" bones/63/parent = 62 bones/63/rest = Transform3D(0.99576, 0.0029921, 0.0919402, -0.056273, 0.810456, 0.583091, -0.0727688, -0.585792, 0.807188, 5.12227e-08, 0.405994, -2.04891e-08) bones/63/enabled = true bones/63/position = Vector3(5.12227e-08, 0.405994, -2.04891e-08) -bones/63/rotation = Quaternion(-0.311327, 0.120237, -0.0381131, 0.941895) +bones/63/rotation = Quaternion(-0.309692, 0.122215, -0.0393988, 0.942126) bones/63/scale = Vector3(1, 1, 1) bones/64/name = "LeftFoot" bones/64/parent = 63 bones/64/rest = Transform3D(0.977802, 0.128039, -0.165856, -0.209522, 0.59104, -0.778956, -0.00170929, 0.796415, 0.604748, -2.04891e-08, 0.42099, 6.98492e-09) bones/64/enabled = true bones/64/position = Vector3(-2.04891e-08, 0.42099, 6.98492e-09) -bones/64/rotation = Quaternion(0.486588, -0.0221643, -0.0401658, 0.872426) +bones/64/rotation = Quaternion(0.488166, -0.0231252, -0.041949, 0.871435) bones/64/scale = Vector3(1, 1, 1) bones/65/name = "LeftToeBase" bones/65/parent = 64 bones/65/rest = Transform3D(0.999367, -0.000945242, -0.0355486, -0.0227206, 0.752033, -0.658734, 0.0273564, 0.659125, 0.751536, 3.66616e-08, 0.16432, -1.10293e-07) bones/65/enabled = true bones/65/position = Vector3(3.66616e-08, 0.16432, -1.10293e-07) -bones/65/rotation = Quaternion(0.358161, 0.00103521, -0.0287534, 0.933217) +bones/65/rotation = Quaternion(0.360232, -0.00335694, -0.0301846, 0.932369) bones/65/scale = Vector3(1, 1, 1) bones/66/name = "LeftToe_End" bones/66/parent = 65 @@ -1045,7 +1039,7 @@ mesh = ExtResource("6_e2l25") skin = SubResource("Skin_hh536") [node name="BoneAttachment3D" type="BoneAttachment3D" parent="Armature/Skeleton3D"] -transform = Transform3D(0.997899, -0.0624139, 0.0173572, 0.0617342, 0.834955, -0.546844, 0.0196383, 0.546767, 0.837055, -0.0182193, 1.49583, 0.112048) +transform = Transform3D(0.996961, -0.0748005, 0.0217659, 0.0736131, 0.813109, -0.577438, 0.0254948, 0.577286, 0.816144, -0.0269526, 1.49552, 0.112384) bone_name = "Head" bone_idx = 5 diff --git a/AMSG_Examples/Player/Player.tscn b/AMSG_Examples/Player/Player.tscn index 7a863aa..4fc42c0 100644 --- a/AMSG_Examples/Player/Player.tscn +++ b/AMSG_Examples/Player/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=55 format=3 uid="uid://c2l3xxr5mfm6w"] +[gd_scene load_steps=53 format=3 uid="uid://c2l3xxr5mfm6w"] [ext_resource type="PackedScene" uid="uid://cth47yn1duvdh" path="res://AMSG_Examples/Character/mixamo_character.tscn" id="1_ihvpu"] [ext_resource type="PackedScene" uid="uid://bfkejs88xm680" path="res://addons/PoseWarping/MotionWarping.tscn" id="2_0jifq"] @@ -256,10 +256,6 @@ nodes/VelocityDirection/position = Vector2(680, 1400) nodes/output/position = Vector2(1540, 1400) node_connections = [&"output", 0, &"InAir", &"InAir", 0, &"Turn", &"InAir", 1, &"FallAnimation", &"RightOrLeft", 0, &"AnimTurnLeft", &"RightOrLeft", 1, &"AnimTurnRight", &"Turn", 0, &"VelocityDirection", &"Turn", 1, &"RightOrLeft"] -[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_boqww"] - -[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_jbop1"] - [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_jrjkm"] resource_local_to_scene = true radius = 0.375 @@ -275,6 +271,8 @@ networking_path = NodePath("../Networking") OnePressJump = true UsingSprintToggle = false UsingCrouchToggle = true +tilt_power = 0.0 +deacceleration = 5.0 [node name="Networking" parent="." index="3" instance=ExtResource("4_8jv5v")] character_movement_component = NodePath("../CharacterMovementComponent") @@ -283,9 +281,7 @@ character_movement_component = NodePath("../CharacterMovementComponent") tree_root = SubResource("AnimationNodeBlendTree_8li6f") parameters/VelocityDirection/crouch/current_state = "crouch" parameters/VelocityDirection/crouch/current_index = 1 -parameters/VelocityDirection/crouching/playback = SubResource("AnimationNodeStateMachinePlayback_boqww") parameters/VelocityDirection/crouching/conditions/idle = true -parameters/VelocityDirection/standing/playback = SubResource("AnimationNodeStateMachinePlayback_jbop1") parameters/VelocityDirection/standing/Walk/FB/transition_request = "Forward" [node name="CameraComponent" parent="." index="5" node_paths=PackedStringArray("networking")] @@ -295,58 +291,61 @@ networking = NodePath("../Networking") shape = SubResource("CapsuleShape3D_jrjkm") [node name="Skeleton3D" parent="Armature" index="0"] -bones/0/position = Vector3(-0.0073886, 0.508086, 0.0150519) -bones/0/rotation = Quaternion(0.35914, 0.0543174, 0.0330383, 0.931116) -bones/1/rotation = Quaternion(0.00174076, -0.00161735, -0.0118227, 0.999927) -bones/2/rotation = Quaternion(0.124852, 0.00485274, -0.014692, 0.992055) -bones/3/rotation = Quaternion(0.184484, 0.00395224, -0.0149469, 0.982714) -bones/4/rotation = Quaternion(0.0536563, -0.0259913, -0.0140346, 0.998123) -bones/5/rotation = Quaternion(-0.318594, -0.0499611, 0.0698923, 0.94399) -bones/9/rotation = Quaternion(-0.49219, -0.496872, 0.587703, -0.406783) -bones/10/rotation = Quaternion(0.225039, -0.0399484, 0.452724, 0.86186) -bones/11/rotation = Quaternion(0.0138581, 0.0590753, 0.693964, 0.717448) -bones/12/rotation = Quaternion(-0.0761155, 0.493105, -4.52995e-06, 0.866634) -bones/13/rotation = Quaternion(0.0609675, 0.0108525, 0.0102099, 0.998029) -bones/14/rotation = Quaternion(0.306926, -0.0104489, 0.018472, 0.951497) +bones/0/position = Vector3(-0.00718858, 0.507686, 0.0138978) +bones/0/rotation = Quaternion(0.358154, 0.0547587, 0.0320019, 0.931506) +bones/1/rotation = Quaternion(0.00177792, -0.00163806, -0.0116977, 0.999929) +bones/2/rotation = Quaternion(0.124945, 0.00479438, -0.0145328, 0.992046) +bones/3/rotation = Quaternion(0.184577, 0.00390366, -0.0147845, 0.982699) +bones/4/rotation = Quaternion(0.0532745, -0.0254546, -0.0138205, 0.99816) +bones/5/rotation = Quaternion(-0.318424, -0.0494891, 0.0696954, 0.944087) +bones/9/rotation = Quaternion(-0.492441, -0.49667, 0.58773, -0.406687) +bones/10/rotation = Quaternion(0.22437, -0.039966, 0.451887, 0.862472) +bones/11/rotation = Quaternion(0.0138987, 0.0589734, 0.694273, 0.717157) +bones/12/rotation = Quaternion(-0.0759434, 0.4929, 0.000423785, 0.866765) +bones/13/rotation = Quaternion(0.0818771, 0.0118761, 0.00555942, 0.996556) +bones/14/rotation = Quaternion(0.326958, -0.00819374, 0.0147995, 0.944888) bones/15/rotation = Quaternion(4.24916e-09, -1.41561e-07, 7.956e-06, 1) -bones/17/rotation = Quaternion(0.156322, 0.192825, 0.304017, 0.919758) -bones/18/rotation = Quaternion(-0.00679765, -0.0285114, -0.228704, 0.973055) +bones/17/rotation = Quaternion(0.145212, 0.195869, 0.282496, 0.927763) +bones/18/rotation = Quaternion(-0.0110958, -0.0274657, -0.252955, 0.967024) bones/19/rotation = Quaternion(-6.48201e-07, -5.33089e-06, -9.81032e-06, 1) -bones/21/rotation = Quaternion(0.00383715, 0.0515821, 0.0769229, 0.995694) -bones/22/rotation = Quaternion(0.273455, -0.00518909, -0.00265606, 0.961867) +bones/21/rotation = Quaternion(0.0280149, 0.0544311, 0.0703382, 0.995643) +bones/22/rotation = Quaternion(0.297329, -0.00315275, -0.00685511, 0.954745) bones/23/rotation = Quaternion(1.95833e-06, -1.9446e-06, -1.31666e-07, 1) -bones/25/rotation = Quaternion(0.184018, -0.0142491, -0.0900222, 0.978688) -bones/26/rotation = Quaternion(0.348139, 0.0126599, 0.0226637, 0.937083) +bones/25/rotation = Quaternion(0.201606, -0.0145552, -0.0938925, 0.974847) +bones/26/rotation = Quaternion(0.36468, 0.015061, 0.0183553, 0.93083) bones/27/rotation = Quaternion(-1.95432e-08, -1.2666e-07, 3.04816e-06, 1) -bones/29/rotation = Quaternion(0.236701, -0.0930145, -0.253435, 0.933323) -bones/30/rotation = Quaternion(0.392025, 0.0277211, 0.0473655, 0.918316) +bones/29/rotation = Quaternion(0.250853, -0.0955406, -0.255424, 0.928819) +bones/30/rotation = Quaternion(0.405396, 0.0304039, 0.0430507, 0.912621) bones/31/rotation = Quaternion(2.04395e-06, -2.03401e-06, 9.91311e-06, 1) -bones/33/rotation = Quaternion(0.691614, -0.39336, 0.450459, 0.405) -bones/34/rotation = Quaternion(0.121599, 0.30661, -0.301346, 0.894648) -bones/35/rotation = Quaternion(-0.0105162, -0.0716603, -0.462403, 0.883707) -bones/36/rotation = Quaternion(-0.539055, -0.366857, -0.0681615, 0.755109) -bones/37/rotation = Quaternion(0.0245177, 0.00820818, 0.0120588, 0.999593) -bones/38/rotation = Quaternion(0.154743, 0.00628404, -0.00689428, 0.987911) +bones/33/rotation = Quaternion(0.69176, -0.393191, 0.45047, 0.404901) +bones/34/rotation = Quaternion(0.120701, 0.306717, -0.302857, 0.894222) +bones/35/rotation = Quaternion(-0.00951326, -0.0711443, -0.458111, 0.885992) +bones/36/rotation = Quaternion(-0.539769, -0.365214, -0.0696139, 0.755263) +bones/37/rotation = Quaternion(0.0247277, 0.00824293, 0.0120874, 0.999587) +bones/38/rotation = Quaternion(0.154968, 0.00628468, -0.00690999, 0.987875) bones/41/rotation = Quaternion(0.0487009, 0.179896, -0.413302, 0.891318) -bones/42/rotation = Quaternion(-0.0103826, 0.00564599, 0.00104894, 0.99993) +bones/42/rotation = Quaternion(-0.0110725, 0.0065444, 0.00114918, 0.999917) bones/43/rotation = Quaternion(1.80118e-06, 4.59701e-06, 1.02655e-05, 1) -bones/45/rotation = Quaternion(-0.00325863, 0.0142658, -0.0807229, 0.996629) -bones/46/rotation = Quaternion(0.108153, -0.000497155, 0.0134423, 0.994043) +bones/45/rotation = Quaternion(-0.00281987, 0.0143424, -0.0806814, 0.996633) +bones/46/rotation = Quaternion(0.107939, -0.000506058, 0.0134696, 0.994066) bones/47/rotation = Quaternion(-1.90329e-07, -1.93715e-07, 2.66813e-07, 1) -bones/49/rotation = Quaternion(0.0621294, -0.00809799, 0.12043, 0.990743) -bones/50/rotation = Quaternion(0.165547, -0.00392835, -0.0212509, 0.985965) +bones/49/rotation = Quaternion(0.0624719, -0.00813377, 0.120516, 0.99071) +bones/50/rotation = Quaternion(0.165344, -0.00392771, -0.0212296, 0.986) bones/51/rotation = Quaternion(-3.41979e-06, -3.27081e-06, -3.23285e-06, 1) -bones/53/rotation = Quaternion(0.105571, -0.0214539, 0.283638, 0.952861) -bones/54/rotation = Quaternion(0.185146, -0.00585406, -0.0581222, 0.980973) +bones/53/rotation = Quaternion(0.105675, -0.0215042, 0.283872, 0.952779) +bones/54/rotation = Quaternion(0.184405, -0.00576619, -0.0580618, 0.981117) bones/55/rotation = Quaternion(-9.68284e-08, -7.45058e-09, -1.09469e-05, 1) -bones/57/rotation = Quaternion(-0.105085, 0.815674, 0.568373, 0.0241884) -bones/58/rotation = Quaternion(-0.934399, -0.00565059, 0.0145886, 0.355885) -bones/59/rotation = Quaternion(0.688006, -0.00565251, -0.0888748, 0.72022) -bones/60/rotation = Quaternion(0.610372, 0.00492965, -0.00416579, 0.792088) -bones/62/rotation = Quaternion(0.196499, 0.745789, 0.591512, -0.235162) -bones/63/rotation = Quaternion(-0.901819, -0.0264653, 0.0412288, 0.429328) -bones/64/rotation = Quaternion(0.660457, 0.182232, -0.200616, 0.700243) -bones/65/rotation = Quaternion(0.582054, -0.0267573, -0.0152031, 0.812568) +bones/57/rotation = Quaternion(-0.105456, 0.815786, 0.568155, 0.0239155) +bones/58/rotation = Quaternion(-0.934596, -0.00580188, 0.0146347, 0.355362) +bones/59/rotation = Quaternion(0.68707, -0.00567789, -0.0889653, 0.721101) +bones/60/rotation = Quaternion(0.609186, 0.00499425, -0.00411341, 0.793001) +bones/62/rotation = Quaternion(0.196388, 0.746818, 0.589789, -0.23631) +bones/63/rotation = Quaternion(-0.902352, -0.0259672, 0.0405255, 0.428305) +bones/64/rotation = Quaternion(0.659753, 0.18265, -0.199126, 0.701223) +bones/65/rotation = Quaternion(0.582332, -0.026745, -0.0151815, 0.812369) + +[node name="BoneAttachment3D" parent="Armature/Skeleton3D" index="2"] +transform = Transform3D(0.999758, 0.0164503, -0.0145752, -0.0219088, 0.693216, -0.720397, -0.00174698, 0.720542, 0.693409, 0.0370153, 0.788428, 0.514438) [node name="flashlight" parent="Armature" index="1" instance=ExtResource("5_euvsl")] transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1.12407, 0.156779) diff --git a/addons/AMSG/Components/CharacterMovementComponent.gd b/addons/AMSG/Components/CharacterMovementComponent.gd index bb55151..930460e 100644 --- a/addons/AMSG/Components/CharacterMovementComponent.gd +++ b/addons/AMSG/Components/CharacterMovementComponent.gd @@ -397,9 +397,11 @@ func crouch_update(delta): head_bonked = false if stance == Global.stance.crouching: + ground_check.position.y = 0.7 collision_shape_ref.shape.height -= crouch_switch_speed * delta /2 mesh_ref.transform.origin.y += crouch_switch_speed * delta /1.5 elif stance == Global.stance.standing and not head_bonked: + ground_check.position.y = 0.186 collision_shape_ref.shape.height += crouch_switch_speed * delta /2 mesh_ref.transform.origin.y -= crouch_switch_speed * delta /1.5 elif head_bonked: diff --git a/project.godot b/project.godot index 9710934..500afe7 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="AMSG" run/main_scene="res://AMSG_Examples/Maps/MovementTestMap.tscn" -config/features=PackedStringArray("4.0") +config/features=PackedStringArray("4.1") config/icon="res://icon.png" [autoload] @@ -79,7 +79,7 @@ sprint={ } aim={ "deadzone": 0.5, -"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"pressed":false,"double_click":false,"script":null) +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null) ] } crouch={ @@ -114,7 +114,7 @@ EnableSDFGI={ } fire={ "deadzone": 0.5, -"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"pressed":false,"double_click":false,"script":null) +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) ] } exit={