- Home /
How to control 2 characters
Hello, here I am again to pick the brain of Unity Answers, I want to implement a way to have 2 characters that I can control, when controlling one character the other character waits/follows, but have not been able to find any reference material that can guide me as to how to control one or the other by pressing a key on the keyboard. If any one has any clues where I should start or how to go about doing something like this it would be greatly appreciated. The best example of what I want to do would be Conflict Desert Storm.
Well, if you can control one character you can just use the same script for the other. All you need is a way to switch between the two. I'm not familiar with Conflict Desert Storm, so a wild guess would be to just have one camera per character. The script would have to switch between those cameras and it also would have to take care of making sure that you control the character that you see. Either have some variable that deter$$anonymous$$es which character is playable or perhaps have an array of characters (in case if you plan on using more than just two) and just switch between the arrays entries.
@ShadoX Thanks first I used the car get in out script but it was too clunky now I am using a simple gui with a few buttons thanks for the help.
Answer by Joyrider · Aug 11, 2013 at 05:42 PM
yeah, like ShadoX said, just have a variable you check to activate/deactivate the character control scripts and the character follow scripts.
It should be pretty straightforward.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
character switching on collision 1 Answer
About Character Control :D 1 Answer
character switching problem 1 Answer
Unity Strafing Script 2 Answers