Question by
CCGnomes · Oct 10, 2016 at 06:06 PM ·
2dtouch controlscontrols
How to : Tap and hold to go down. Double tap and hold to go down faster?
Basically been using this code to make my character movement in 2d side scroller.
Not sure of the syntax since I'm not looking at my code.
if(Touch.tapcount ==1){
if(Input.GetMouseButton(0)){
Rigidbody2D.AddForce(force);
}
}
if(Touch.tapcount>1){
if(Input.GetMouseButton(0)){
Rigidbody2D.AddForce(force2);
}
}
The problem with this is that it is constantly increasing the tap count +1 in the update method when I hold it down so it is always running the second part of the code with force2.
How can I use GetMouseButtonDown instead and have rigidbody add force constantly while they hold down. --- Or is there a better way I should be making my character move?
The whole point is to be able to later use a Double tap and hold to make the player go down faster.
Comment
Your answer