Fix the pose harness: disable the avatar process so the FSM cannot revert the pose
This commit is contained in:
1 parent
75dea2e7c2
commit
e984129597
4 files changed
+52
-31
No files matched your search
@@ -50,6 +50,10 @@ const VARIANTS := [
|
||||
{"name": "npc_hoodie", "type": Rules.NpcType.VIOLENT_THREAT},
|
||||
{"name": "npc_firefighter", "type": Rules.NpcType.RESPONDER},
|
||||
{"name": "npc_guard", "type": Rules.NpcType.CONFUSED_VISITOR},
|
||||
{"name": "npc_crowd_a", "type": Rules.NpcType.TOURIST},
|
||||
{"name": "npc_crowd_b", "type": Rules.NpcType.CONFUSED_VISITOR},
|
||||
{"name": "npc_crowd_c", "type": Rules.NpcType.INTOXICATED},
|
||||
{"name": "npc_crowd_d", "type": Rules.NpcType.TOURIST},
|
||||
]
|
||||
## Ticks of `_animate(1/60)` per pose. The walk phase advances by
|
||||
## dt * (6 + speed * 1.7) ≈ 0.148 rad/tick at 1.7 m/s, so 30 ticks lands on a
|
||||
@@ -209,6 +213,10 @@ func _stage_pose() -> void:
|
||||
_stage.add_child(avatar)
|
||||
avatar.global_position = Vector3.ZERO
|
||||
avatar.rotation.y = 0.0
|
||||
# Freeze the FSM/navigation so it cannot overwrite the pose we drive with
|
||||
# `_animate()` (the FSM re-writes rotation.y and `arrived` every physics tick).
|
||||
avatar.set_physics_process(false)
|
||||
avatar.set_process(false)
|
||||
|
||||
for node in avatar.find_children("*", "Label3D", true, false):
|
||||
(node as Label3D).visible = false
|
||||
|
||||
Reference in new issue
Block a user