i follow this tutorial for making flapping bird, but my bird “no go up” when i touch the screen
this is my script
using UnityEngine;
using System.Collections;
public class SpermMovement : MonoBehaviour
{
Vector3 velocity = Vector3.zero;
public Vector3 gravity;
public Vector3 flapvelocity;
bool didFlap = false;
// Use this for initialization
void Start(){
}
//DO GRAPHIC & INPUT UPDATE HERE
void update() {
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0) ) {
didFlap = true;
}
}
// DO PHYSICS ENGINE UPDATE HERE
void FixedUpdate() {
velocity += gravity * Time.deltaTime;
if (didFlap == true) {
didFlap = false;
velocity += flapvelocity;
}
transform.position += velocity * Time.deltaTime;
}
}
please help