Skip to content

Instantly share code, notes, and snippets.

@gph03n1x
Created January 18, 2015 17:36
Show Gist options
  • Save gph03n1x/804c6a72c294efc2b19c to your computer and use it in GitHub Desktop.
Save gph03n1x/804c6a72c294efc2b19c to your computer and use it in GitHub Desktop.
Fireball Script for Unity
#pragma strict
var bulletSpeed: float = 10000;
var projectile: GameObject;
function Start () {
}
function Update()
{
if(Input.GetKey (KeyCode.Q))
{
var clone : GameObject;
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.rigidbody.AddForce(transform.forward * bulletSpeed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment