- Home /
stop weather particles from entering buildings?
I'm working on a weather system for my top down 3d RTS project. The RTS is zoomed in (like timber and stone) so players can move in and out of buildings. The problem is that the weather particles fall through the buildings so it's currently snowing inside the houses.
Is there a way to script the particle system so it will terminate a particle when it hits a particular collider or tagged game object? I use C#.
Answer by devstudents · Nov 30, 2014 at 07:34 PM
Attach a world particle collider to the particle object. You can determine which layer the particles collide with and what happens to the particles when they hit the collider. For my purposes, I set all the values to 0 and that seemed to work well.
http://docs.unity3d.com/Manual/class-WorldParticleCollider.html
Answer by devil304 · Nov 30, 2014 at 08:45 AM
You may off rendering particles when player is inside. (Sorry for english)
Thanks for your response but that wouldn't work for my game as the weather can still be seen when the player is inside. When the player goes inside, the roof renderer is disabled so I can see the player in the building but the surrounding environment is still visible. It would look pretty weird if it stopped raining every time a unit went into a building! :)