Unity beginner tutorial. Learn how to animate and control a 2D sprite using only mouse input.


Subscribe to Oxmond Tutorials:
https://bit.ly/SubscribeOxmondTutorials

Download free helicopter animation sprites here:
http://paulmakegames.blogspot.com/2017/04/attack-helicopter-animated-sprite.html (by Paul Chin)

Download Unity here:
https://unity3d.com/get-unity/download

Music by:
Max McFerren


Helicopter script:

/* .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © OXMOND / www.oxmond.com */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Helicopter : MonoBehaviour {

	void Update () {

        if (Input.GetMouseButton(0))
        {
            transform.Translate(0f, 0.1f, 0f);
        }
        else {
            transform.Translate(0f, -0.1f, 0f);
        }
		
	}
}