TPでarmor standがずれる

、armor standたlocationにtp



function wildBoar_animation(e: entity, body: entity, head: entity):
    set {_headGap} to 0.875

    while {_e} is alive:
        delete {_v}
        delete {_loc::*}
        set {_v} to velocity of {_e}
        set {_w} to world of {_e}
        
        # 移動しているかどうか
        if normal length of {_v} > 0.08:
            # ずれが無いので省略
        else:
            # してないので、headのvectorを参照する
            set {_v}     to entityHeadVec({_e})
            set {_vBody} to entityHeadVec({_body})
            if angle between {_v} and {_vBody} >= 70:
                set y of {_v} to 0
                set normal length of {_v} to {_headGap}
                set {_y::body} to yaw of {_v}
                set {_y::head} to yaw of {_v}
                set {_p::head} to pitch of {_v}
                set {_loc::body} to {_e}
                set {_loc::head} to {_e} ~ {_v}
            else:
                set y of {_vBody} to 0
                set normal length of {_vBody} to {_headGap}
                set {_y::body} to yaw of {_vBody}
                set {_y::head} to yaw of {_v}
                set {_p::head} to pitch of {_v}
                set {_loc::body} to location at {_body}
                set {_loc::head} to location at {_body} ~ {_vBody}
        
        teleport {_body} to {_loc::body}
        teleport {_head} to {_loc::head}
        standRotate({_body}, {_y::body} ,{_p::body})
        standRotate({_head}, {_y::head} ,{_p::head})
        wait 1 tick
        set {_} to (location at {_head})
        show 1 flame with speed 0 at {_}
    kill {_body}
    kill {_head}

毎tickTP

sk
Was this page helpful?