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 Use Custom Input Component

I wrote my own Input Component. I am now trying to figure out how to set it up so my controller will use my custom input component rather than it's inherited one.

 void APlayerController::SetupInputComponent()
 {
     Super::SetupInputComponent();
 
     check(InputComponent);
     
     if (!CharacterInputComponent)
     {
         CharacterInputComponent = NewObject<UCharacterInputComponent>(this);
         CharacterInputComponent->RegisterComponent();
         CharacterInputComponent->bBlockInput = false;
         CharacterInputComponent->Priority = 0;
 
         if (UInputDelegateBinding::SupportsInputDelegate(GetClass()))
         {
             UInputDelegateBinding::BindInputDelegates(GetClass(), CharacterInputComponent);
         }
     }
 }

I am currently trying this way but the custom input component never seems to get activated.

Product Version: UE 4.15
Tags:
more ▼

asked Apr 15 '17 at 03:48 PM in C++ Programming

avatar image

Janyx
469 65 62 211

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I figure it out. I was missing this step

 this->PushInputComponent(CharacterInputComponent);

Where this is the player controller. You need to push it onto the stack in order for it to be looked at.

more ▼

answered Apr 15 '17 at 04:02 PM

avatar image

Janyx
469 65 62 211

(comments are locked)
10|2000 characters needed characters left
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