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"

Getting input from specific Gamepad?

Hello,

I'm setting up a character selection screen for a local multiplayer game. Try to think of a Gauntlet style game, where before gameplay, each player can flip through characters on the HUD and select one, once everyone has picked a character the game begins and you spawn as your selected character.

I have the UI setup to show the models and I can flip between them using mouse clicks on a specific button, but how can I let each individual player pick their hero? I don't see a way to get a specific gamepads input. i.e. Gamepad 2 left and right Dpad. Is this something that could come in an update? It would be really helpful I imagine for local multiplayer games. I read about a c++ method that overrides a viewport functions, but I'm at a loss for doing this in blueprint.

Otherwise I'll have to make a ton of extra HUD nodes, and do character selection one at a time, with the illusion that only one person can pick their character, which just isn't going to cut it for what I'm working on. Perhaps I need to make a playerController BP for each player?

Thanks

John.

Product Version: Not Selected
Tags:
more ▼

asked Oct 28 '14 at 06:18 AM in Blueprint Scripting

avatar image

esquire
36 5 10 17

avatar image alperenakyuz Oct 28 '14 at 07:14 PM

As far as I know there is no way of doing this in BPs. It's painful in splitscreen too. UE4 sees both the keyboard and Gamepad as player 1 input.

avatar image alperenakyuz Oct 28 '14 at 07:16 PM

You can always get the HUD of player 1 and create a custom event/interface message for "P2 selects" and call it from P2.

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

1 answer: sort voted first

Well I just found a 'Was Input Key Just Pressed' which returns a boolean, and can take in a player controller with an index. So using some clever branching, and a ton of nodes, I can check to see if a certain player just pressed the button, whenever that button is pressed.alt text

I only have 1 gamepad with me currently so I can't check player 2, but I think it should work for now.

gamepadbuttons.jpg (103.1 kB)
more ▼

answered Oct 28 '14 at 07:25 PM

avatar image

esquire
36 5 10 17

avatar image DiFFtY Mar 11 '16 at 08:26 PM

Neat trick man. Thanks a lot for sharing this little tip. I tried it with 2 gamepads and it worked like a charm.

I made a function out of this in my level BP, you connect it to a gamepad event, plug the key variable to the function argument, and it returns the associated player number! alt text

avatar image ErtieZone Nov 11 '18 at 01:43 AM

WOW!! They really make it weird, don't they. Thanks for sharing this. I still would need this to actually work upon "InputAction" and not raw keys. But it's something.

(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