Why doesn't this ai work?

the ai is supposed to patrol around until they see the player and they should start to chase the player until they lose sight of him but as soon as the ai sees the player it gets stuck and doesn’t move, but starts moving when they lose sight of him

I haven’t worked extensively with UE since the days of UDK, but programmatically it looks like you’re attempting a do-while loop (complete an action if conditions are met). If that’s the case, it doesn’t look like you’re telling the do portion to do anything. I’m still waiting for UE 5 to finish installing, but give this a look and it should explain what you’re missing.