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 the keyboard for P1 and a gamepad for P2?

I'm working on a local multiplayer game on PC. I want to be able to have Player 1 use the keyboard, and Player 2 be able to use a gamepad.

I've done some research, and as of June the best answer was to extend GameViewportClient and override the InputKey/Axis functions; is this still the case?

Product Version: Not Selected
Tags:
more ▼

asked Oct 03 '14 at 05:37 PM in C++ Programming

avatar image

JonathanADaley
644 37 49 78

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

1 answer: sort voted first

All you have to do is in the Input settings create different key bindings for each player. For example you could bind W and S to P1_MoveForward and bind gamepad right stick up and gamepad right stick down to P2_MoveForward. Then in your code you could have the Player1 actor use P1_MoveForward to move forward and Player2 actor to use P2_MoveForward to move forward.

more ▼

answered Oct 06 '14 at 01:35 PM

avatar image

Namr2000
1 1 2 4

avatar image JonathanADaley Oct 06 '14 at 01:41 PM

I thought of that, but I'm wanting to have it be dynamic; meaning that if I had one player they could choose to use the keyboard or the gamepad. But if I had two players then player one would be keyboard and player two would be gamepad. So, I really need a way to be able to determine where the input should be routed during runtime.

(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