add bone size variation to aphids
This commit is contained in:
@@ -65,7 +65,7 @@ visible = false
|
|||||||
root_node = NodePath("../AntModel")
|
root_node = NodePath("../AntModel")
|
||||||
tree_root = SubResource("AnimationNodeStateMachine_v8drs")
|
tree_root = SubResource("AnimationNodeStateMachine_v8drs")
|
||||||
anim_player = NodePath("../AntModel/AnimationPlayer")
|
anim_player = NodePath("../AntModel/AnimationPlayer")
|
||||||
parameters/locomotion/blend_position = 0
|
parameters/locomotion/blend_position = 0.023431
|
||||||
|
|
||||||
[node name="CollisionShape3D" parent="." index="2"]
|
[node name="CollisionShape3D" parent="." index="2"]
|
||||||
shape = SubResource("CylinderShape3D_8admi")
|
shape = SubResource("CylinderShape3D_8admi")
|
||||||
|
|||||||
@@ -41,10 +41,8 @@ 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/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/10/rotation = Quaternion(-0.235443, 0.235445, -0.666758, 0.666758)
|
||||||
bones/11/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/13/rotation = Quaternion(-0.235443, -0.235445, 0.666758, 0.666758)
|
||||||
bones/14/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"]
|
[node name="AnimationTree" parent="." index="1"]
|
||||||
root_node = NodePath("../AphidModel")
|
root_node = NodePath("../AphidModel")
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ enum State {
|
|||||||
WANDERING,
|
WANDERING,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const BONE_SCALE_VARIATION: float = 0.25
|
||||||
|
|
||||||
const HONEYDEW_INTERVAL_MIN: float = 5
|
const HONEYDEW_INTERVAL_MIN: float = 5
|
||||||
const HONEYDEW_INTERVAL_MAX: float = 60
|
const HONEYDEW_INTERVAL_MAX: float = 60
|
||||||
const HONEYDEW_SPAWN_SPREAD: float = 0.5
|
const HONEYDEW_SPAWN_SPREAD: float = 0.5
|
||||||
@@ -16,10 +18,29 @@ var spawned_honeydews: Dictionary = {}
|
|||||||
|
|
||||||
var honeydew_scene := preload("res://scenes/items/honeydew.tscn")
|
var honeydew_scene := preload("res://scenes/items/honeydew.tscn")
|
||||||
|
|
||||||
|
var _bones_to_scale: PackedStringArray = [
|
||||||
|
"Root",
|
||||||
|
"Antenna_root_L",
|
||||||
|
"Eye_L",
|
||||||
|
"Antenna_root_R",
|
||||||
|
"Eye_R",
|
||||||
|
]
|
||||||
|
|
||||||
|
@onready var skeleton: Skeleton3D = $AphidModel/Armature/Skeleton3D
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
assert(skeleton != null, "skeleton missing!")
|
||||||
super._ready()
|
super._ready()
|
||||||
_set_spawn_timer()
|
_set_spawn_timer()
|
||||||
|
for bone_name in _bones_to_scale:
|
||||||
|
var bone := skeleton.find_bone(bone_name)
|
||||||
|
var bone_transform := skeleton.get_bone_pose(bone)
|
||||||
|
bone_transform.basis *= 1 + randf_range(
|
||||||
|
-BONE_SCALE_VARIATION,
|
||||||
|
BONE_SCALE_VARIATION,
|
||||||
|
)
|
||||||
|
skeleton.set_bone_pose_scale(bone, Vector3.ZERO)
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
|||||||
Reference in New Issue
Block a user