Hey everybody, I’m having some trouble getting my touch controls to work right, and was wondering if anybody here has had experience with it.
I have my jump button linked to a guiTexture (as with my other controls), so it (in particular) was very easy to script for touch controls with a hitTest, but my left and right movement is a lot trickier.
The game in question is a 2D platformer. Currently the player moves by using this code:
var move : float = Input.GetAxis ("Horizontal");
if(move > 0){
rigidbody2D.velocity.x = move * maxSpeed;
}
if(move < 0){
rigidbody2D.velocity.x = move * maxSpeed;
}
How would I translate something like that to touch controls? It is essential that I use the input manager, because the gravity, speed, and other parameters have been fine tuned to make my character control exactly how I want. I wouldn’t know where to go to start hardcoding in all those values. I’m relatively novice.