Need help with PhisXVehicleManager

There is no eDRIVENW case in

FPhysXVehicleManager::RemoveVehicle( TWeakObjectPtr<UWheeledVehicleMovementComponent> Vehicle )
    	switch( PVehicle->getVehicleType() )
    	{
    	case PxVehicleTypes::eDRIVE4W:
    		((PxVehicleDrive4W*)PVehicle)->free();
    		break;
    	case PxVehicleTypes::eDRIVETANK:
    		((PxVehicleDriveTank*)PVehicle)->free();
    		break;
    	case PxVehicleTypes::eNODRIVE:
    		((PxVehicleNoDrive*)PVehicle)->free();
    		break;
    	default:
    		checkf( 0, TEXT("Unsupported vehicle type"));
    		break;

it crashes when trying to delete PxVehicleDriveNW vehicle from scene. Is there any simple way to circumvent this issue?

I added the case for the eDRIVENW and it still crashes, don’t know if you managed to fix it, I just ran into this problem last night. I’m trying to find where it gets the vehicle type and fix whatever’s going on there.

Sorry about the answer before, I didn’t add a break statement after the newly added case, so dumb on my part. So to fix this just add this to the switch statement, and you’re good to go. This is on 4.10 by the way, so it’s still valid.

68197-snippetofcode.png

Well, you still have to recompile of course, but yeah, good luck.

Well, sorry for bump, but this is dumb. I just stumbled across this too. Even though there is no class for tank, there is case for it. NWheeledVehicles are less rare than tanks in my opinion and there is nothing. Have you created a feature request of some sort so we don’t need to recompile in next versions?

It’s in the UE4 master branch, so I don’t know when it’ll be added as a standard. I’m hoping vehicles get some sort of overhaul soon, maybe when they add PhysX 3.4. The shoddy implementation I did is here NwheelVehicleImplementation