- Home /
OP solved the problem.
Changing input to Character Controller from keys to touch screen
I'm using (my modified version of) a script from the Lerpz Unity 2D game tutorial called PlatformerController to move the player in a 2D game. The script requires a Character Controller be attached to the player to move. My script has been working just dandy with the arrow keys as input, but now I want to use touch screen buttons since this is designed for Android.
Nowhere in the script does it say "Input.GetKey(...);" yet the arrow keys work just fine. So I'm assuming the Character Controller gets its inputs by default from the Input Manager? Is there any way I can change the inputs using code, say a C# script attached to my GUITexture touch screen button?
The PlatformerController script uses the line "collisionFlags = controller.Move(currentMovementOffset);" to move the Character Controller, if that's helpful.
EDIT: Just kidding I figured it out, I just didn't understand how Input.GetAxis worked and I solved it.
Follow this Question
Related Questions
Touch Input madness 2 Answers
Touch joystick tutorials ? 0 Answers
Android Input 1 Answer
unity input system help 2 Answers
,How Do get Touch input to work with the Player Input Component 1 Answer