hi, im doing a mini project with a group of friends and it is my job to program and build the level. i have the rain script and material attached to the First Person controller but i don’t understand how to turn the rain off whenever the player enters a building? i only it to rain while the player is outdoors. there are no windows on the building so i don’t need it to rain at all because the player wont be able to see it once indoor.
any help is appreciated thanks :slight_smile:

I’m not sure of your exact setup at all. However, you could place a trigger inside your building and make it the size of your building. Place a script on the trigger that disables the rain script when the player enters the trigger, and enables the rain script when the player exits the trigger.

// trigger script

void OnTriggerEnter(Collider other) {

    if(other.gameObject.tag == "Player") {
        //disable rain script
    }
}

void OnTriggerExit(Collider other) {

    if(other.gameObject.tag == "Player") {
        // enable rain script
    }
}

Just use a trigger and connect the gameobject with the particle effect to that trigger.
Then just use OnTriggerEnter() and OnTriggerExit() to enable or disable the effect.

Edit:Aahhh typing at the same time. :smiley: