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"

How to map actions and axis in player controller if possibl

is it possible to map actions and axes in the player controller rather than in the character, and if yes can someone explain the process of doing it.

Product Version: UE 4.8
Tags:
more ▼

asked Jun 11 '15 at 06:19 AM in Everything Else

avatar image

gogata258
115 35 29 34

avatar image MulleDK19 Jun 11 '15 at 11:12 AM

C++ or BP?

avatar image gogata258 Jun 11 '15 at 12:12 PM

c++ would be of preference

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

1 answer: sort voted first

Not only is it possible, it's where it should be. Override SetupInputComponent in your player controller and do all the bindings there.

Eg. (pseudo):

 void AMyPlayerController::SetupInputComponent()
 {
     Super::SetupInputComponent();
 
     this->InputComponent->BindAction("Walk", EInputEvent::IE_Pressed, this, &AMyPlayerController::OnWalkStart);
     this->InputComponent->BindAction("Walk", EInputEvent::IE_Released, this, &AMyPlayerController::OnWalkEnd);
 }


 void AMyPlayerController::OnWalkStart()
 {
     AMyCharacter* character = Cast<AMyCharacter>(this->GetCharacter());
     if (character)
     {
         character->SetWalking(true);
     }
 }
 
 void AMyPlayerController::OnWalkEnd()
 {
     AMyCharacter* character = Cast<AMyCharacter>(this->GetCharacter());
     if (character)
     {
         character->SetWalking(false);
     }
 }
more ▼

answered Jun 11 '15 at 12:39 PM

avatar image

MulleDK19
2.7k 161 274 254

avatar image gogata258 Jun 11 '15 at 12:45 PM

Thanks you a lot for the example

(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