How can I control an animated character?

Hi Everyone,

I am just learning how to create basic games and bucking the trend (joke) by starting with a Flappy Bird imitation.

I have created a bird and animated it so that the wings flap. Does anyone know how I can control this bird so that it moves up when I hit the spacebar?

I can do it to non animated characters using the following script:

using UnityEngine;
using System.Collections;

public class PlayerControl : MonoBehaviour {

// Use this for initialization
void Start () {

// The force which is added when the player jumps
// This can be changed in the Inspector window
public Vector2 jumpForce = new Vector2(0, 300);

// Update is called once per frame
void Update () 
	// Jump
	if (Input.GetKeyUp("space"))
		rigidbody2D.velocity =;



Found the answer here → - YouTube

and here —> - YouTube