- Home /
Unique Car Demo Controls?
I'm trying to make a version of the Car Demo that is split screen multiplayer. I have the split screen and cameras worked out, but can't figure out how to have one car controlled by arrow keys and the other by wasd. Both cars get their controls from Input.GetAxis("Vertical") and Input.GetAxis("Horizontal") and when I try using things like the Input.GetKey, or Input.GetKeyDown commands it returns an error. Anybody have any ideas on how to make this work?
Seems like the Input.getkey functions should solve your problem. What code did you try and what error did you get?
Answer by chris_taylor · Feb 28, 2014 at 06:01 PM
If you are just replacing Input.GetAxis("Vertical") with Input.GetKey() you will get an error because they return two different things, GetAxis returns a flow where GetKey returns a bool. If you still want to use GetAxis go into the input settings and add Vertical_p2 and Horizontal_P2. With this you can have a bool or enum or int playerID to mark who should control what and switch the strings out depending on who is in control. If you want an example let me know if you are using unityscript or c#
Your answer
![](https://koobas.hobune.stream/wayback/20220613134711im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
How do I create WASD controls for a fps? 3 Answers
Vehicle/car/ Movement 0 Answers
audio fades 0 Answers