Hi,
I cleared my log to make sure I was seeing the right thing, but when I press play, the output log tells me that the input component was fond, and then that it’s not.
The warnings and error are on the bottom of the output:
LogPlayLevel: PlayLevel: No blueprints needed recompiling
PIE: New page: PIE session: NewMap (Jan 12, 2017, 7:49:15 AM)
LogPlayLevel: Creating play world package: /Game/UEDPIE_0_NewMap
LogPlayLevel: PIE: StaticDuplicateObject took: (0.007704s)
LogAIModule: Creating AISystem for world NewMap
LogPlayLevel: PIE: World Init took: (0.001528s)
LogPlayLevel: PIE: Created PIE world by copying editor world from /Game/NewMap.NewMap to /Game/UEDPIE_0_NewMap.NewMap (0.009746s)
LogInit: XAudio2 using ‘Line Out (Scarlett 18i6 USB)’ : 2 channels at 44.1 kHz using 16 bits per sample (channel mask 0x3)
LogInit: FAudioDevice initialized.
LogWorld: Game class is 'BuildingEscapeGameMode_BP_C’
LogWorld: Bringing World /Game/UEDPIE_0_NewMap.NewMap up for play (max tick rate 0) at 2017.01.12-12.49.15
LogWorld: Bringing up level for play took: 0.006408
** LogTemp:Warning: Grabber reported for duty!**
** LogTemp:Warning: PhysicsHandle found!**
** LogTemp:Warning: Input Component found!**
** LogTemp:Warning: Grabber reported for duty!**
** LogTemp:Warning: PhysicsHandle found!**
** LogTemp:Error: Input Component not found!**
PIE: Info Play in editor start time for /Game/UEDPIE_0_NewMap 0.294
My Code:
///Look for the attached Input Component
MyInputComponent = GetOwner()->FindComponentByClass<UInputComponent>();
if (MyInputComponent) {
//Input COmponent found
UE_LOG(LogTemp, Warning, TEXT("Input Component found!"))
}
else
{
UE_LOG(LogTemp, Error, TEXT("Input Component not found! "), *GetOwner()->GetName())
}