Box sweeping gives a completely wrong normal

kneltbuffalo
Mon, 15 Jul 2024 06:45:55 +0000
World Creation

Hi there,

it seems box sweeping gives a wrong normal when it collides against BSP.

UE5 - Box sweeping gives wrong normal

The video shows FloatingPawnMovementComponent with Box collision sliding along a box-shaped BSP. The movement stops even though the BSP doesn’t have any obstacles. After that, I set a breakpoint with the condition “Hit.Normal.Y != 1.0f && Hit.bBlockingHit” and it turned out that box sweeping gives a wrong normal to FHitResult.

Does anyone know how to fix this issue so that Pawn movement with Box collision can get right normal for collision response?

The project in the video is from GitHub - kneltbuffalo/FloatingPawnStuck. You can compile it with UE 5.4.2 and try it out for yourself. I just swapped a sphere collision component which FloatingPawnMovementComponent uses with Box component.

If you want to set a breakpoint in the video, the line is https://github.com/EpicGames/UnrealEngine/blob/5.4.2-release/Engine/Source/Runtime/Engine/Private/FloatingPawnMovement.cpp#L66

Thanks

3 posts - 1 participant