Hello.
I think im not sure if i understood this perfectly so here we go.
private void SetLaneSpawner()
{
AttackerSpawner [] spawners = FindObjectsOfType<AttackerSpawner>();
foreach (AttackerSpawner spawner in spawners)
{
bool isCloseEnough = (spawner.transform.position.y - transform.position.y) <= Mathf.Epsilon; //( Mathf.Abs(spawner.transform.position.y - transform.position.y) <= Mathf.Epsilon);
if (isCloseEnough)
{
myLaneSpawner = spawner;
}
}
}
1)So in this method we check for each spawner if its 0 or less.Then if its true then we assign the a new variable myLaneSpawner .
2) Now here comes what i dont understand.We call this SetLaneSpawner() method in Start.
In my logic this should run only on the begging then thats it.I mean the method does the calculation to bool isCloseEnough only a SINGLE TIME.Then how do we know if a new Lizard is spawning and whats his coordinate? I hope i could write normaly my question if not i try again ;).