Created
September 4, 2013 14:32
-
-
Save david-hodgetts/6437790 to your computer and use it in GitHub Desktop.
unity 3d script for a very unrealistic flight model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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