Trying to grab the object from the loop, then removing it from the inventoty

public void AddLogsToFire()
{
if (!playerIntrigger)
return;

        if (logsThatHaveBeenAdd() == maxLogs)
        {
            StartFire();
            DisableTrigger();
            return;
        }
        
        //count of how many logs we have added to the fire
        if (playerIntrigger && logsThatHaveBeenAdd() < maxLogs)
        {
            
            for (int i = 0; i < inventory.itemsInBagPack.Count; i++)
            {
                holdingTempsObj = inventory.itemsInBagPack*;*

}

if (holdingTempsObj.tag == “log”)
{
dropItem.DropItem(holdingTempsObj);
allLogs[logs].SetActive(true);
logs++;
}
else
{
Debug.Log(“this is not a log”);
}
}
}

Never mind I fixed it