diff --git a/mods/nc_player_model/hooks.lua b/mods/nc_player_model/hooks.lua index 40248253..20e86641 100644 --- a/mods/nc_player_model/hooks.lua +++ b/mods/nc_player_model/hooks.lua @@ -8,7 +8,8 @@ local math_abs, math_deg local frame_blend = 0.15 local pitch_mult = 2/3 -local pitch_limit = 60 +local pitch_max = 60 +local pitch_min = -15 local pitch_precision = 1 nodecore.register_playerstep({ @@ -42,13 +43,13 @@ nodecore.register_playerstep({ local pitch = -math_deg(player:get_look_vertical()) * pitch_mult if anim and anim.headpitch then pitch = pitch + anim.headpitch end - if pitch < -pitch_limit then pitch = -pitch_limit end - if pitch > pitch_limit then pitch = pitch_limit end + if pitch < pitch_min then pitch = pitch_min end + if pitch > pitch_max then pitch = pitch_max end if not (data.headpitch and math_abs(data.headpitch - pitch) < pitch_precision) then data.headpitch = pitch player:set_bone_position("Head", - {x = 0, y = 0, z = 0}, + {x = 0, y = 1/2, z = -pitch / 45}, {x = pitch, y = 0, z = 0} ) end