Hi! I’m using UE 4.17, I have my SetInputComponent method like this:
void UGrabber::SetInputComponent()
{
InputComponent = GetOwner()->FindComponentByClass();
UE_LOG(LogTemp, Error, TEXT(" %s"), InputComponent);
if (InputComponent)
{
InputComponent->BindAction(“Grab”, IE_Pressed, this, &UGrabber::Grab);
InputComponent->BindAction(“Grab”, IE_Released, this, &UGrabber::Release);
}
else {
UE_LOG(LogTemp, Error, TEXT(" %s: falta el componente de entrada "), *GetOwner()->GetName());
}
}
And it should work but on the runtime I get the error message even though my character has the input component:
Why I don’t get the InputComponent on code even though it is on the character?