Bullet Rotation Issue With Pooling

Hi, I Use Pool For My Shooter Game But I Have Issue With Rotation Of Bullet When Reuse In Pool

my pool

public GameObject GetFromPool()
     {
         if(avableobjects.Count == 0)
         GrewPool();

         var instance = avableobjects.Dequeue();
         instance.SetActive(true);
         return instance;
     }

     void GrewPool()
     {
         for (int i = 0; i < 5; i++)
         {
             var instanceToAdd = Instantiate(pooledObject);
             instanceToAdd.transform.SetParent(transform);
             AddToPool(instanceToAdd);
         }
     }

     public void AddToPool(GameObject instance)
     {
        instance.SetActive(false);
        avableobjects.Enqueue(instance);
     }

my bullet

void OnTriggerEnter(Collider hit)
    {
       if(hit.gameObject.tag == "Death")
        {
            PoolManager.Instance.AddToPool(gameObject);
        }
    }

my spawn

GameObject Bullet = PoolManager.Instance.GetFromPool();
if(Bullet == null)return;
Bullet.transform.position = CannonAim.transform.position;
Bullet.transform.rotation = CannonAim.transform.rotation;
Bullet.GetComponent().FireMe();

Not enough info.


“have issue with rotation” ??? which issue
read what you write please


code seems fine.


I suppose you use physics and bullet still goes all the way long…
so it’s still spinning, maybe velocity = vector3.zero