Best way to do an AI

I am trying to create an AI where if an object come close to the AI object it checks its tag and attacks if is enemy to it. Would a Raycast be the best way to go about this or is there a better way that would detect it easier?

use the RAIN{Indie} plugin from the assetstore, that is what I use for all my AI stuff.