Unity, character selection screen on same PC by two players
up vote
0
down vote
favorite
The game I am trying to make include local multiplayer to play on same PC. I have done by making the different controllers in input manager and game work perfectly fine.
But now I am onto the part where I have to create a character selection screen for multiple player on same PC. I am beginner to the unity and learning right now. So I have no idea how to make it happen. Because when I tried to make it unity UI didn't able to take two input. At a time
I have also watched some of the threads in which people suggested to make your own eventsystem and button but I tried doing that somehow buttons are not taking any response they are not clickable. If anyone has seen those thread and that method is working for them, so please let me know how to.make it work
Or if someone has any other idea how to do please let me know
Thanks in advance
user-interface unity3d multiplayer
add a comment |
up vote
0
down vote
favorite
The game I am trying to make include local multiplayer to play on same PC. I have done by making the different controllers in input manager and game work perfectly fine.
But now I am onto the part where I have to create a character selection screen for multiple player on same PC. I am beginner to the unity and learning right now. So I have no idea how to make it happen. Because when I tried to make it unity UI didn't able to take two input. At a time
I have also watched some of the threads in which people suggested to make your own eventsystem and button but I tried doing that somehow buttons are not taking any response they are not clickable. If anyone has seen those thread and that method is working for them, so please let me know how to.make it work
Or if someone has any other idea how to do please let me know
Thanks in advance
user-interface unity3d multiplayer
Could you provide code or screenshots of your current attempt?
– Skdy
Nov 20 at 7:35
Also can you elaborate on "unity UI didn't able to take two input. At a time" :)?
– Skdy
Nov 20 at 7:37
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
The game I am trying to make include local multiplayer to play on same PC. I have done by making the different controllers in input manager and game work perfectly fine.
But now I am onto the part where I have to create a character selection screen for multiple player on same PC. I am beginner to the unity and learning right now. So I have no idea how to make it happen. Because when I tried to make it unity UI didn't able to take two input. At a time
I have also watched some of the threads in which people suggested to make your own eventsystem and button but I tried doing that somehow buttons are not taking any response they are not clickable. If anyone has seen those thread and that method is working for them, so please let me know how to.make it work
Or if someone has any other idea how to do please let me know
Thanks in advance
user-interface unity3d multiplayer
The game I am trying to make include local multiplayer to play on same PC. I have done by making the different controllers in input manager and game work perfectly fine.
But now I am onto the part where I have to create a character selection screen for multiple player on same PC. I am beginner to the unity and learning right now. So I have no idea how to make it happen. Because when I tried to make it unity UI didn't able to take two input. At a time
I have also watched some of the threads in which people suggested to make your own eventsystem and button but I tried doing that somehow buttons are not taking any response they are not clickable. If anyone has seen those thread and that method is working for them, so please let me know how to.make it work
Or if someone has any other idea how to do please let me know
Thanks in advance
user-interface unity3d multiplayer
user-interface unity3d multiplayer
asked Nov 20 at 2:31
Paras Sharma
84
84
Could you provide code or screenshots of your current attempt?
– Skdy
Nov 20 at 7:35
Also can you elaborate on "unity UI didn't able to take two input. At a time" :)?
– Skdy
Nov 20 at 7:37
add a comment |
Could you provide code or screenshots of your current attempt?
– Skdy
Nov 20 at 7:35
Also can you elaborate on "unity UI didn't able to take two input. At a time" :)?
– Skdy
Nov 20 at 7:37
Could you provide code or screenshots of your current attempt?
– Skdy
Nov 20 at 7:35
Could you provide code or screenshots of your current attempt?
– Skdy
Nov 20 at 7:35
Also can you elaborate on "unity UI didn't able to take two input. At a time" :)?
– Skdy
Nov 20 at 7:37
Also can you elaborate on "unity UI didn't able to take two input. At a time" :)?
– Skdy
Nov 20 at 7:37
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
As far as I know, you CAN'T have more than one event system in the same scene.
So knowing that I'll suggest to change the...perspective about your game, here is something that can work:
You can't have more than one input on the same UI, but you can distinguish "keyboard" inputs. So let's guess the scenario that you have the screen divided in 2 parts, where left side is the Player 1 selection character, and can select between 2 characters, and right side is the Player 2 selection character, with the same number (or different, as you want!) of possible characters.
The pseudo code will be something like:
private Player m_player1;
private Player m_player2;
private CharacterSelection m_CharacterSelection_Player1;
private CharacterSelection m_CharacterSelection_Player2;
If (m_Player1.Input.GetKeyDown(KeyCode.A))
{
m_CharacterSelection_Player1.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.D)){
m_CharacterSelection_Player1.Right();
}
If (m_Player2.Input.GetKeyDown(KeyCode.LeftArrow))
{
m_CharacterSelection_Player2.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.RightArrow)){
m_CharacterSelection_Player2.Right();
}
Here is the visual representation about what I'm trying to tell you:
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
As far as I know, you CAN'T have more than one event system in the same scene.
So knowing that I'll suggest to change the...perspective about your game, here is something that can work:
You can't have more than one input on the same UI, but you can distinguish "keyboard" inputs. So let's guess the scenario that you have the screen divided in 2 parts, where left side is the Player 1 selection character, and can select between 2 characters, and right side is the Player 2 selection character, with the same number (or different, as you want!) of possible characters.
The pseudo code will be something like:
private Player m_player1;
private Player m_player2;
private CharacterSelection m_CharacterSelection_Player1;
private CharacterSelection m_CharacterSelection_Player2;
If (m_Player1.Input.GetKeyDown(KeyCode.A))
{
m_CharacterSelection_Player1.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.D)){
m_CharacterSelection_Player1.Right();
}
If (m_Player2.Input.GetKeyDown(KeyCode.LeftArrow))
{
m_CharacterSelection_Player2.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.RightArrow)){
m_CharacterSelection_Player2.Right();
}
Here is the visual representation about what I'm trying to tell you:
add a comment |
up vote
0
down vote
As far as I know, you CAN'T have more than one event system in the same scene.
So knowing that I'll suggest to change the...perspective about your game, here is something that can work:
You can't have more than one input on the same UI, but you can distinguish "keyboard" inputs. So let's guess the scenario that you have the screen divided in 2 parts, where left side is the Player 1 selection character, and can select between 2 characters, and right side is the Player 2 selection character, with the same number (or different, as you want!) of possible characters.
The pseudo code will be something like:
private Player m_player1;
private Player m_player2;
private CharacterSelection m_CharacterSelection_Player1;
private CharacterSelection m_CharacterSelection_Player2;
If (m_Player1.Input.GetKeyDown(KeyCode.A))
{
m_CharacterSelection_Player1.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.D)){
m_CharacterSelection_Player1.Right();
}
If (m_Player2.Input.GetKeyDown(KeyCode.LeftArrow))
{
m_CharacterSelection_Player2.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.RightArrow)){
m_CharacterSelection_Player2.Right();
}
Here is the visual representation about what I'm trying to tell you:
add a comment |
up vote
0
down vote
up vote
0
down vote
As far as I know, you CAN'T have more than one event system in the same scene.
So knowing that I'll suggest to change the...perspective about your game, here is something that can work:
You can't have more than one input on the same UI, but you can distinguish "keyboard" inputs. So let's guess the scenario that you have the screen divided in 2 parts, where left side is the Player 1 selection character, and can select between 2 characters, and right side is the Player 2 selection character, with the same number (or different, as you want!) of possible characters.
The pseudo code will be something like:
private Player m_player1;
private Player m_player2;
private CharacterSelection m_CharacterSelection_Player1;
private CharacterSelection m_CharacterSelection_Player2;
If (m_Player1.Input.GetKeyDown(KeyCode.A))
{
m_CharacterSelection_Player1.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.D)){
m_CharacterSelection_Player1.Right();
}
If (m_Player2.Input.GetKeyDown(KeyCode.LeftArrow))
{
m_CharacterSelection_Player2.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.RightArrow)){
m_CharacterSelection_Player2.Right();
}
Here is the visual representation about what I'm trying to tell you:
As far as I know, you CAN'T have more than one event system in the same scene.
So knowing that I'll suggest to change the...perspective about your game, here is something that can work:
You can't have more than one input on the same UI, but you can distinguish "keyboard" inputs. So let's guess the scenario that you have the screen divided in 2 parts, where left side is the Player 1 selection character, and can select between 2 characters, and right side is the Player 2 selection character, with the same number (or different, as you want!) of possible characters.
The pseudo code will be something like:
private Player m_player1;
private Player m_player2;
private CharacterSelection m_CharacterSelection_Player1;
private CharacterSelection m_CharacterSelection_Player2;
If (m_Player1.Input.GetKeyDown(KeyCode.A))
{
m_CharacterSelection_Player1.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.D)){
m_CharacterSelection_Player1.Right();
}
If (m_Player2.Input.GetKeyDown(KeyCode.LeftArrow))
{
m_CharacterSelection_Player2.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.RightArrow)){
m_CharacterSelection_Player2.Right();
}
Here is the visual representation about what I'm trying to tell you:
answered Nov 20 at 8:22
Lotan
1,150215
1,150215
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53385380%2funity-character-selection-screen-on-same-pc-by-two-players%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you provide code or screenshots of your current attempt?
– Skdy
Nov 20 at 7:35
Also can you elaborate on "unity UI didn't able to take two input. At a time" :)?
– Skdy
Nov 20 at 7:37