I see the way your doing it and I think that that is a unneeded approach to what you are trying to do. When ever I work with bullet spawns I would either use ray cast and there's a billion tutorial on that or the best option for what your doing is to make a bullet spawn object.
Create a empty game object
Name it as Desired
Position it linked to the tank's barrel as a child and rotate it to the desired degree
Then fix the code...
var firePos : Transform;
function ShootCannon(){
//this is the bullet creation
var instance = Instantiate(Bullet, firePos.position, firePos.rotation);
instance.velocity = transform.TransformDirection (Vector3.forward * BulletSpeed);
//note: I want the rotation of the actually fireing to have an
//angle of +20 degrees from which the bullet comes out of.
In my opinion this is a very simple and effective way to solve your issue.
***Warning Did not Test Code so there may be some simple errors but I dont think so...***
↧