台服dnf吧 关注:125,217贴子:2,086,047
  • 3回复贴,共1

攻击框的坐标要怎么调?

只看楼主收藏回复

local targetX =sq_GetCenterXPos(boundingBox);
local targetY =sq_GetCenterYPos(boundingBox);
local targetZ =sq_GetCenterZPos(boundingBox);
这几个坐标是攻击命中部位,也确实有效,但是位置是怎么算的?按照原始坐标击中位置飞到屏幕外面,有人能指点一下么?


IP属地:广西1楼2026-01-06 22:38回复
    佬,我看他们写附加对象的时候是这么写的:“
    //附加对象攻击时 #这里也包括附加对象创建的特效
    function sq_AddFunctionName(appendage)
    {
    appendage.sq_AddFunctionName("onAttackParent", "onAttackParent_appendage_common_burster")
    }
    function onAttackParent_appendage_common_burster(appendage, realAttacker, damager, boundingBox, isStuck)
    {
    if(!appendage) {
    return;
    }
    // 버스터모드로 쳤다면..
    if (appendage.isValid())
    {
    local centerX = sq_GetCenterXPos(boundingBox);
    local centerZ = sq_GetCenterZPos(boundingBox);
    local posY = damager.getYPos();
    local hitEffAni = sq_CreateAnimation("","Character/Common/Animation/BusterMode/buster_hit_back_normal1.ani");
    local hitBackEffObj = sq_CreatePooledObject(hitEffAni, true);
    hitBackEffObj.setCurrentPos(centerX, posY - 1, centerZ);
    sq_AddObject(realAttacker, hitBackEffObj, OBJECTTYPE_DRAWONLY, false);
    local hitFrontEffAni = sq_CreateAnimation("","Character/Common/Animation/BusterMode/buster_hit_front_dodge.ani");
    local hitFrontEffObj = sq_CreatePooledObject(hitFrontEffAni, true);
    hitFrontEffObj.setCurrentPos(centerX, posY + 1, centerZ);
    sq_AddObject(realAttacker, hitFrontEffObj, OBJECTTYPE_DRAWONLY, false);
    }
    }
    ”就他们用的是centerX, posY + 1, centerZ,而不是centerX, centerY, centerZ


    IP属地:重庆3楼2026-01-28 14:22
    收起回复