 <p>I think the error is <code>OnUpdate()</code> in <code>WithinSight</code> class. When you do the return it never does this <code>gameObject.tag = "Untagged";</code></p> <p>Change the order of the lines like this.</p> <pre><code>public override TaskStatus OnUpdate() { for (int i = 0; i &lt; possibleTargets.Length; ++i) { if (withinSight(possibleTargets [i], fieldOfViewAngle)) { target.Value = possibleTargets [i]; gameObject.tag = "Untagged"; return TaskStatus.Success; } } return TaskStatus.Failure; } </code></pre> <p>I can't reproduce this scenario, but this code won´t go back to a previuos cube. In case you want that you should save a reference of the last cube the sphere moved towards and do the comparisons in <code>OnUpdate()</code> of <code>WithinSight</code>.</p>