fix(miku): correct scale + animation playback

- Fixed Blender export: remove FBX armature modifier before scaling,
  then transform_apply(scale=True) before creating new armature
- Model now exports at correct 1.8 unit height (verified in Blender)
- SkinnedPlayerModel now polls MovementStateMachine in _process
  to drive animations based on movement state
- Player 1 gets Miku at origin, others get procedural humanoid at y=-0.9
This commit is contained in:
2026-06-22 18:15:03 -04:00
parent ae8231d31d
commit 92713a681a
5 changed files with 56 additions and 6 deletions
+20 -4
View File
@@ -68,10 +68,18 @@ func play_animation(name: String) -> void:
else:
print("SkinnedPlayerModel: animation '%s' not found" % name)
func update_state(state: String, speed: float, is_crouching: bool = false) -> void:
func _process(delta: float) -> void:
if not animation_player:
return
# Poll the movement state machine for current state
var sm = get_parent().get_node_or_null("MovementStateMachine")
if not sm:
return
var state = sm.current_state
var speed = sm.movement_speed
match state:
"ground", "idle":
if speed > 1.0:
@@ -79,10 +87,18 @@ func update_state(state: String, speed: float, is_crouching: bool = false) -> vo
else:
play_animation("Idle")
"air":
play_animation("Idle") # TODO: add jump/fall anim
play_animation("Idle")
"crouch":
play_animation("Idle") # TODO: add crouch anim
play_animation("Idle")
"slide":
play_animation("Run") # TODO: add slide anim
play_animation("Run")
"wall_run":
play_animation("Run")
"wall_cling":
play_animation("Idle")
"grapple":
play_animation("Run")
"dash":
play_animation("Run")
_:
play_animation("Idle")