High velocity collision detection best practice

https://developer.nvidia.com/sites/default/files/akamai/physx/Manual/Advanced.html

When continuous collision detection
(or CCD) is turned on, the affected
rigid bodies will not go through other
objects at high velocities (a problem
also known as tunneling).

You can find more details about CCD in physx docs.

I don’t want CCD on for everything as
I suppose it impacts performance
considerably.

CCD in UE4 is enabled by default, but first of all you must enable BodyInstance flag: bUseCCD to true to get ccd working.

BodyInstance.cpp:

// enable swept bounds for CCD for this shape
PxRigidBody* PBody = GetPxRigidActor()->is<PxRigidBody>();
if (bSimCollision && !bPhysicsStatic && bUseCCD && PBody)
{
	PBody->setRigidBodyFlag(PxRigidBodyFlag::eENABLE_CCD, true);
}
else if (PBody)
{
	PBody->setRigidBodyFlag(PxRigidBodyFlag::eENABLE_CCD, false);
}