Warcraft III resources & community, 2003–2006 · archived

UnitTurnBone

not rated
Submitted by KaTTaNaFunctions0 downloads
Turns bone on the unit. Angle is the left/right direction of the bone, and pitch is the up/down direction.
if fromFacing is true, the angle will be an offset from the unit's facing, otherwise it will be an absolute angle where 0 is east and 90 is north.

If using this on very large units, I suggest you set pitch a little higher than otherwise.

Source

function UnitTurnBone takes unit whichUnit, string whichBone, real angle, real pitch, boolean fromFacing returns nothing
    if ( fromFacing ) then
        set angle = angle + GetUnitFacing(whichUnit)
    endif
    if ( pitch == 90.0 ) then
        set pitch = 89
    endif
    call SetUnitLookAt(whichUnit, whichBone, whichUnit, 10000.0*Cos(angle*bj_DEGTORAD)*Cos(pitch*bj_DEGTORAD), 10000.0*Sin(angle*bj_DEGTORAD)*Cos(pitch*bj_DEGTORAD), 10000.0*Tan(pitch*bj_DEGTORAD)+90.0)
endfunction

Comments

0

No comments.