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.
- My 3d sound actually stays behind.
- 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?