Third-person camera + fix the avatar customize preview
checkpoint / checkpoint (push) Successful in 1m34s

You couldn't see your own character because the camera was first-person
(inside the avatar's head), and the customize screen's 3D preview rendered
nothing.

- player.tscn: camera now hangs off a SpringArm3D on a CameraPivot, 4 m
  behind + above the player, pulled in on collision. player.gd: yaw still
  turns the body, pitch orbits the arm (starts tilted down to frame the
  avatar).
- avatar_customization_ui.gd: the preview SubViewport had own_world_3d=false,
  so it shared the Control-only main world -- no scenario, nothing rendered.
  Set own_world_3d=true, add a WorldEnvironment with ambient fill + a
  key/fill light pair, make the camera current, tweak framing.
- smoke_test_player: assert the third-person SpringArm rig (18/18).
- smoke_test_enter_world: wait longer for the scene change -- a real
  POST /join spawns a dedicated server, which is slow (9/9).

Client-side change -- rebuild the exe to get it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015jtxAiu5dAW4WxCNdGkrkJ
This commit is contained in:
2026-09-05 23:13:07 +00:00
parent bd1bdc417a
commit 87f78b0226
5 changed files with 68 additions and 28 deletions
+7 -1
View File
@@ -76,9 +76,15 @@ func _run() -> void:
# 5. Verify the player has a Camera3D so the game is actually viewable
# from the player's perspective, not just a walking capsule with no view.
var camera: Node = player.get_node_or_null("Camera3D")
var camera: Node = player.find_child("Camera3D", true, false)
_check("Player has a Camera3D", camera is Camera3D)
_check("Camera3D is current", camera is Camera3D and (camera as Camera3D).current)
# Third-person rig: the camera hangs off a SpringArm3D (so it pulls in
# when a wall is behind the player) with real length.
var arm: Node = player.find_child("SpringArm3D", true, false)
_check("Camera is on a SpringArm3D (third-person)", arm is SpringArm3D)
_check("SpringArm has real length", arm is SpringArm3D and (arm as SpringArm3D).spring_length >= 2.0)
_check("Camera is a descendant of the SpringArm", camera != null and arm != null and arm.is_ancestor_of(camera))
print("\n=== SMOKE RESULT: %d/%d passed ===" % [_passed, _passed + _failed])
quit(0 if _failed == 0 else 1)