set unit animation to manual

This commit is contained in:
2024-10-07 23:59:04 +10:00
parent 6d3ddd7526
commit 638e4e2578
3 changed files with 5 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ collision_mask = 0
script = ExtResource("1_ulhs6")
[node name="AnimationTree" type="AnimationTree" parent="."]
callback_mode_process = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)

View File

@@ -51,6 +51,9 @@ bones/43/scale = Vector3(1, 1, 1)
[node name="GathererMesh" parent="AntModel/Armature/Skeleton3D" index="0"]
visible = true
[node name="AnimationTree" parent="." index="1"]
callback_mode_process = 1
[node name="Gathering" parent="." index="8" instance=ExtResource("3_7b5q8")]
[node name="NearbyItemsSearch" parent="Gathering" index="0"]

View File

@@ -78,11 +78,6 @@ func _navigate() -> void:
func _animate(delta: float) -> void:
if not is_on_screen:
if velocity.length() > 0.1:
var velocity_normalized := velocity.normalized()
global_rotation.y = atan2(
-velocity_normalized.x, -velocity_normalized.z
) + PI
return
if velocity.length() > 0.01:
@@ -101,6 +96,7 @@ func _animate(delta: float) -> void:
delta * 8
)
animation_tree.set("parameters/locomotion/blend_position", locomotion_value)
animation_tree.advance(delta)
func _wander(delta: float) -> void: