This makes sure the melee distance isnt less then the acceptable radius for the melee behavior. If the melee distance was set lower then the AI wont move close enough to that attack target to be able to play their attack animation, as the attack target would still be outside the Melee Distance.

Create a new function called SettingsCheck in the BP_SmartAIComponent and copy the image below.

Add the highlighted nodes shown in the image below, location at the top of the image.