How do I make the terrain responsive to the enemy?

I’m new with Unity and need help.

In my game, when the enemy is present in a space on the terrain, it changes (such as wind direction, audio and static effects). I want this to occur regardless if the player is looking at the enemy or not.

Look up how collider triggers work. Start with a box, turn isTrigger to true, create a script with something like so:

void Update()
    {
    if(collider.bounds.Contains(/*character position*/) == true)
    {
    //do stuff
    }
    }

Edit:

  • Create a box
  • Turn the mesh Collider OFF
  • Set the collider isTrigger to ON
  • Position the collider on the terrain
  • Add script to Enemy

public class MagicBoxOfDoom: MonoBehaviour {

public GameObject enemy;

// Use this for initialization
void Start ()
{

}

// Update is called once per frame
void Update ()
{
if(collider.bounds.Contains(enemy.transform.position) == true)
{
Debug.Log(“HEY! I AM IN THE BOX”);
}

}
}