fix: update logic move on ground.

This commit is contained in:
Tungdv
2025-12-24 16:53:14 +07:00
parent a56a08a32d
commit f9750f7791
+5 -3
View File
@@ -341,7 +341,7 @@ namespace BrewMonster
{
vStart += Vector3.up * CDRInfo.fStepHeight;
posFoot = vStart - Vector3.up * vExt.y;
fDeltaDist = vVelocity.magnitude;
fDeltaDist = (vVelocity.normalized).magnitude;
bool bMove = !Physics.Raycast(posFoot, (posFoot + vVelocity).normalized, out hit, fDeltaDist, mask);
//Vector3 posDelta = vDelta;
@@ -354,12 +354,14 @@ namespace BrewMonster
}
else
{
Debug.DrawLine(vFinalPos, vFinalPos + vDelta, Color.red, 10f);
//Debug.DrawLine(vFinalPos, vFinalPos + vDelta, Color.red, 10f);
vFinalPos += vDelta;
}
if(fDeltaDist < (vExt.x * vExt.x * 4))
//Debug.LogError("vExt.x * vExt.x * 4 = " + vExt.x * vExt.x * 4 + " fDeltaDist = " + fDeltaDist);
if (fDeltaDist < (vExt.x * vExt.x * 4))
{
//Debug.LogError("set bPull = false");
vFinalPos.y -= CDRInfo.fStepHeight;
bPull = false;
}
}