Skip to content

Instantly share code, notes, and snippets.

@david-hodgetts
Created September 4, 2013 14:32
Show Gist options
  • Save david-hodgetts/6437790 to your computer and use it in GitHub Desktop.
Save david-hodgetts/6437790 to your computer and use it in GitHub Desktop.
unity 3d script for a very unrealistic flight model
using UnityEngine;
using System.Collections;
public class VeryNaivePlane : MonoBehaviour {
public float flightSpeed = 20;
public float rotationSpeed = 60;
void Update () {
transform.position += transform.forward * flightSpeed * Time.deltaTime;
transform.Rotate(Input.GetAxis("Vertical") * rotationSpeed * Time.deltaTime,
Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime,
-Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment