Why doesn't my pawn accept any inputs?

I’ve been having this problem all day and for the life of me can’t seem to figure out what I could be missing. I’m attempting to add a simple space bar input to my pawn, where I press space, the pawn destroys itself and spawns in a “rocket”. Here is what I have so far:

MyPawn.h

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

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "MyPawn.generated.h"

UCLASS()
class TESTINPUT_API AMyPawn : public APawn
{
	GENERATED_BODY()

public:
	// Sets default values for this pawn's properties
	AMyPawn();
	UPROPERTY(VisibleAnywhere)
		UStaticMeshComponent* VisualMesh;
	UPROPERTY(EditAnywhere)
		int dir = 1;

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	void SpawnRocket();

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
};

MyPawn.cpp

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


#include "MyPawn.h"
#include "Kismet/GameplayStatics.h"
#include "Rocket.h"

// Sets default values
AMyPawn::AMyPawn()
{
 	// Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	//set mesh
	VisualMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
	VisualMesh->SetupAttachment(RootComponent);

	static ConstructorHelpers::FObjectFinder<UStaticMesh> CubeVisualAsset(TEXT("/Game/StarterContent/Shapes/Shape_Cube.Shape_Cube"));

	if (CubeVisualAsset.Succeeded())
	{
		VisualMesh->SetStaticMesh(CubeVisualAsset.Object);
		VisualMesh->SetRelativeLocation(FVector(0.0f, 0.0f, 0.0f));
	}
	
	AutoPossessPlayer = EAutoReceiveInput::Player0;
}

// Called when the game starts or when spawned
void AMyPawn::BeginPlay()
{
	Super::BeginPlay();
}

// Called every frame
void AMyPawn::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

// Called to bind functionality to input
void AMyPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);
	InputComponent->BindAction("SpawnRocket", IE_Released, this, &AMyPawn::SpawnRocket);
}

void AMyPawn::SpawnRocket()
{
	Destroy();
	ARocket* newRocket = GetWorld()->SpawnActor<ARocket>(GetActorLocation(), GetActorRotation());
	newRocket->SetDir(dir);
}

And finally, the inputs inside the project settings.

I’m not sure what I could be missing? I set up the space bar input, created the spawn rocket function, bound the space bar to that function, and then finally had the player auto posses the pawn. What could I be missing? Any help is appreciated.

Maybe you have to “Possess” the character or “Enable input” on it. I only know how to do it via blueprints.

Its a pawn not a character if that helps. And binding the action should be the equivalent of enabling the input.

Sure but I mean:
-Bind it in the editor (like in the image)
-Enable input for your controller
https://answers.unrealengine.com/questions/167062/enable-input-in-c.html
-Test the space input IN your pawn via print string

Edit: Sorry IDK C++ coding, just BP.

I dont think this link is related to my problem. This is for adding input to a player controller, I am just trying to add input to a pawn.
Besides, I already attempted this through my pawn and got nowhere

Thanks, but I followed this video tutorial too. There isn’t anything in there that isn’t in my c++ class already. I’m beginning to almost think it could be a problem with Unreal?

Ok, I’?m sorry. Maybe this video I watched time ago can help you but is basically what we talked.

Good luck!

Hey, just solved this! And it did end up being a problem with the Engine itself. The way I solved it was I just deleted the project folder, restarted Unreal, and then restored the project folder. Worked like a charm after.