Skip to content

Commit 8d60e85

Browse files
committed
Fix player_api.set_model not updating the animation
1 parent 2c1d9e1 commit 8d60e85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mods/player_api/api.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ function player_api.set_model(player, model_name)
6767
if player_data.model == model_name then
6868
return
6969
end
70+
-- Update data
7071
player_data.model = model_name
72+
-- Clear animation data as the model has changed
73+
-- (required for setting the `stand` animation not to be a no-op)
74+
player_data.animation, player_data.animation_speed = nil, nil
7175

7276
local model = models[model_name]
7377
if model then

0 commit comments

Comments
 (0)