adapted from player_api: Set eye height property for player model

* backported d4e1bd053e
* Player API: Set eye height property for new player model
This commit is contained in:
Герхард PICCORO Lenz McKAY 2021-12-10 17:35:02 -04:00
parent 74702c6ada
commit f1e7172fe1
2 changed files with 4 additions and 0 deletions

View File

@ -645,6 +645,7 @@ default.player_get_animation(player)
bar = {x = 20, y = 39},
-- ...
},
eye_height = 1.47, -- In nodes above feet position
}
Leafdecay

View File

@ -27,6 +27,7 @@ default.player_register_model("character.b3d", {
walk_mine = { x=200, y=219, },
sit = { x= 81, y=160, },
},
eye_height = 1.625,
})
-- Player stats and animations
@ -58,12 +59,14 @@ function default.player_set_model(player, model_name)
textures = player_textures[name] or model.textures,
visual = "mesh",
visual_size = model.visual_size or {x=1, y=1},
eye_height = model.eye_height or 1.47,
})
default.player_set_animation(player, "stand")
else
player:set_properties({
textures = { "player.png", "player_back.png", },
visual = "upright_sprite",
eye_height = 1.625,
})
end
player_model[name] = model_name