Bind input in custom Actor

Thank you very much Marc, this worked!


void ACOMCameraActor::BeginPlay()
{
	Super::BeginPlay();

	if (GetOwner() && Cast<APlayerController>(GetOwner()))
	{
		PCOwner = Cast<APlayerController>(GetOwner());
	}

	if (PCOwner)
	{
		InputComponent = ConstructObject<UInputComponent>(UInputComponent::StaticClass(), this, "Input Component");
		InputComponent->bBlockInput = bBlockInput;

		if (InputComponent)
		{
			InputComponent->BindAction("CameraZoomIn", EInputEvent::IE_Pressed, this, &ACOMCameraActor::ZoomIn);
			InputComponent->BindAction("CameraZoomOut", EInputEvent::IE_Pressed, this, &ACOMCameraActor::ZoomOut);

			InputComponent->BindAction("EnableCameraRot", EInputEvent::IE_Pressed, this, &ACOMCameraActor::StartRotation);
			InputComponent->BindAction("EnableCameraRot", EInputEvent::IE_Released, this, &ACOMCameraActor::StopRotation);

			EnableInput(PCOwner);
		}	
	}