Bullet hit algorithm


I’m working on a third-person shooter.The project has already implemented shooting and algorithm for hitting the box. Everything works, but the box repulsion algorithm does not look quite realistic. Sometimes, when firing from top to bottom, the box flies up, although it should not do this. Could you tell me, how I can make a more realistic pushing away of the box? The current algorithm that I took from this topic, and a link to the project: https://playcanvas.com/editor/scene/694807

if (result) { 

    var hitEntity = result.entity;
    var localOffset = new pc.Vec3();
    var mat = hitEntity.getWorldTransform().clone();

    mat.transformPoint(result.point, localOffset);
    hitEntity.rigidbody.applyImpulse(this.target.scale(500), localOffset);