From: Clifton Palmer Date: Thu, 21 Nov 2024 14:18:21 +0000 (+0200) Subject: Added head tilting, spike X-Git-Url: http://git.purplebirdman.com/knight.git/commitdiff_plain/1efa5ed501ee461f6c151651e6c41aab48215f15?ds=inline Added head tilting, spike --- diff --git a/player/player.gd b/player/player.gd index eae307e..6099c08 100644 --- a/player/player.gd +++ b/player/player.gd @@ -3,10 +3,9 @@ class_name Player extends CharacterBody3D # class variables @export_category("Movement") -@export var _walk_speed := 5.0 +@export var _walk_speed := 4.0 @export var _jump_speed := 9.0 @export var _fall_speed := 2.0 -@export var _locked_z := true @export_category("Camera") @export var _camera_distance := 5.0 @@ -34,7 +33,16 @@ func _input(event: InputEvent) -> void: if velocity.y > 0: velocity.y = 0 elif event.is_action_pressed("player-attack"): - _skin.attack() + if Input.is_action_pressed("player-up"): + _skin.attack_up() + _last_movement_direction = Vector3.FORWARD + elif Input.is_action_pressed("player-down") and not is_on_floor(): + _skin.attack_down() + _last_movement_direction = Vector3.FORWARD + else: + _skin.attack_neutral() + elif event.is_action_pressed("player-up"): + _last_movement_direction = Vector3.FORWARD func _physics_process(delta: float) -> void: @@ -57,21 +65,19 @@ func _process_player_input(_delta: float) -> void: # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. var input_dir := Input.get_vector("player-left", "player-right", "player-up", "player-down") - var direction := -(transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() + var direction := -(transform.basis * Vector3(input_dir.x, input_dir.y, 0)).normalized() - if direction: + _skin.head_tilt(direction.y) + + if direction.x: velocity.x = direction.x * _walk_speed - if not _locked_z: - velocity.z = direction.z * _walk_speed _last_movement_direction = direction else: velocity.x = 0 - velocity.z = 0 func _process_player_skin(_delta: float) -> void: - _skin.global_rotation.y = Vector3.BACK.signed_angle_to(_last_movement_direction, Vector3.UP) - + _skin.global_rotation.y = Vector3.BACK.signed_angle_to(_last_movement_direction - Vector3.BACK, Vector3.UP) if is_on_floor(): _skin.move(velocity.length()) else: diff --git a/player/player.tscn b/player/player.tscn index a71acd8..2589c61 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -28,7 +28,7 @@ transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) [node name="camera-pivot" type="Node3D" parent="."] [node name="SpringArm3D" type="SpringArm3D" parent="camera-pivot"] -transform = Transform3D(-1, 1.56557e-08, -1.45851e-07, -2.26267e-08, 0.965926, 0.258819, 1.44933e-07, 0.258819, -0.965926, 0, 0.443057, 0) +transform = Transform3D(-1, -1.51808e-08, 8.60946e-08, 0, 0.984808, 0.173648, -8.74228e-08, 0.173648, -0.984808, 0, 0.443057, 0) spring_length = 5.0 [node name="Camera3D" type="Camera3D" parent="camera-pivot/SpringArm3D"] diff --git a/skin/the-knight.glb b/skin/the-knight.glb index 52de9ef..604dc79 100644 Binary files a/skin/the-knight.glb and b/skin/the-knight.glb differ diff --git a/skin/the-knight.tscn b/skin/the-knight.tscn index 69bbcdb..d6469c2 100644 --- a/skin/the-knight.tscn +++ b/skin/the-knight.tscn @@ -1,18 +1,57 @@ -[gd_scene load_steps=13 format=3 uid="uid://bgmpst4q8lyw2"] +[gd_scene load_steps=24 format=3 uid="uid://bgmpst4q8lyw2"] [ext_resource type="PackedScene" uid="uid://dd5nled5di42i" path="res://skin/the-knight.glb" id="1_mro73"] [ext_resource type="Script" path="res://skin/the_knight.gd" id="2_ofwyo"] -[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_kfgya"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_jdlj7"] +animation = &"attack-up" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_hyksa"] +animation = &"attack-down" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a0atl"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_esiy6"] animation = &"attack-default" +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_tvrip"] + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_03ov8"] + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_kfgya"] + +[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_srd5n"] +filter_enabled = true +filters = ["", "rig/Skeleton3D:DEF-forearm.L", "rig/Skeleton3D:DEF-forearm.L.001", "rig/Skeleton3D:DEF-forearm.R", "rig/Skeleton3D:DEF-forearm.R.001", "rig/Skeleton3D:DEF-hand.L", "rig/Skeleton3D:DEF-hand.R", "rig/Skeleton3D:DEF-shoulder.L", "rig/Skeleton3D:DEF-shoulder.R", "rig/Skeleton3D:DEF-spine", "rig/Skeleton3D:DEF-spine.002", "rig/Skeleton3D:DEF-spine.003", "rig/Skeleton3D:DEF-spine.004", "rig/Skeleton3D:DEF-spine.005", "rig/Skeleton3D:DEF-spine.006", "rig/Skeleton3D:DEF-upper_arm.L", "rig/Skeleton3D:DEF-upper_arm.L.001", "rig/Skeleton3D:DEF-upper_arm.R", "rig/Skeleton3D:DEF-upper_arm.R.001", "rig/Skeleton3D:cloak.001", "rig/Skeleton3D:cloak.002", "rig/Skeleton3D:cloak.003", "rig/Skeleton3D:cloak.004", "rig/Skeleton3D:cloak.005", "rig/Skeleton3D:cloak.006", "rig/Skeleton3D:cloak.007", "rig/Skeleton3D:cloak.009", "rig/Skeleton3D:cloak.010", "rig/Skeleton3D:cloak.011", "rig/Skeleton3D:cloak.013", "rig/Skeleton3D:cloak_2", "rig/Skeleton3D:nail-back_2", "rig/Skeleton3D:nail-hand.L"] + [sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_a6lqo"] filter_enabled = true -filters = ["", "base/rig/Skeleton3D:DEF-forearm.L", "base/rig/Skeleton3D:DEF-forearm.L.001", "base/rig/Skeleton3D:DEF-forearm.R", "base/rig/Skeleton3D:DEF-forearm.R.001", "base/rig/Skeleton3D:DEF-hand.L", "base/rig/Skeleton3D:DEF-hand.R", "base/rig/Skeleton3D:DEF-shoulder.L", "base/rig/Skeleton3D:DEF-shoulder.R", "base/rig/Skeleton3D:DEF-spine", "base/rig/Skeleton3D:DEF-spine.002", "base/rig/Skeleton3D:DEF-spine.003", "base/rig/Skeleton3D:DEF-spine.004", "base/rig/Skeleton3D:DEF-spine.005", "base/rig/Skeleton3D:DEF-spine.006", "base/rig/Skeleton3D:DEF-upper_arm.L", "base/rig/Skeleton3D:DEF-upper_arm.L.001", "base/rig/Skeleton3D:DEF-upper_arm.R", "base/rig/Skeleton3D:DEF-upper_arm.R.001", "base/rig/Skeleton3D:nail-back", "base/rig/Skeleton3D:nail-hand.L", "rig/Skeleton3D:DEF-forearm.L", "rig/Skeleton3D:DEF-forearm.L.001", "rig/Skeleton3D:DEF-forearm.R", "rig/Skeleton3D:DEF-forearm.R.001", "rig/Skeleton3D:DEF-hand.L", "rig/Skeleton3D:DEF-hand.R", "rig/Skeleton3D:DEF-shoulder.L", "rig/Skeleton3D:DEF-shoulder.R", "rig/Skeleton3D:DEF-spine", "rig/Skeleton3D:DEF-spine.002", "rig/Skeleton3D:DEF-spine.003", "rig/Skeleton3D:DEF-spine.004", "rig/Skeleton3D:DEF-spine.005", "rig/Skeleton3D:DEF-spine.006", "rig/Skeleton3D:DEF-upper_arm.L", "rig/Skeleton3D:DEF-upper_arm.L.001", "rig/Skeleton3D:DEF-upper_arm.R", "rig/Skeleton3D:DEF-upper_arm.R.001", "rig/Skeleton3D:nail-back_2", "rig/Skeleton3D:nail-hand.L"] +filters = ["", "base/rig/Skeleton3D:DEF-forearm.L", "base/rig/Skeleton3D:DEF-forearm.L.001", "base/rig/Skeleton3D:DEF-forearm.R", "base/rig/Skeleton3D:DEF-forearm.R.001", "base/rig/Skeleton3D:DEF-hand.L", "base/rig/Skeleton3D:DEF-hand.R", "base/rig/Skeleton3D:DEF-shoulder.L", "base/rig/Skeleton3D:DEF-shoulder.R", "base/rig/Skeleton3D:DEF-spine", "base/rig/Skeleton3D:DEF-spine.002", "base/rig/Skeleton3D:DEF-spine.003", "base/rig/Skeleton3D:DEF-spine.004", "base/rig/Skeleton3D:DEF-spine.005", "base/rig/Skeleton3D:DEF-spine.006", "base/rig/Skeleton3D:DEF-upper_arm.L", "base/rig/Skeleton3D:DEF-upper_arm.L.001", "base/rig/Skeleton3D:DEF-upper_arm.R", "base/rig/Skeleton3D:DEF-upper_arm.R.001", "base/rig/Skeleton3D:nail-back", "base/rig/Skeleton3D:nail-hand.L", "rig/Skeleton3D:DEF-foot.L", "rig/Skeleton3D:DEF-foot.R", "rig/Skeleton3D:DEF-forearm.L", "rig/Skeleton3D:DEF-forearm.L.001", "rig/Skeleton3D:DEF-forearm.R", "rig/Skeleton3D:DEF-forearm.R.001", "rig/Skeleton3D:DEF-hand.L", "rig/Skeleton3D:DEF-hand.R", "rig/Skeleton3D:DEF-shin.L", "rig/Skeleton3D:DEF-shin.L.001", "rig/Skeleton3D:DEF-shin.R", "rig/Skeleton3D:DEF-shin.R.001", "rig/Skeleton3D:DEF-shoulder.L", "rig/Skeleton3D:DEF-shoulder.R", "rig/Skeleton3D:DEF-spine", "rig/Skeleton3D:DEF-spine.002", "rig/Skeleton3D:DEF-spine.003", "rig/Skeleton3D:DEF-spine.004", "rig/Skeleton3D:DEF-spine.005", "rig/Skeleton3D:DEF-spine.006", "rig/Skeleton3D:DEF-thigh.L.001", "rig/Skeleton3D:DEF-thigh.R.001", "rig/Skeleton3D:DEF-toe.L", "rig/Skeleton3D:DEF-toe.R", "rig/Skeleton3D:DEF-upper_arm.L", "rig/Skeleton3D:DEF-upper_arm.L.001", "rig/Skeleton3D:DEF-upper_arm.R", "rig/Skeleton3D:DEF-upper_arm.R.001", "rig/Skeleton3D:cloak.001", "rig/Skeleton3D:cloak.002", "rig/Skeleton3D:cloak.003", "rig/Skeleton3D:cloak.004", "rig/Skeleton3D:cloak.005", "rig/Skeleton3D:cloak.006", "rig/Skeleton3D:cloak.007", "rig/Skeleton3D:cloak.009", "rig/Skeleton3D:cloak.010", "rig/Skeleton3D:cloak.011", "rig/Skeleton3D:cloak.013", "rig/Skeleton3D:cloak_2", "rig/Skeleton3D:nail-back_2", "rig/Skeleton3D:nail-hand.L"] sync = true +[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_hfs71"] +filter_enabled = true +filters = ["rig/Skeleton3D:DEF-shoulder.L", "rig/Skeleton3D:DEF-shoulder.R", "rig/Skeleton3D:DEF-spine", "rig/Skeleton3D:DEF-upper_arm.L", "rig/Skeleton3D:DEF-upper_arm.R", "rig/Skeleton3D:cloak.001", "rig/Skeleton3D:cloak.002", "rig/Skeleton3D:cloak.003", "rig/Skeleton3D:cloak.004", "rig/Skeleton3D:cloak_2", "rig/Skeleton3D:nail-back_2", "rig/Skeleton3D:nail-hand.L"] + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_g2j73"] +animation = &"look-down" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_80tpu"] +animation = &"look-up" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6mf7v"] +animation = &"idle-default" + +[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_mxos3"] +blend_point_0/node = SubResource("AnimationNodeAnimation_g2j73") +blend_point_0/pos = -1.0 +blend_point_1/node = SubResource("AnimationNodeAnimation_80tpu") +blend_point_1/pos = 1.0 +blend_point_2/node = SubResource("AnimationNodeAnimation_6mf7v") +blend_point_2/pos = 0.0 + +[sub_resource type="AnimationNodeAdd2" id="AnimationNodeAdd2_gc1yp"] +filter_enabled = true +filters = ["rig/Skeleton3D:DEF-spine.006"] + [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_pbq7e"] animation = &"move-jump" @@ -48,21 +87,37 @@ input_1/break_loop_at_end = false input_1/reset = true [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_xdiqd"] -graph_offset = Vector2(-595.2, -44.16) +graph_offset = Vector2(-451.672, -113.495) +nodes/Animation/node = SubResource("AnimationNodeAnimation_esiy6") +nodes/Animation/position = Vector2(-30, 330) +"nodes/Animation 2/node" = SubResource("AnimationNodeAnimation_jdlj7") +"nodes/Animation 2/position" = Vector2(480, 300) +"nodes/Animation 3/node" = SubResource("AnimationNodeAnimation_hyksa") +"nodes/Animation 3/position" = Vector2(970, 290) nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_kfgya") -nodes/TimeScale/position = Vector2(80, 300) -nodes/attack/node = SubResource("AnimationNodeOneShot_a6lqo") -nodes/attack/position = Vector2(300, 120) -"nodes/attack 2/node" = SubResource("AnimationNodeAnimation_a0atl") -"nodes/attack 2/position" = Vector2(-160, 390) +nodes/TimeScale/position = Vector2(150, 230) +"nodes/TimeScale 2/node" = SubResource("AnimationNodeTimeScale_tvrip") +"nodes/TimeScale 2/position" = Vector2(620, 220) +"nodes/TimeScale 3/node" = SubResource("AnimationNodeTimeScale_03ov8") +"nodes/TimeScale 3/position" = Vector2(1120, 220) +nodes/attack-down/node = SubResource("AnimationNodeOneShot_srd5n") +nodes/attack-down/position = Vector2(1270, 90) +nodes/attack-neutral/node = SubResource("AnimationNodeOneShot_a6lqo") +nodes/attack-neutral/position = Vector2(300, 120) +nodes/attack-up/node = SubResource("AnimationNodeOneShot_hfs71") +nodes/attack-up/position = Vector2(760, 100) +nodes/head-tilt/node = SubResource("AnimationNodeAdd2_gc1yp") +nodes/head-tilt/position = Vector2(1830, 70) +nodes/head-tilt-blend/node = SubResource("AnimationNodeBlendSpace1D_mxos3") +nodes/head-tilt-blend/position = Vector2(1630, 190) nodes/jump/node = SubResource("AnimationNodeAnimation_pbq7e") nodes/jump/position = Vector2(-540, 240) nodes/move/node = SubResource("AnimationNodeBlendSpace1D_446cp") nodes/move/position = Vector2(-556.457, 77.4483) nodes/movement/node = SubResource("AnimationNodeTransition_87yve") nodes/movement/position = Vector2(-250, 150) -nodes/output/position = Vector2(670, 140) -node_connections = [&"TimeScale", 0, &"attack 2", &"attack", 0, &"movement", &"attack", 1, &"TimeScale", &"movement", 0, &"move", &"movement", 1, &"jump", &"output", 0, &"attack"] +nodes/output/position = Vector2(2180, 100) +node_connections = [&"TimeScale", 0, &"Animation", &"TimeScale 2", 0, &"Animation 2", &"TimeScale 3", 0, &"Animation 3", &"attack-down", 0, &"attack-up", &"attack-down", 1, &"TimeScale 3", &"attack-neutral", 0, &"movement", &"attack-neutral", 1, &"TimeScale", &"attack-up", 0, &"attack-neutral", &"attack-up", 1, &"TimeScale 2", &"head-tilt", 0, &"attack-down", &"head-tilt", 1, &"head-tilt-blend", &"movement", 0, &"move", &"movement", 1, &"jump", &"output", 0, &"head-tilt"] [node name="the-knight" instance=ExtResource("1_mro73")] script = ExtResource("2_ofwyo") @@ -106,41 +161,79 @@ bones/20/rotation = Quaternion(-0.547448, 1.07996e-07, 2.47164e-07, 0.83684) bones/20/scale = Vector3(1, 1, 1) bones/21/rotation = Quaternion(5.94909e-08, 0.961249, -0.275682, -1.41077e-07) bones/21/scale = Vector3(1, 1, 1) -bones/22/position = Vector3(0.01098, 0.550924, 0.04104) -bones/22/rotation = Quaternion(-0.613952, -0.35093, -0.351142, 0.613685) +bones/22/position = Vector3(0.122984, 0.667899, 1.17347e-07) +bones/22/rotation = Quaternion(0.0017526, -0.00738215, 0.972817, -0.231451) bones/22/scale = Vector3(1, 1, 1) -bones/23/position = Vector3(0.11718, 0.540641, 0.0188245) -bones/23/rotation = Quaternion(-0.211191, 0.421882, -0.86264, 0.182391) -bones/23/scale = Vector3(1.01221, 0.976015, 1.01221) -bones/24/rotation = Quaternion(-3.93055e-08, 0.104437, -1.89924e-09, 0.994531) -bones/25/rotation = Quaternion(0.798642, 0.105596, -0.144409, 0.574601) -bones/25/scale = Vector3(1.00226, 0.963548, 1.03574) -bones/26/rotation = Quaternion(2.12587e-07, 0.017527, -7.76764e-08, 0.999846) -bones/27/rotation = Quaternion(-0.407427, 0.0163799, -0.0242184, 0.91277) -bones/27/scale = Vector3(0.985859, 1.00528, 1.00995) -bones/28/position = Vector3(-0.01098, 0.550924, 0.04104) -bones/28/rotation = Quaternion(-0.613952, 0.35093, 0.351142, 0.613685) +bones/23/rotation = Quaternion(0.00755278, 0.000727542, -0.0959379, 0.995358) +bones/23/scale = Vector3(1, 1, 1) +bones/24/rotation = Quaternion(0.00647108, -0.000979749, -0.149803, 0.988694) +bones/25/position = Vector3(1.04308e-07, 0.667899, -0.122984) +bones/25/rotation = Quaternion(0.0126968, -0.19788, 0.980141, -0.00256319) +bones/25/scale = Vector3(1, 1, 0.999999) +bones/26/rotation = Quaternion(0.0877339, -1.43731e-07, -0.00227344, 0.996141) +bones/27/rotation = Quaternion(0.0780329, 9.84531e-09, -0.00202204, 0.996949) +bones/28/position = Vector3(-0.122984, 0.667899, -7.26432e-08) +bones/28/rotation = Quaternion(0.023447, -0.0133747, 0.972536, 0.231182) bones/28/scale = Vector3(1, 1, 1) -bones/29/position = Vector3(-0.11718, 0.540641, 0.0188245) -bones/29/rotation = Quaternion(-0.211191, -0.421882, 0.86264, 0.182391) -bones/29/scale = Vector3(1.01221, 0.976015, 1.01221) -bones/30/rotation = Quaternion(-1.21486e-08, -0.104437, -2.05754e-08, 0.994532) -bones/31/rotation = Quaternion(0.798642, -0.105596, 0.144409, 0.574601) -bones/31/scale = Vector3(1.00226, 0.963548, 1.03574) -bones/32/rotation = Quaternion(2.2423e-07, -0.017527, 8.04709e-08, 0.999846) -bones/33/rotation = Quaternion(-0.407427, -0.0163799, 0.0242184, 0.91277) -bones/33/scale = Vector3(0.98586, 1.00528, 1.00995) -bones/34/position = Vector3(0.115146, 0.381299, 0.00532452) -bones/34/rotation = Quaternion(-0.0012814, 0.0528379, 0.998309, -0.0242099) -bones/34/scale = Vector3(0.00802934, 0.00802934, 0.00802934) +bones/29/rotation = Quaternion(0.0125112, -0.000727889, 0.0954179, 0.995358) +bones/30/rotation = Quaternion(0.0142205, 0.000980133, 0.149267, 0.988694) +bones/31/position = Vector3(-0.0519755, 0.667899, 0.111462) +bones/31/rotation = Quaternion(0.036789, 0.243557, 0.95557, 0.161902) +bones/31/scale = Vector3(1, 1, 1) +bones/32/rotation = Quaternion(-0.129837, 0.00423085, 0.105692, 0.985877) +bones/33/rotation = Quaternion(-0.0589852, -0.00234363, 0.0701491, 0.995788) +bones/33/scale = Vector3(1, 1, 1) +bones/34/position = Vector3(0.0519753, 0.667899, 0.111462) +bones/34/rotation = Quaternion(0.0444899, 0.256426, 0.955242, -0.140635) +bones/34/scale = Vector3(1, 1, 1) +bones/35/rotation = Quaternion(-0.14585, -0.00423082, -0.0821965, 0.985877) +bones/36/rotation = Quaternion(-0.0700054, 0.00234392, -0.0591557, 0.995788) +bones/36/scale = Vector3(1, 1, 1) +bones/37/position = Vector3(0.01098, 0.550924, 0.04104) +bones/37/rotation = Quaternion(-0.613952, -0.35093, -0.351142, 0.613685) +bones/37/scale = Vector3(1, 1, 1) +bones/38/position = Vector3(0.11718, 0.540641, 0.0188245) +bones/38/rotation = Quaternion(-0.211191, 0.421882, -0.86264, 0.182391) +bones/38/scale = Vector3(1.01221, 0.976015, 1.01221) +bones/39/rotation = Quaternion(-3.93055e-08, 0.104437, -1.89924e-09, 0.994531) +bones/40/rotation = Quaternion(0.798642, 0.105596, -0.144409, 0.574601) +bones/40/scale = Vector3(1.00226, 0.963548, 1.03574) +bones/41/rotation = Quaternion(2.12587e-07, 0.017527, -7.76764e-08, 0.999846) +bones/42/rotation = Quaternion(-0.407427, 0.0163799, -0.0242184, 0.91277) +bones/42/scale = Vector3(0.985859, 1.00528, 1.00995) +bones/43/position = Vector3(-0.01098, 0.550924, 0.04104) +bones/43/rotation = Quaternion(-0.613952, 0.35093, 0.351142, 0.613685) +bones/43/scale = Vector3(1, 1, 1) +bones/44/position = Vector3(-0.11718, 0.540641, 0.0188245) +bones/44/rotation = Quaternion(-0.211191, -0.421882, 0.86264, 0.182391) +bones/44/scale = Vector3(1.01221, 0.976015, 1.01221) +bones/45/rotation = Quaternion(-1.21486e-08, -0.104437, -2.05754e-08, 0.994532) +bones/46/rotation = Quaternion(0.798642, -0.105596, 0.144409, 0.574601) +bones/46/scale = Vector3(1.00226, 0.963548, 1.03574) +bones/47/rotation = Quaternion(2.2423e-07, -0.017527, 8.04709e-08, 0.999846) +bones/48/rotation = Quaternion(-0.407427, -0.0163799, 0.0242184, 0.91277) +bones/48/scale = Vector3(0.98586, 1.00528, 1.00995) +bones/49/position = Vector3(0.115146, 0.381299, 0.00532452) +bones/49/rotation = Quaternion(-0.0012814, 0.0528379, 0.998309, -0.0242099) +bones/49/scale = Vector3(0.00802934, 0.00802934, 0.00802934) [node name="AnimationTree" type="AnimationTree" parent="." index="2"] tree_root = SubResource("AnimationNodeBlendTree_xdiqd") anim_player = NodePath("../AnimationPlayer") -parameters/TimeScale/scale = 4.0 -parameters/attack/active = false -parameters/attack/internal_active = false -parameters/attack/request = 0 +parameters/TimeScale/scale = 8.0 +"parameters/TimeScale 2/scale" = 8.0 +"parameters/TimeScale 3/scale" = 8.0 +parameters/attack-down/active = false +parameters/attack-down/internal_active = false +parameters/attack-down/request = 0 +parameters/attack-neutral/active = false +parameters/attack-neutral/internal_active = false +parameters/attack-neutral/request = 0 +parameters/attack-up/active = false +parameters/attack-up/internal_active = false +parameters/attack-up/request = 0 +parameters/head-tilt/add_amount = 1.0 +parameters/head-tilt-blend/blend_position = 0.0 parameters/move/blend_position = 0.0 parameters/movement/current_state = "move" parameters/movement/transition_request = "" diff --git a/skin/the_knight.gd b/skin/the_knight.gd index feacc9d..992fb92 100644 --- a/skin/the_knight.gd +++ b/skin/the_knight.gd @@ -17,5 +17,17 @@ func fall() -> void: animation_tree.set("parameters/movement/transition_request", "jump") -func attack() -> void: - animation_tree.set("parameters/attack/request", 1) +func attack_neutral() -> void: + animation_tree.set("parameters/attack-neutral/request", 1) + + +func attack_up() -> void: + animation_tree.set("parameters/attack-up/request", 1) + + +func attack_down() -> void: + animation_tree.set("parameters/attack-down/request", 1) + + +func head_tilt(tilt: float) -> void: + animation_tree.set("parameters/head-tilt-blend/blend_position", tilt) diff --git a/test/spike.tscn b/test/spike.tscn new file mode 100644 index 0000000..eac1b9b --- /dev/null +++ b/test/spike.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=4 format=3 uid="uid://d1hxmwkg3onoh"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_i6kmv"] +albedo_color = Color(0.29, 0.29, 0.29, 1) +metallic = 1.0 + +[sub_resource type="PrismMesh" id="PrismMesh_dhulp"] +material = SubResource("StandardMaterial3D_i6kmv") +size = Vector3(0.191, 1, 1) + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_ynl1o"] +data = PackedVector3Array(0, 0.5, 0.5, 0.0955, -0.5, 0.5, -0.0955, -0.5, 0.5, 0, 0.5, -0.5, -0.0955, -0.5, -0.5, 0.0955, -0.5, -0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0.0955, -0.5, 0.5, 0, 0.5, -0.5, 0.0955, -0.5, -0.5, 0.0955, -0.5, 0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, -0.0955, -0.5, -0.5, 0, 0.5, 0.5, -0.0955, -0.5, 0.5, -0.0955, -0.5, -0.5, -0.0955, -0.5, 0.5, 0.0955, -0.5, 0.5, -0.0955, -0.5, -0.5, 0.0955, -0.5, 0.5, 0.0955, -0.5, -0.5, -0.0955, -0.5, -0.5) + +[node name="Spike" type="Node3D"] + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.467283, 0) +mesh = SubResource("PrismMesh_dhulp") + +[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"] +shape = SubResource("ConcavePolygonShape3D_ynl1o") diff --git a/test/test.tscn b/test/test.tscn index b5d8aa8..776d67a 100644 --- a/test/test.tscn +++ b/test/test.tscn @@ -41,7 +41,6 @@ light_color = Color(0.968627, 1, 0.913725, 1) shadow_enabled = true [node name="Player" parent="." instance=ExtResource("1_ytdba")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.806743, 1.19209e-07, 0.147649) [node name="map" type="Node3D" parent="."] @@ -61,14 +60,50 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.30582, 0, 0.134318) [node name="Block2" parent="map" instance=ExtResource("2_8u8xb")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.94243, 1.91616, 0.268636) +[node name="Block8" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.27066, 3.80975, 0.268636) + +[node name="Block9" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.126355, 3.80975, 0.268636) + [node name="Block3" parent="map" instance=ExtResource("2_8u8xb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.315662, -4.76837e-07, -3.10105) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.315662, -0.336864, -3.10105) [node name="Block4" parent="map" instance=ExtResource("2_8u8xb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.899326, 0, -2.69083) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.899326, -0.296218, -2.69083) [node name="Block5" parent="map" instance=ExtResource("2_8u8xb")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.8697, 0, 3.31299) [node name="Block6" parent="map" instance=ExtResource("2_8u8xb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.79621, 4.76837e-07, 3.0765) +transform = Transform3D(0.963985, -4.58956e-08, 1.20097, 0.840186, 1.1004, -0.674393, -0.858149, 1.07737, 0.688812, 1.79621, 4.76837e-07, 2.44774) + +[node name="Block10" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(-1.12697, 1.0177, 0.256559, 0.840186, 1.1004, -0.674393, -0.628994, -0.353546, -1.3605, 0.26934, 4.76837e-07, 2.44774) + +[node name="Block11" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(-1.97474, 0.396604, -1.81307, 1.47851, 1.93642, -1.18676, 1.12184, -1.85394, -1.62742, -1.54759, 4.76837e-07, 4.88015) + +[node name="Block12" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(0.126059, -1.48386, -2.26415, 1.47851, 1.93642, -1.18676, 2.26765, -1.18006, 0.899631, 4.62201, 4.76837e-07, 4.88015) + +[node name="Block13" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(5.05779, -3.47782, 0.626465, 3.3662, 4.40875, -2.70195, 1.07536, 2.55668, 5.51143, 4.62201, 4.76837e-07, 13.0351) + +[node name="Block17" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(5.17073, -2.89113, 1.72447, 3.3662, 4.40875, -2.70195, 0.0338593, 3.20519, 5.27205, 8.94593, 4.76837e-07, 15.5634) + +[node name="Block18" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(-2.27808, 4.15875, 3.94766, 3.3662, 4.40875, -2.70195, -4.64198, 1.15613, -3.8967, -1.4144, 4.76837e-07, 15.5634) + +[node name="Block14" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(-2.28035, 4.15931, 3.94576, 3.3662, 4.40875, -2.70195, -4.64087, 1.1541, -3.89863, 9.48973, 4.76837e-07, 2.7354) + +[node name="Block15" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(-2.28035, 4.15931, 3.94576, 3.3662, 4.40875, -2.70195, -4.64087, 1.1541, -3.89863, 11.7752, 4.76837e-07, 2.7354) + +[node name="Block16" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(-3.59526, 4.67433, 1.81486, 3.58307, 3.95713, -3.09381, -3.5078, -0.748826, -5.02031, 7.85471, -1.80343, 4.65367) + +[node name="Block7" parent="map" instance=ExtResource("2_8u8xb")] +transform = Transform3D(0.833637, -0.580818, -1.236, 0.914655, 1.31279, 2.72588e-08, 1.01413, -0.706571, 1.01602, 3.30079, -0.0345068, 3.26074)