Transplant the hoodie head parts onto the Worker base and put carried props in the hands
Full build / Import + headless tests (push) Successful in 45s
Full build / Full desktop build + optional release (push) Skipped

This commit is contained in:
zwitschi committed 2026-11-06 14:40:35 +01:00
1 parent 3ab7577634
commit 529d15ee7a
16 files changed
+179 -84

No files matched your search

+31 -9
View File
@@ -962,24 +962,33 @@ func _add_props(npc_type: int) -> void:
Rules.NpcType.DELIVERY:
_add_box_prop(_rig, Vector3(0.34, 0.26, 0.28), Vector3(0.0, 1.02, 0.3), Color(0.55, 0.4, 0.25))
Rules.NpcType.PERFORMER:
# The cone is sized to the shipped head (0.20 m wide) and sits on the
# crown; at the old 0.44 m base it swallowed the whole head.
var hat := _material(Color(0.85, 0.2, 0.25))
var cone := MeshInstance3D.new()
var cm := CylinderMesh.new()
cm.top_radius = 0.02
cm.bottom_radius = 0.22
cm.height = 0.4
cm.top_radius = 0.012
cm.bottom_radius = 0.125
cm.height = 0.24
cone.mesh = cm
cone.material_override = hat
cone.position = Vector3(0, 0.26, 0)
cone.position = Vector3(0, 0.15, 0)
_head.add_child(cone)
# Hat in one hand and a small board in the other: the performer plays
# to the sidewalk once at the waypoint.
_add_box_prop(_rig, Vector3(0.06, 0.5, 0.06), Vector3(-0.42, 1.3, 0.14), Color(0.45, 0.35, 0.25))
_sign_prop = _add_box_prop(_rig, Vector3(0.42, 0.32, 0.03), Vector3(-0.46, 1.6, 0.14), Color(0.95, 0.9, 0.75))
# to the sidewalk once at the waypoint. Both ride the hand proxies, so
# they follow the arm instead of floating beside the body at a fixed
# rig offset (which is what the old -0.46 m placement did).
_add_box_prop(_hand_for(0), Vector3(0.05, 0.34, 0.05),
HAND_PROP_OFFSET, Color(0.45, 0.35, 0.25))
_sign_prop = _add_box_prop(_hand_for(1), Vector3(0.30, 0.24, 0.025),
HAND_PROP_OFFSET, Color(0.95, 0.9, 0.75))
_sign_prop_base_y = _sign_prop.position.y
Rules.NpcType.PROTESTER:
_add_box_prop(_rig, Vector3(0.05, 1.2, 0.05), Vector3(0.28, 1.45, 0.18), Color(0.4, 0.36, 0.32))
_sign_prop = _add_box_prop(_rig, Vector3(0.5, 0.42, 0.04), Vector3(0.48, 1.55, 0.18), Color(0.93, 0.93, 0.95))
# Pole and board ride the carrying hand for the same reason.
_add_box_prop(_hand_for(1), Vector3(0.045, 0.95, 0.045),
HAND_PROP_OFFSET, Color(0.4, 0.36, 0.32))
_sign_prop = _add_box_prop(_hand_for(1), Vector3(0.42, 0.34, 0.035),
HAND_PROP_OFFSET + Vector3(0, 0.5, 0), Color(0.93, 0.93, 0.95))
_sign_prop_base_y = _sign_prop.position.y
Rules.NpcType.TOURIST:
_photo_prop = _add_box_prop(_rig, Vector3(0.3, 0.36, 0.14), Vector3(-0.34, 1.15, -0.18), Color(0.25, 0.3, 0.45))
@@ -989,6 +998,19 @@ func _add_props(npc_type: int) -> void:
Rules.NpcType.CONFUSED_VISITOR:
_add_box_prop(_rig, Vector3(0.3, 0.05, 0.34), Vector3(0, 0.92, 0.06), Color(0.9, 0.88, 0.8))
## Carried role props ride the hand proxy so they follow the arm. The offset is
## in the hand's local space: the grip sits ~4 cm in front of the wrist origin,
## the same convention the Blender hand gear uses (`HAND_ITEM_FORWARD`).
const HAND_PROP_OFFSET := Vector3(0, -0.02, 0.05)
## Hand proxy for a side (0 = the avatar's left, 1 = its right), falling back to
## the rig when the fallback body has no proxies.
func _hand_for(side: int) -> Node3D:
if side < _hands.size() and _hands[side] != null:
return _hands[side]
return _rig
func _add_box_prop(parent: Node3D, size: Vector3, pos: Vector3, color: Color) -> MeshInstance3D:
var mi := MeshInstance3D.new()
var mesh := BoxMesh.new()