I am modifying Microsoft AirSim:
My only change is changing this constructor: https://github.com/Microsoft/AirSim/blob/master/Unreal/Plugins/AirSim/Source/Multirotor/FlyingPawn.cpp#L11 to
AFlyingPawn::AFlyingPawn()
{
wrapper_.reset(new VehiclePawnWrapper());
static ConstructorHelpers::FClassFinder<APIPCamera> pip_camera_class(TEXT("Blueprint'/AirSim/Blueprints/BP_PIPCamera'"));
pip_camera_class_ = pip_camera_class.Succeeded() ? pip_camera_class.Class : nullptr;
InternalCameraBase1 = CreateDefaultSubobject<USceneComponent>(TEXT("InternalCameraBase1"));
InternalCameraBase1->SetRelativeLocation(FVector(36.0f, 0, 50.0f)); //center
InternalCameraBase1->SetupAttachment(RootComponent);
}
The problem lies in the line that contains CreateDefaultSubobject
. When I add this line, the NotifyHit event on line 24 stops being fired. I think there is something I don’t understand about how collisions are signaled? Anyone have some insight to share?