- Home /
Can virtual joysticks be used as joysticks in the input menu
I am trying to make a game for Android, and want to use the dual joystick prefab to control the character however i need a rigidbody controller and do not want to modify too much of my code. I would like to know if there is a way to use virtual joysticks as input in project settings > Input
Answer by tanoshimi · Nov 24, 2013 at 09:59 PM
No. The Input Manager is for defining virtual axes mapped to real device input - keyboards, joysticks, or mouse. The virtual joysticks effectively perform the same role - defining virtual axes based on touch position on the screen.
Whether you use the input manager or the virtual joysticks you'll still need to add code. It's just that rather than:
var h = Input.GetAxis("Horizontal");
you'll need:
var h = joystick.position.x;
Here's a beginner's guide you might find helpful.
Your answer
Follow this Question
Related Questions
Making one directional virtual joystick OR smoothly transitioning between buttons 0 Answers
How to make floating mobile keyboard in mobile game ? 0 Answers
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
How to make first person game with joysticks? 0 Answers
Combining first person contoller and dual touchpads from standard assets 0 Answers