Trigger: leaving particle effect behind

I’ve made a Dynamic weather system for my game. And since it is a big world the player run around in, I decided to put the different weather types on the player. I mean the particle effect for the rain and snow as childs on the player.

However when the player goes inside somewhere I obviously dont want the rain or snow to keep falling inside. So I made a trigger, that when the player enters it removes the rain or snow and puts it on the trigger. I figured with this I solved two problems.

  1. My 3d sound actually stays behind.
  2. My particle effect does not follow the player inside.

This works relativly good. I use OnTriggerEnter for this so the particle effect gets removed as soon as the player enters it. However if the player does a weird turn or such the particle effect sometimes stays on the trigger and the player can run away from the effect. This destroys part of the feeling since the effect no longer follows the player, and you can see how the circle of rain looks.

I’m quite clueless how I could go at this at another angle. I have also tried using OnTriggerExit, which works a little better but the player could still “fool” or “bug” their way away from the effect.

So my question is: Is there a better way of doing this? Has anyone else solved this problem without getting the same hickups I do?

I solved this by using two triggers as you said. I still need to figure out some ideas for it, but the way I’m doing it now is like this. I have two triggers with some room between them so the player cannot accidentally turn on and off the system but walking quitly in and out. Instead they have to walk through one trigger to turn it off, and on to turn it on. I still haven’t finished all of it, since I need to figure out what happens if I have two exits, but for that I do have an idea. :slight_smile:

My idea, is anyone wants to keep reading is that I will have my particle effects attached to the triggers and I could also control how many exits an area has with how many exits triggers it has. By knowing this I can turn on the particle effect for each exit trigger so no matter where the player exits they will still get the rain. :slight_smile: