Reusing gameobjects causing erratictic movement

I am working on a top down shooter, just recently I changed my code to recycle a group a prefabs rather then create and destroy them over and over again. The group of gameObjects is contained in List. When I made the change the bullets starting moving in erratic directions instead of strait. I have no idea why this little change would have caused this problem unless there was something jacked in the movement code. I would be great if someone could take a look at my code and see if anything pops out.

This is the code to instantiate or reuse game objects.

        void HandleBullets()
        {
            bulletsLeft -= 1;
            tempVector = Quaternion.AngleAxis(8f, Vector3.up) * inputRotation;
            tempVector = (transform.position + (tempVector.normalized * 0.8f));

            var bullet = Bullets.Find(b => !b.active);
            if (bullet != null)
            {
                bullet.transform.position = tempVector;
                bullet.transform.rotation = Quaternion.LookRotation(inputRotation);
                bullet.active = true;
            }
            else
            {
                GameObject objCreatedBullet = (GameObject)Instantiate(scriptVariable.objBullet, tempVector, Quaternion.LookRotation(inputRotation)); // create a bullet, and rotate it based on the vector inputRotation
                Physics.IgnoreCollision(objCreatedBullet.collider, collider);
                Bullets.Add(objCreatedBullet);
            }
        }

And this is the movement code for the bullet, very basic.

    void Update()
    {
        if (gameObject.active)
        {
            timeSpentAlive += Time.deltaTime;
            if (timeSpentAlive > 2) // if we have been travelling for more than one second remove the bullet
            {
                gameObject.active = false;
            }
            // move the bullet
            transform.Translate(0, 0, moveSpeed * Time.deltaTime);
            transform.position = new Vector3(transform.position.x, 0, transform.position.z); // because the bullet has a rigid body we don't want it moving off it's Y axis
        }
    }

What is moveSpeed ? Is this properly set ?

moveSpeed is a float set in the unity editor, that portion is working fine, they move at the right speed. Its the angles that are all messed up

Forgive the crude diagram.
x: is the shooter.

  • : is the bullet

Before recycling

x - - - - - - - -

After recycling

       -    -
      -   - -    
x -  -    - 
    - 
     - 
      -

The bullets travel in one direction, but their individual headings seem to be jacked up.

No thoughts as to what could cause this?

Look at you rotation, maybe the bullets are not pointing the right direction ?

I’ve had a problem like this before. I found out that it was something to do with collider, i.e. the instances collided each other when instantiated. After I check “Is Trigger” in the prefab inspector, the instances no longer move errartically.