Created
January 18, 2015 17:36
-
-
Save gph03n1x/804c6a72c294efc2b19c to your computer and use it in GitHub Desktop.
Fireball Script for Unity
This file contains 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
#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