I am using this code to make a fly.
void Update () {
// Fly
if (Input.GetKeyDown(KeyCode.Space))
GetComponent<Rigidbody2D>().AddForce(Vector2.up * force);
}
But everytime i push and hold my space button the fly still fall like the simple press space button. Im just thinking if is it possible to have press and hold function to make it fly up? I dont have idea what should i start. Please share.
I forgot to tell, i dont use ground so actually the player keep falling, i added rigidbody to it and i want to add tap and hold function to make it fly, and keep fall if i release the tap.
Sorry for my english. I hope you understand what i mean