AI Trace to Attack

The true is printed when the trace hits the main character but it stays true never printing the false even if the trace is not hitting.
I am looking for the AI to attack when the trace is hitting the main character and stop when it is not.