Created
January 18, 2015 17:36
Fireball Script for Unity
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
#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