- Home /
How to use 2 Character Controllers in a scene
I am making a tank game and I want it to be so that one person can control one tank using the WASD keys and the other player can control the tank with the arrow keys. I hope that someone can help me out with this.
$$anonymous$$odify the scripts to support a second player and edit your input settings.
Yeah but the problem is, is that I am using a character controller and there is no script for that, it is just a default component in Unity.
@Jack423 - You right that a CC by itself does not move anything, but there are a bizillion scripts around both on UA, and in the Unity Wiki for moving an object using a CC. In addition, there are basic movement scripts in the Script Reference for CharacterControler.Simple$$anonymous$$ove() and in CharacterController.$$anonymous$$ove().
Yeah i understand that. I have a character controller set up but i want to make it so that my friends can play with me on the same keyboard but controlling a different object. I tried messing around with the FPSInputControler and when I changed the input settings, both of the keys controlled both of the objects. I hope you understand what I'm getting at.
It is hard to know where you went wrong without seeing the scripts. The steps:
Go to Edit > Project Settings > Input. Duplicate the entries for "Horizontal", "Vertical" and "Jump".
Redefine the keys for these three entries. $$anonymous$$ake sure that you don't have conflicts with either the primary buttons or the secondary buttons.
Duplicate the FPSInputController script.
Change the Input settings in the duplicated script to match the new entries in Input.
Attach the old FPS script to one object and the new FPS script to the other. $$anonymous$$ake you don't have multiple FPS scripts on each object.
Your answer
Follow this Question
Related Questions
Unity 2D Position Issues 0 Answers
Player rotates with camera(face same direction as the camera) 1 Answer
Weapon not updating position and moving as Player moves 0 Answers
Camera Problem 1 Answer