My Character AI Doesnt Work properly

Hi I have a problem with my code about basic enemy ai. I have written a code about an Enemy AI that runs to us and does an attacking animation when he gets near. Everything was OK but when i tried to equip my enemy ai with a sword the AI Character just drifts? Any solutions?

Hi, if this is related to a course, please post in thr Q&A.

If not, the question is too vague to be able to form an idea of the issue. I would also suggest asking in the discord instead as the members are quite active and may offer a solution. Either way, a lot more information is needed to provide help.