Exemplo n.º 1
0
    void Start()
    {
        //Rotation is already done during the creation of the bullet.
        //We just have to add the velocity locally, adapt it to global world (TransformDirection) and let the shells hit the ground.

        bulletself.velocity = transform.TransformDirection(Vector3.right * speed);

        Rigidbody2D.DestroyObject(gameObject, lifeSpan); //Self destroyed after x (float) seconds
    }