Why isn't this working? (Custom Controller)

I’m using a custom controller for input, trying to get enhanced input system to work. There’s no errors now but when I click, nothing happens so not a lot to go off of.

To be clear, I’m not asking about or talking about the trace. Even the logs don’t trigger.

Here’s the script:

// Fill out your copyright notice in the Description page of Project Settings.

#include "GameController.h"
#include "EnhancedInputSubsystems.h"
#include "EnhancedInputComponent.h"

AGameController::AGameController() {


void AGameController::BeginPlay() {



		if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))

			Subsystem->AddMappingContext(CRPGMapContext, 0);

void AGameController::Tick(float DeltaTime) {



void AGameController::SetupInputComponent()

	if (UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(InputComponent))
		EnhancedInputComponent->BindAction(LCAction, ETriggerEvent::Started, this, &AGameController::LeftClick);


void AGameController::LeftClick(const FInputActionValue& Value) {
	FHitResult hitRes;
	GetHitResultUnderCursorByChannel(ETraceTypeQuery::TraceTypeQuery1, true, hitRes);
	UE_LOG(LogTemp, Warning, TEXT("PEWPEW"));
	UE_LOG(LogTemp, Warning, TEXT("/s"), hitRes.GetActor()->execStringConst);

Did you set your LCAction variable in the blueprints?

Do I have to create a controller blueprint? Is the script not enough?

Or do I basically need the blueprint because the enhanced input system requires one so you can use the input action data assets properly?

You need to create a UActionInput variable in your .h file:

UPROPERTY(EditAnywhere, Category = Input)
UInputAction* LCAction;

You then have to create a Input Action blueprint, set your inputs there, and set this blueprint as your LCAction variable.

Finally, you have to do the same process for the Input Mapping Context. Create the Input Mapping Context blueprint, set your input action in that blueprint, create the UInputMappingContext* variable in your .h file, and set the Input Mappeing Context blueprint as that variable.

It’s okay man. People really seemed to struggle with understanding what I was asking and I don’t know any other way to phrase it. I basically got my answer though. Thanks.