Question by
caplancrunch54 · Apr 27, 2019 at 07:32 PM ·
rpgmenu screenbattle-system
cant get a target menu open JRPG
public void OpenTargetMenu(string moveName) { targetMenu.SetActive(true); Debug.Log("Target menu opene"); List Enemies = new List();
for (int i = 0; i > activeBattlers.Count; i++)
{
if (!activeBattlers[i].isPlayer)
{
Enemies.Add(i);
}
}
for (int i = 0; i < targetButtons.Length; i ++)
{
if(Enemies.Count > i)
{
targetButtons[i].gameObject.SetActive(true);
targetButtons[i].moveName = moveName;
targetButtons[i].activeBattlerTarget = Enemies[i];
targetButtons[i].targetName.text = activeBattlers[Enemies[i]].charName;
}
else
{
targetButtons[i].gameObject.SetActive(false);
}
}
}
}
im not sure if my list isn't being made or what
also I forgot to fix a for loop I changed it to be less than not greater than
my debug log says my function is being called
Comment
Answer by caplancrunch54 · Apr 27, 2019 at 07:33 PM
public void OpenTargetMenu(string moveName)
{
targetMenu.SetActive(true);
Debug.Log("Target menu opene");
List<int> Enemies = new List<int>();
this part didn't paste.. this goes at the top