Missing Input Component, Lecture 83

Lecture 83 Input has us coding an input component. It shows up at runtime. In my case, it’s showing up with the wrong item.

My output log shows
LogTemp:Warning: Grabber reporting for duty!
LogTemp:Error: DefaultPawn_BP_205 is missing input component

At runtime my DefaultPawn_BP does not get the PawnInputComponent0, but the DefaultPawn does. In the video, the DefaultPawn_BP gets the input component. What am I doing wrong or missing?

/// Look for attached Input Component (only appears at run time)
InputComponent = GetOwner()->FindComponentByClass<UInputComponent>();
if (InputComponent)
{
	// Input Component is found
	UE_LOG(LogTemp, Warning, TEXT("Input component found"))
	/// Bind the input axis
	InputComponent->BindAction("Grab", IE_Pressed, this, &UGrabber::Grab);
}
else
{
	UE_LOG(LogTemp, Error, TEXT("%s is missing input component"), *GetOwner()->GetName())
}

}

void UGrabber::Grab() {
UE_LOG(LogTemp, Warning, TEXT(“Grab pressed”))
}

1 Like

This has been resolved.

In Project Settings, Maps & Modes.

Default GameMode is now set to BuildingEscapeGameModeBase_BP

Then the Default Pawn Class is select-able and can be changed to DefaultPawn_BP.

1 Like

Privacy & Terms