fix: correct skin deformation and scale for GLB character models

The Miku model T-posed because the previous _update_skin() used
set_bone_pose(i, get_bone_pose(i)) which is a no-op when the pose
is unchanged. Replace with skeleton.notification(NOTIFICATION_UPDATE_SKELETON)
to force the Skeleton3D to recompute bone transforms and notify the
MeshInstance to update vertex buffers.

Also fix scale: the GLB is ~1.2m tall (not 1.6m as documented), so
set scale_factor=1.25 to fit the 1.8m player capsule, and add
position_y_offset=-0.2 to align the model's feet with the player origin.

Co-Authored-By: Hermes Agent <[email protected]>
This commit is contained in:
2026-06-25 00:56:25 -04:00
parent c4dc4ca77c
commit 43b870465b
3 changed files with 23 additions and 15 deletions
+2
View File
@@ -148,6 +148,8 @@ func _spawn_player(pid: int) -> CharacterBody3D:
var skinned = load("res://characters/skinned_player_model.gd").new()
skinned.name = "SkinnedModel"
skinned.model_path = "res://assets/characters/skins/miku_rigged_animated.glb"
skinned.scale_factor = 1.25
skinned.position_y_offset = -0.2
skinned.position = Vector3(0, 0.0, 0)
skinned.first_person_mode = true
player.add_child(skinned)