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:
parent
74702c6ada
commit
f1e7172fe1
@ -645,6 +645,7 @@ default.player_get_animation(player)
|
|||||||
bar = {x = 20, y = 39},
|
bar = {x = 20, y = 39},
|
||||||
-- ...
|
-- ...
|
||||||
},
|
},
|
||||||
|
eye_height = 1.47, -- In nodes above feet position
|
||||||
}
|
}
|
||||||
|
|
||||||
Leafdecay
|
Leafdecay
|
||||||
|
@ -27,6 +27,7 @@ default.player_register_model("character.b3d", {
|
|||||||
walk_mine = { x=200, y=219, },
|
walk_mine = { x=200, y=219, },
|
||||||
sit = { x= 81, y=160, },
|
sit = { x= 81, y=160, },
|
||||||
},
|
},
|
||||||
|
eye_height = 1.625,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Player stats and animations
|
-- Player stats and animations
|
||||||
@ -58,12 +59,14 @@ function default.player_set_model(player, model_name)
|
|||||||
textures = player_textures[name] or model.textures,
|
textures = player_textures[name] or model.textures,
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
visual_size = model.visual_size or {x=1, y=1},
|
visual_size = model.visual_size or {x=1, y=1},
|
||||||
|
eye_height = model.eye_height or 1.47,
|
||||||
})
|
})
|
||||||
default.player_set_animation(player, "stand")
|
default.player_set_animation(player, "stand")
|
||||||
else
|
else
|
||||||
player:set_properties({
|
player:set_properties({
|
||||||
textures = { "player.png", "player_back.png", },
|
textures = { "player.png", "player_back.png", },
|
||||||
visual = "upright_sprite",
|
visual = "upright_sprite",
|
||||||
|
eye_height = 1.625,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
player_model[name] = model_name
|
player_model[name] = model_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user