From 3e6e4f3129a3280e68ce2b0be65ac25c211f105e Mon Sep 17 00:00:00 2001 From: Sara Date: Sat, 7 Dec 2024 17:43:57 +0100 Subject: [PATCH] fix: turning animations not working --- godot/models/animations/character_tree.tres | 66 ++++++++++++++++----- godot/objects/character_model_base.tscn | 4 +- godot/objects/enemy.tscn | 3 - 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/godot/models/animations/character_tree.tres b/godot/models/animations/character_tree.tres index 1110ca1..486a741 100644 --- a/godot/models/animations/character_tree.tres +++ b/godot/models/animations/character_tree.tres @@ -1,4 +1,4 @@ -[gd_resource type="AnimationNodeBlendTree" load_steps=39 format=3 uid="uid://c7rxfpfy7vt1b"] +[gd_resource type="AnimationNodeBlendTree" load_steps=44 format=3 uid="uid://c7rxfpfy7vt1b"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ukhqm"] animation = &"Aim" @@ -44,18 +44,31 @@ nodes/Speed/position = Vector2(80, 140) nodes/output/position = Vector2(320, 140) node_connections = [&"Speed", 0, &"Rest", &"Speed", 1, &"Run", &"output", 0, &"Speed"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nur8b"] +animation = &"Stab" + [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_4hmb8"] filter_enabled = true -filters = ["Character/Skeleton3D:Foot.L", "Character/Skeleton3D:Foot.R", "Character/Skeleton3D:IKTarget.Foot.L", "Character/Skeleton3D:IKTarget.Foot.R", "Character/Skeleton3D:Neck", "Character/Skeleton3D:PoleTarget.Foot.L", "Character/Skeleton3D:PoleTarget.Foot.R", "Character/Skeleton3D:hip", "Character/Skeleton3D:lowerleg.L", "Character/Skeleton3D:lowerleg.R", "Character/Skeleton3D:root", "Character/Skeleton3D:spine.003", "Character/Skeleton3D:upperleg.L", "Character/Skeleton3D:upperleg.R"] +filters = ["Character/Skeleton3D:Foot.L", "Character/Skeleton3D:Foot.R", "Character/Skeleton3D:IKTarget.Foot.L", "Character/Skeleton3D:IKTarget.Foot.R", "Character/Skeleton3D:Neck", "Character/Skeleton3D:PoleTarget.Foot.L", "Character/Skeleton3D:PoleTarget.Foot.R", "Character/Skeleton3D:hip", "Character/Skeleton3D:lowerleg.L", "Character/Skeleton3D:lowerleg.R", "Character/Skeleton3D:root", "Character/Skeleton3D:spine.003", "Character/Skeleton3D:upperleg.L", "Character/Skeleton3D:upperleg.R", "skeleton_character/Skeleton3D:Foot.L", "skeleton_character/Skeleton3D:Foot.R", "skeleton_character/Skeleton3D:IKTarget.Foot.L", "skeleton_character/Skeleton3D:IKTarget.Foot.R", "skeleton_character/Skeleton3D:Neck", "skeleton_character/Skeleton3D:PoleTarget.Foot.L", "skeleton_character/Skeleton3D:PoleTarget.Foot.R", "skeleton_character/Skeleton3D:hip", "skeleton_character/Skeleton3D:lowerleg.L", "skeleton_character/Skeleton3D:lowerleg.R", "skeleton_character/Skeleton3D:spine.001", "skeleton_character/Skeleton3D:spine.002", "skeleton_character/Skeleton3D:spine.003", "skeleton_character/Skeleton3D:upperleg.L", "skeleton_character/Skeleton3D:upperleg.R"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5n7ai"] animation = &"RESET" [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_pwhry"] animation = &"Turn_right" +use_custom_timeline = true +timeline_length = 0.75 +stretch_time_scale = true +start_offset = 0.0 +loop_mode = 1 [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_rasdy"] animation = &"Turn_left" +use_custom_timeline = true +timeline_length = 0.75 +stretch_time_scale = true +start_offset = 0.0 +loop_mode = 1 [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_xgea8"] animation = &"RESET" @@ -67,9 +80,13 @@ blend_point_1/node = SubResource("AnimationNodeAnimation_rasdy") blend_point_1/pos = 1.0 blend_point_2/node = SubResource("AnimationNodeAnimation_xgea8") blend_point_2/pos = 0.0 +min_space = -1.5 +max_space = 1.5 +snap = 1.0 +sync = true [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_p0hk7"] -graph_offset = Vector2(-480.5, 90) +graph_offset = Vector2(-643.905, 105.105) nodes/BoneMask/node = SubResource("AnimationNodeBlend2_4hmb8") nodes/BoneMask/position = Vector2(140, 140) nodes/Rest/node = SubResource("AnimationNodeAnimation_5n7ai") @@ -175,25 +192,46 @@ xfade_time = 0.3 advance_mode = 2 advance_expression = "!get_is_running()" +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_g5qf0"] +advance_mode = 2 +advance_expression = "get_stab()" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_27kmb"] +switch_mode = 2 +advance_mode = 2 +advance_expression = "get_is_running() +" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4q0ot"] +advance_mode = 2 +advance_expression = "get_stab()" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_h6ujc"] +priority = 2 +switch_mode = 2 +advance_mode = 2 + [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7smdg"] "states/Aim Down [aim]/node" = SubResource("AnimationNodeAnimation_ukhqm") -"states/Aim Down [aim]/position" = Vector2(666.26, 226.767) +"states/Aim Down [aim]/position" = Vector2(854.525, 226.767) "states/Aim [aim] [turn]/node" = SubResource("AnimationNodeAnimation_nhlru") -"states/Aim [aim] [turn]/position" = Vector2(731.26, 94.3447) +"states/Aim [aim] [turn]/position" = Vector2(919.525, 94.3447) states/End/position = Vector2(195.182, 94.3447) "states/Fire [aim]/node" = SubResource("AnimationNodeAnimation_8rbkq") -"states/Fire [aim]/position" = Vector2(731.26, 14.954) +"states/Fire [aim]/position" = Vector2(919.525, 14.954) "states/RESET To Aim/node" = SubResource("AnimationNodeAnimation_ugv1e") -"states/RESET To Aim/position" = Vector2(566.993, 94.3447) +"states/RESET To Aim/position" = Vector2(755.258, 94.3447) states/Run/node = SubResource("AnimationNodeBlendTree_hmklb") -states/Run/position = Vector2(297.422, 226.767) -states/Start/position = Vector2(383.995, 14.954) +states/Run/position = Vector2(485.687, 226.767) +states/Stab/node = SubResource("AnimationNodeAnimation_nur8b") +states/Stab/position = Vector2(361.447, 94.3447) +states/Start/position = Vector2(572.26, 14.954) "states/Stationary [turn]/node" = SubResource("AnimationNodeBlendTree_p0hk7") -"states/Stationary [turn]/position" = Vector2(383.995, 94.3447) +"states/Stationary [turn]/position" = Vector2(572.26, 94.3447) "states/Walk [turn]/node" = SubResource("AnimationNodeBlendTree_2mbyh") -"states/Walk [turn]/position" = Vector2(477.995, 226.767) -transitions = ["Aim [aim] [turn]", "Aim Down [aim]", SubResource("AnimationNodeStateMachineTransition_4lybd"), "Aim Down [aim]", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_5aafd"), "Aim [aim] [turn]", "Fire [aim]", SubResource("AnimationNodeStateMachineTransition_8f4gl"), "Fire [aim]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_xnat3"), "Walk [turn]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_12bos"), "Aim Down [aim]", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_n0ndr"), "Walk [turn]", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_0wc5e"), "Stationary [turn]", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_4hisb"), "Start", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_bmty6"), "Stationary [turn]", "RESET To Aim", SubResource("AnimationNodeStateMachineTransition_kyd6p"), "RESET To Aim", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_w5kob"), "Stationary [turn]", "Run", SubResource("AnimationNodeStateMachineTransition_g0i3x"), "Walk [turn]", "Run", SubResource("AnimationNodeStateMachineTransition_ocffv"), "Run", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_h0my5"), "Run", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_nymcr")] -graph_offset = Vector2(-60.578, -14.155) +"states/Walk [turn]/position" = Vector2(666.26, 226.767) +transitions = ["Aim [aim] [turn]", "Aim Down [aim]", SubResource("AnimationNodeStateMachineTransition_4lybd"), "Aim Down [aim]", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_5aafd"), "Aim [aim] [turn]", "Fire [aim]", SubResource("AnimationNodeStateMachineTransition_8f4gl"), "Fire [aim]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_xnat3"), "Walk [turn]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_12bos"), "Aim Down [aim]", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_n0ndr"), "Walk [turn]", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_0wc5e"), "Stationary [turn]", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_4hisb"), "Start", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_bmty6"), "Stationary [turn]", "RESET To Aim", SubResource("AnimationNodeStateMachineTransition_kyd6p"), "RESET To Aim", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_w5kob"), "Stationary [turn]", "Run", SubResource("AnimationNodeStateMachineTransition_g0i3x"), "Walk [turn]", "Run", SubResource("AnimationNodeStateMachineTransition_ocffv"), "Run", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_h0my5"), "Run", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_nymcr"), "Run", "Stab", SubResource("AnimationNodeStateMachineTransition_g5qf0"), "Stab", "Run", SubResource("AnimationNodeStateMachineTransition_27kmb"), "Stationary [turn]", "Stab", SubResource("AnimationNodeStateMachineTransition_4q0ot"), "Stab", "Stationary [turn]", SubResource("AnimationNodeStateMachineTransition_h6ujc")] +graph_offset = Vector2(-462.578, -0.154999) [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_au62i"] animation = &"Fall_die" @@ -203,7 +241,7 @@ animation = &"Fall_die" [sub_resource type="AnimationNodeTimeSeek" id="AnimationNodeTimeSeek_p56ym"] [resource] -graph_offset = Vector2(-456.05, 79.5434) +graph_offset = Vector2(-363, 102.5) nodes/Actions/node = SubResource("AnimationNodeStateMachine_7smdg") nodes/Actions/position = Vector2(0, 140) nodes/Death/node = SubResource("AnimationNodeAnimation_au62i") diff --git a/godot/objects/character_model_base.tscn b/godot/objects/character_model_base.tscn index 2b57166..efbbb57 100644 --- a/godot/objects/character_model_base.tscn +++ b/godot/objects/character_model_base.tscn @@ -120,8 +120,8 @@ root_motion_track = NodePath("skeleton_character/Skeleton3D:root") tree_root = ExtResource("2_wdyfc") anim_player = NodePath("../AnimationPlayer") parameters/Actions/Run/Speed/blend_amount = 0 -"parameters/Actions/Stationary [turn]/BoneMask/blend_amount" = 0 -"parameters/Actions/Stationary [turn]/Turn/blend_position" = null +"parameters/Actions/Stationary [turn]/BoneMask/blend_amount" = 1.0 +"parameters/Actions/Stationary [turn]/Turn/blend_position" = 0.0 "parameters/Actions/Walk [turn]/Speed/blend_amount" = 0 parameters/DeathBlend/blend_amount = 0 parameters/DeathSeek/seek_request = -1.0 diff --git a/godot/objects/enemy.tscn b/godot/objects/enemy.tscn index 46429df..58d10fe 100644 --- a/godot/objects/enemy.tscn +++ b/godot/objects/enemy.tscn @@ -74,9 +74,6 @@ bones/61/rotation = Quaternion(-0.707107, 1.25097e-07, 1.25097e-07, 0.707107) bones/62/rotation = Quaternion(-0.707107, 1.5189e-07, 1.5189e-07, 0.707107) bones/63/rotation = Quaternion(-0.707107, 1.5189e-07, 1.5189e-07, 0.707107) -[node name="BoneAttachment3D" parent="CharacterModel/skeleton_character/Skeleton3D" index="3"] -transform = Transform3D(-0.937186, 0.347435, 0.0311762, 0.0973187, 0.17459, 0.97982, 0.33498, 0.921308, -0.197435, -0.16719, 1.02003, 0.0528419) - [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) shape = SubResource("CapsuleShape3D_3tduq")