Shooting AI problem

I have two cubes that can fly around and shoot at eachother and avoid obstacles and all that but one of the cubes for some reason its bullets shoot itself. I think it's instantiating inside the cube but i'm not sure. how can i fix this? Could I possibly just move the instantiate point outside the cube? Heres the part of the script where it instantiates:

  if (distance < attackThreshold && Time.time - lastShot > shotRepeatTime ) {

            var instantiatedProjectile : Rigidbody = Instantiate(shot, myTransform.position, myTransform.rotation);

        instantiatedProjectile.velocity = transform.TransformDirection(Vector3(0, 0, shotSpeed));

            audio.Play();
        }

all the variables work fine and all just can't get one of the cubes to stop shooting itself. Also the other cube has the same script but it doesn't shoot itself and they are identical. Still can't figure that out though. Thanks!

The object where the bullets are instantiating has to be outside the cube's collider. so that if a bullet instantiates it doesn't collide with the cube itself.

i think this is your problem

is it because this one defiant cube is slightly bigger in scale than the rest? any how to get it to appear on an offset instead of

var instantiatedProjectile : Rigidbody = Instantiate(shot, myTransform.position, myTransform.rotation);

use

var instantiatedProjectile : Rigidbody = Instantiate(shot, myTransform.position+Vector3.forward*offset, myTransform.rotation);

then stick a variable at the top called `var offset : int = 1;` then you can change it in the inspector till it stops shooting itself