lock ontro enemy

can sombody help me with locking ontro a enemy

I am with a team to make an rpg but we have a problem We need to select an enemy, but how can we do That can you help us

Your best bet is probably to have a trigger or raycast that will check if it's an enemy in the area. From there you'd set the enemy as the target once they enter the area.