MrSirSquishy / SquishyAPI

Other
20 stars 3 forks source link

torso head rotation head issue #2

Closed Dragonearuss closed 11 months ago

Dragonearuss commented 1 year ago

image

torso rotation head issue (?) total's fix:

`` function squapi.torso(element, strengthmultiplier, tilt, keeporiginalheadpos) strengthmultiplier = strengthmultiplier or 0.5 tilt = tilt or 0.4

if keeporiginalheadpos == nil then keeporiginalheadpos = true end
local mainheadrot = vec(0, 0, 0)
function events.render(delta, context)
    local headrot = ((vanilla_model.HEAD:getOriginRot()+180 + squapi.smoothHeadOffset)%360-180)*strengthmultiplier
    mainheadrot[1] = mainheadrot[1] + (headrot[1] - mainheadrot[1])/12
    mainheadrot[2] = mainheadrot[2] + (headrot[2] - mainheadrot[2])/12
    mainheadrot[3] = mainheadrot[2]*tilt
    mainheadrot = mainheadrot
    element:setOffsetRot(mainheadrot)
    if keeporiginalheadpos then 
        element:setPos(-vanilla_model.HEAD:getOriginPos()) 
    end

end

end``