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"

Enable Input Doesn't Work For Other Character

Hello community.

I have a problem enabling input for my main character. I have two characters, the player's main character (ThirdPersonCharacter) and another character (an NPC). Enable input works normally for the main character when overlap events are generated from other objects, but as soon as an overlap event is generated from the NPC, input is not enabled for the main character. The Enable Input node gets executed correctly.

The specific overlap event and 'Enable Input' node are located in the NPC's Blueprint, and at first I thought that I had to connect the "Target" input pin of said node with the character's Controller, but that didn't work either.

To sum up: There are two characters, 'Enable input' in the BP of one of them doesn't enable input on the other one. Note that I did connect the 'Target' input pin to the corresponding player's controller.

Product Version: UE 4.12
more ▼

asked Nov 11 '16 at 02:10 PM in Blueprint Scripting

avatar image

1 1 2 5

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

2 answers: sort voted first

Thanks for the answer.

Sorry, but I don't think this works. I know it has been answered multiple times, but I have a feeling that I don't understand something in the process. I don't want to control any other actor; I just want to enable input on my character (which is already possessed with a controller), when an overlap event is generated with another actor- and I want to do this from that actor's (NPC) blueprint.

Here is the blueprint that is supposed to work (NPC's BP- doesn't work):

alt text

And here is what I wanted to do and doesn't work either:

alt text

Any further help would be appreciated!

1.png (130.7 kB)
1.png (113.3 kB)
more ▼

answered Nov 12 '16 at 03:22 PM

avatar image

1 1 2 5

avatar image CrimsonHawk Nov 13 '16 at 10:49 AM

Aha! Then this whole thing should be at your player's blueprints especially the E input one. Because this way it still would mean that the actor should know about the inputs of the player, which still requires a player controller. So put the E - Print string in the player controller blueprint at least. By the way, disable /enable input is probably not the best way to do this, because it disables every input for the game. Even Esc for the menu and such.

avatar image mpotsos10 Nov 13 '16 at 03:17 PM

I see! Thanks, I will try it out and let you know how it works.

Also, what do you suggest as a best practice instead of enabling/disabling input? Because I'd like some key events (ESC, etc.) to be enabled at all times, and other events (e.g. E, F, etc.) to be enabled some times only.

avatar image CrimsonHawk Nov 14 '16 at 12:24 PM

I'd use a bool variable, and after every input node, I'd put a branch with it (except for buttons like Esc)

avatar image mpotsos10 Nov 14 '16 at 03:50 PM

Thanks a lot!

The solution you proposed above worked like a charm. But I'm not quite sure what the problem is; Is it that characters and pawns cannot send input commands to other characters/pawns? And if yes, then why?

avatar image CrimsonHawk Nov 14 '16 at 05:43 PM

The only object that can see the the player's inputs is the player controller. This should represent the will of the player. It is the rat from the movie Ratatouille. Only those pawns know what the rat want, whom has it in their hat. But the rat can still "talk" to the other actors with events, if the controller gets somehow its reference, or something. Is it clear this way? :D

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

If you want another actor to receive inputs, it needs to be possessed by a PlayerController. If you want to control one actor at a time, then you can use Get Player Controller(0) - Possess (The actor). But if you want to control two actors at the same time, you have to make a 2nd Player Controller, and possess it with that.
But this question has been asked multiple times already in different ways.

more ▼

answered Nov 12 '16 at 01:47 PM

avatar image

531 25 25 43

(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