I have used exactly the same code as used by Rick, but once IsAttackerInLane() evaluates to true it keeps true without switching to false as it should.
See how only “shoot pew pew” increases in the number while “sit and wait” sticks at the same number that it reached once I hit play button.
I suspect that this following code is the problem. Because once the childCount is gretater than one it will always evaluate to be true. But I am not sure because Rick didn’t face the same problem. Please help…
private bool IsAttackerInLane()
{
//myLaneSpawner = FindObjectOfType();
if (myLaneSpawner.transform.childCount <= 0)
{
return false;
}
else
{
return true;
}
}