Hi Everyone
This is my first post and I will jump right into it
I’m trying to make a spaceGame in the genre of WingCommander as a school project
and now I’m trying to make the ship fire bullets, here’s the script
var projectile : Rigidbody;
var speed = 200;
function Update () {
if ( Input.GetButton ("PlayerBulletShoot")) {
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, speed));
Destroy (clone.gameObject, 3);
}}
When my ship has no speed, there is no problem… the bullets fire.
BUT when my ship gets some speed, especially when it gets to the maxSpeed (800), then I’m faster then my bullets…
I tried putting the bullet speed higher but it didn’t work :s even at a bullet speed of 1500 it didn’t work.
I hope someone know a solution, thanks for reading