- Home /
Question by
speedyfast734 · Aug 30, 2020 at 04:19 AM ·
inventoryremovelooping
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[i];
}
if (holdingTempsObj.tag == "log")
{
dropItem.DropItem(holdingTempsObj);
allLogs[logs].SetActive(true);
logs++;
}
else
{
Debug.Log("this is not a log");
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Problem with removing an item from a list 0 Answers
How can I remove an item ffrom a list. 1 Answer
OnTriggerEnter / Inventory question?! 1 Answer
Need help with inventory 0 Answers
BurgZerg Arcade inventory system tutorials... Incomplete!! 1 Answer