How to access a private class?

Hello edsonsantoro,

Depending on where you’re trying to gain access to the FPhysXVehicleManager, you should be able to easily get a reference to it from the PhysicsScene. This is also easily accessible from the current world.

For example, if you’re trying to get a reference to FPhysXVehicleManager from inside an AActor:

FPhysXVehicleManager* MyDerivedAActorClass::GetPhsyXVehicleManager()
{
    UWorld* World = AActor::GetWorld();
    if (World)
    {
        FPhysScene* PhysicsScene = World->GetPhysicsScene();
        if (PhysicsScene)
        {
            return PhysicsScene->GetVehicleManager();
        }
    }
    return nullptr;
}

However, for this to work properly, the project must be set to compile with PhysX (which is true by default).

Thanks,
Jon N.