Possess more than one pawn/controller?

Hi all! For my game, when you interact with the NPCs, a chatbox pops up. You’re supposed to press the interact key/button every time to go to the next message, but input events don’t fire unless it’s possessed. Is there any way to possess more than one pawn/controller at the same time so I can achieve this? If not, what could be a way to achieve this?

Thank you very much! :smiley:

1 Like

I kinda got it to work:

http://i.imgur.com/BdzoBw3.png

And then I have the interact / slash event inside my NPC. I wish there were a better way to do this, but it works.

1 Like

Hello Paragonz9.

Is there any chance that you can share how you were able to possess more than one pawn with just one controller?

My problem is, I need to control two pawn at the same time and at the moment I am casting to a second controller in my first controller to make things work. But if there is any better way of doing it, I would appreciate if you share it. Thanks!

Hey there! I would, but here’s the thing: I didn’t. I couldn’t find a way, I don’t think it’s possible without any C++. There are workarounds, however, like the one I did above.

So to do what I did you make a blueprint interface and inside it you add a bunch of functions called after your inputs. “Interface_Left”, “Interface_Right”, etc. Then what you do is you implement that same interface into both your character and the other object/pawn that you wish to control.

Then you’d have to get the instance of the other object/pawn. In order to do this, as you can see above, I used the “Get All Actors with Interface” function, which gives me all the actors that use the Control Interface that I created. Then I do a “ForEachLoop” in order to guarantee that it gets fired at every single one of them, and the last thing you see, the “Interact/Slash” is just the name of the input function.

Now inside of your second object/pawn (the one not possessed), you would have “Event Begin name of input function”, and you would use that as if it were your input key.

Do you get what I mean? :slight_smile:

Yeah, np :stuck_out_tongue:

It is sad to see that there is always a work around, even at Controller section of UE4 it says “It is possible”, yet doesn’t tell how.

But yeah I get what you mean. Thank you for sharing your way. :slight_smile: