transform.position,
transform.rotation);
instantiatedProjectile.velocity = transform.TransformDirection(Vector3 (0,-50,speed));///makes the bullets fire thewaythe ship is pointing
Physics.IgnoreCollision(instantiatedProjectile.collider,transform.root.collider);
//gravity down makes ball arc
Physics.gravity = Vector3(0, 0, 20);
Cheers bud that did the trick I actually tried that before but had a syntax error when doing so I am slowly getting there Cheers for the help bro much
Appreciated
In fact cheers to all the Unity Guys out there who help out Newbies !!
Look your making me well up pass me hankerchief
Hi bud
just added the line of code he suggested on the bottom of my script and it worked fine I think thats all i did but cant remember for sure
var projectile : Rigidbody;
var speed = 20;
var ammoCount = 10;
var lastShot = 0.0;
var reloadTime = 0.5;
var lightonnoff;
function Update () {
if (Input.GetKeyDown ("space")) {
if ( ammoCount <= 0)
return;//stops the code in its tracks when the above conditions are met
lastShot = Time.time;
ammoCount--;
var instantiatedProjectile : Rigidbody = Instantiate (projectile,
transform.position,
transform.rotation);
instantiatedProjectile.velocity = transform.TransformDirection(Vector3 (0,-50,speed));///makes the bullets fire thewaythe ship is pointing
Physics.IgnoreCollision(instantiatedProjectile.collider,transform.root.collider);
//gravity down makes ball arc
Physics.gravity = Vector3(0, 0, 20);
Destroy(instantiatedProjectile.gameObject, 3);//destroys the cannon bullets after 3 seconds
} }