Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by GNLima · Feb 12, 2016 at 12:20 AM · multiplayercontroller

How to separate the player controls in a local multiplayer game at the same keybord

Hi Unity 3D community! I'm making a game with 3 characters for 3 players play at the same keyboard and everything is alright,except the fact that when I put my 3 characters at the game and press the walk button of one character, all the three walk too. I already tried to go to Edit /Project Settings /Input and create two more 'Horizontal' and put other commands to walk and jump, but happens the same thing.what can I do to solve this problem?

(sorry If the text has english issues, I'm brasilian)

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MaximumTre · Feb 12, 2016 at 03:29 AM 0
Share

Have you tried rena$$anonymous$$g the other keys something other than 'Horizontal' like 'Horizontal2' etc?

avatar image GNLima MaximumTre · Feb 12, 2016 at 11:50 AM 0
Share

thanks i will try it

avatar image itsharshdeep · Feb 12, 2016 at 04:21 AM 0
Share

Correct as per the @$$anonymous$$aximumTre but additionally you need to remove the alternate registered keys from already defined Axis ( like from vertical : 'Alt Negative button s', Alt Positive button w' need to be remove )

Sorry for bad English

avatar image GNLima itsharshdeep · Feb 12, 2016 at 11:50 AM 0
Share

thanks i will try it too

avatar image GNLima itsharshdeep · Feb 12, 2016 at 12:41 PM 0
Share

i tried what you had said but the keys of "Horizontal2" and "Horizontal3" don't work and when I press the keys of "Horizontal" the three walk together. Help me please

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by itsharshdeep · Feb 13, 2016 at 06:36 PM

Check the following detail :

 using UnityEngine;
 using System.Collections;
 using System.IO;
 
 public class Delete : MonoBehaviour
 {
     public enum Player { 
     Player1,
     Player2,
     Player3,
     }
         
     public Player choosePlayr;
     Vector3 direction;
 
     void Update() {
 
         switch (choosePlayr)
         {
             case Player.Player1:
                 direction.x = Input.GetAxis("Horizontal");
                 direction.z = Input.GetAxis("Vertical");
                 break;
 
             case Player.Player2:
                 direction.x = Input.GetAxis("Horizontal2");
                 direction.z = Input.GetAxis("Vertical2");
                 break;
             
             case Player.Player3:
                 direction.x = Input.GetAxis("Horizontal3");
                 direction.z = Input.GetAxis("Vertical3");
                 break;
             
            }
 
         Move();
     }
 
     void Move() {
         transform.Translate(direction.x, 0, direction.z);
     }
 }


You need to the do the following setting to make the script work:

alt text

alt text

Sorry 3rd image can't be attached here is following is the link to that image https://www.dropbox.com/s/ka3p72anf2eb7mi/Horizontal3.PNG?dl=0

Hope now you understand ( & I answered well ;) )


horizontal2.png (25.5 kB)
horizontal.png (22.2 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GNLima · Feb 24, 2016 at 11:11 AM 0
Share

i tried what you had said but the keys of "Horizontal2" and "Horizontal3" don't work and when I press the keys of "Horizontal" the three walk together. Help me please

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

62 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

thirdpersoncontroller multiplayer animations 0 Answers

Bumper Engine splitscreen Multiplayer?? 0 Answers

Implementing a crane asset in a multiplayer game 0 Answers

How to create and set different Player ID's to individual controllers? 1 Answer

Unity additional Device controller 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges