Question by
KenaiChoppa · Jul 25, 2018 at 03:27 AM ·
instantiateprefablist of lists
Can´t add objects to a list
I create 4 object with my HUD script and I want to add this created object (they are random) to a list. I have been hours trying to make this work. I get no error, they just doesn't apear in the list (but the code runs correctly). In my HUD script i got:
public List<S_Arrow> Arrows;
private void Awake()
{
Flechas = new List<S_Arrows>();
}
public void AddArrowList(S_Arrow Script)
{
Arrows.Add(Script);
}
And in the Arrow scripts I got this:
void Start()
{
GM.GetComponent<GameManager>().AddArrowList(this);
}
I know is a simple problem but I can't find a way to fix it, I have been searching but and looked the code many many times. They just doest apear in the list. Thanks
Comment
Your answer
