Problems in Binding Input

I want to create a Log entry when the button T is being clicked. Here’s my code:


ALightSpawnPawn::ALightSpawnPawn()
 {
     PrimaryActorTick.bCanEverTick = true;
     AutoPossessPlayer = EAutoReceiveInput::Player0;

     RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
     OurVisibleComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("OurVisibleComponent"));	
     OurVisibleComponent->SetupAttachment(RootComponent);
 }

  void ALightSpawnPawn::BeginPlay()
  {
     Super::BeginPlay();
  }

  void ALightSpawnPawn::Tick( float DeltaTime )
  {
     Super::Tick( DeltaTime );
  }

 void ALightSpawnPawn::SetupPlayerInputComponent(class UInputComponent* InputComponent)
 {
     Super::SetupPlayerInputComponent(InputComponent);
     InputComponent->BindAction("ToggleLight", IE_Pressed, this, &ALightSpawnPawn::ToggleLight);
 }

 void ALightSpawnPawn::ToggleLight()
 {
      UE_LOG(LogTemp, Warning, TEXT("T pressed"));
 }