getting function to run when entering an area ???

my goal is to have an enemy’s chase function to start when the player enters the final area

i attempted to have the function run if a certain block was se to false but this didn’t work
i also have a score counter that i use to open a door in another script and thought if i could reference it in the enemy script it would get the function to run

code attached to enemy:


code with score counter (not main score counter only used to open the door before enemy area)

any help appreciated
thanks :slight_smile:

If you want to check if the door is active, you should use

if(!DoorToGo.activeSelf)

working now! thanks so much :slight_smile: