From 168a572fb78e841cb26cfedbdba38fe3e912c5c8 Mon Sep 17 00:00:00 2001 From: teatov Date: Mon, 21 Oct 2024 18:56:36 +1000 Subject: [PATCH] fix aphid root bone variation --- scenes/units/aphid.tscn | 2 ++ scripts/units/aphid.gd | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scenes/units/aphid.tscn b/scenes/units/aphid.tscn index 273d4a1..73ae7eb 100644 --- a/scenes/units/aphid.tscn +++ b/scenes/units/aphid.tscn @@ -41,8 +41,10 @@ bones/6/rotation = Quaternion(-3.38449e-07, 0.863712, 0.503987, -5.80021e-07) bones/7/rotation = Quaternion(0.526107, -8.35521e-14, 7.06609e-07, 0.850418) bones/10/rotation = Quaternion(-0.235443, 0.235445, -0.666758, 0.666758) bones/11/rotation = Quaternion(-0.235443, 0.235445, -0.666758, 0.666758) +bones/12/scale = Vector3(1, 1, 1) bones/13/rotation = Quaternion(-0.235443, -0.235445, 0.666758, 0.666758) bones/14/rotation = Quaternion(-0.235443, -0.235445, 0.666758, 0.666758) +bones/15/scale = Vector3(1, 1, 1) [node name="AnimationTree" parent="." index="1"] root_node = NodePath("../AphidModel") diff --git a/scripts/units/aphid.gd b/scripts/units/aphid.gd index da0bfa4..e75987a 100644 --- a/scripts/units/aphid.gd +++ b/scripts/units/aphid.gd @@ -19,7 +19,6 @@ var spawned_honeydews: Dictionary = {} var honeydew_scene := preload("res://scenes/items/honeydew.tscn") var _bones_to_scale: PackedStringArray = [ - "Root", "Antenna_root_L", "Eye_L", "Antenna_root_R", @@ -40,7 +39,11 @@ func _ready() -> void: -BONE_SCALE_VARIATION, BONE_SCALE_VARIATION, ) - skeleton.set_bone_pose_scale(bone, Vector3.ZERO) + skeleton.set_bone_pose(bone, bone_transform) + skeleton.scale *= 1 + randf_range( + -BONE_SCALE_VARIATION, + BONE_SCALE_VARIATION, + ) func _process(delta: float) -> void: