x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UE4 InputComponent not binding Actions/Axis mappings (C++)

Hey there,

Firstly, the InputComponent I am using is part of a PlayerController custom class called "PlayerControllerC", this will be used to manipulate the player: "PlayerCharacter". Right now, my code consists for 3 debugging actions to test, none of which are working; these are listed below:

 void APlayerControllerC::SetupInputComponent(/*class UInputComponent * InputComponent*/){
     Super::SetupInputComponent();
     check(InputComponent);
 
     InputComponent->BindAction("Move", IE_Pressed, this, &APlayerControllerC::MoveTo); // LMB
     InputComponent->BindAction("Test", IE_Pressed, this, &APlayerControllerC::Test); // C
     InputComponent->BindAxis("MoveX", this, &APlayerControllerC::MoveX); // D
 }
 
 -----------------
 
 void APlayerControllerC::MoveTo(){
     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, FString::Printf(TEXT("TEST")));
 }
 
 void APlayerControllerC::Test(){
     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, FString::Printf(TEXT("TEST")));
 }
 
 void APlayerControllerC::MoveX(float val){
     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, FString::Printf(TEXT("TEST")));
 }

When debugging the code, there's no issue with the InputComponent variable or the creating it, however none of the functions are called on their respective keys. The game is a TopDown(70degree) dungeon crawler, so I followed the TopDown method of constructing an InputComponent.

Can anyone please help and tell me why none of the functions are being called on the keypresses?

Product Version: Not Selected
Tags:
more ▼

asked Oct 22 '14 at 09:33 PM in C++ Programming

avatar image

Karner
90 9 10 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Although this is a late response, I fixed this error by calling "Super::Tick(DeltaSeconds" inside my tick override function.

more ▼

answered Nov 16 '14 at 11:27 AM

avatar image

Karner
90 9 10 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question