How to make it so enemies only move towards the player when the player is colliding with an object

It’s more so when you touch an object with the tag “light” then any object with the tag “enemy” will become active and move towards the player.

One way of doing this is by finding your GameObject “Player” ex:

Player = GameObject.Find(“Player”);

Afterwards using the Player.transform.position as target position.