fix: update auto move attack normal HP (fix move underground).

This commit is contained in:
tung.do@monkey.edu.vn
2025-10-31 02:20:50 +07:00
parent 4be95aec7a
commit 76d12a1140
+4 -4
View File
@@ -136,11 +136,11 @@ namespace BrewMonster.Scripts
bSupport = false;
float dist = Mathf.Max(fDeltaY, 0f);
Vector3 origin = vStart + Vector3.down * vExt.y;
Vector3 origin = vStart /*+ Vector3.down * vExt.y*/;
if (Physics.Raycast(origin, (Vector3.down ).normalized, out RaycastHit hit, 1<<6 | 1<<7))
{
vHitNormal = hit.normal;
Debug.DrawLine(origin, vHitNormal, Color.black, 10f);
//Debug.DrawLine(origin, vHitNormal, Color.black, 10f);
vEnd = new Vector3(vStart.x, hit.point.y + vExt.y, vStart.z);
bSupport = (vHitNormal.y >= 0f);
return true;
@@ -220,11 +220,11 @@ namespace BrewMonster.Scripts
//bool hasHit = CollideWithEnv_BoxCast(vStart, vDelta, vExt, mask,
// out RaycastHit hit, out float fFraction, out Vector3 hitNormal, out bool bStartSolid);
Vector3 posFoot = vStart - Vector3.up * vExt.y;
bool bClear = !Physics.Raycast(posFoot, (posFoot + vVelocity).normalized, out RaycastHit hit, fDeltaDist, mask);
bool bClear = !Physics.Raycast(posFoot, (posFoot + vDelta).normalized, out RaycastHit hit, fDeltaDist, mask);
nTry++;
Debug.DrawLine(posFoot, posFoot + vVelocity, Color.yellow, 10f);
if (bClear)
{
Debug.DrawLine(posFoot, posFoot + vDelta, Color.yellow, 10f);
vFinalPos = vStart + vDelta;
CDRInfo.fMoveDist += fDeltaDist;
break;