Thank you for the tutorial! For anyone else using this in an FPS project and would like for their rain to be slightly offset from the players movement for a more believable look, I created a script to smoothdamp the rain to the players position over a small amount of time - this just adds to the look a bit. I imagine you will likely need to play with the numbers a bit for your personal project. (Careful where I put Vector3(dot)zero; I need to remove the link so youtube doesn't mark the comment as spam) public class Rain : MonoBehaviour { /// /// The point of this script is to have the rain follow the player at a slight offset /// this makes it so that as the player runs the rain doesn't match u perfectly, makes the rain more believeable as u run past some particles /// //rainSmoothSpeed is how fast the rain will smoothdamp to the player pos, .2 seconds right now private float rainSmoothSpeed = .2f; //player public Transform player; //player pos Vector3 currentPlayerPos; private Vector3 velocity = Vector3(dot)zero; // Update is called once per frame void Update() { //player pos but I'm adding -20 to the X because it seems like the particle zone does not use the center, offset to keep player near the center of the particle zone //also setting y to 15 to keep it above player (its rain) currentPlayerPos = new Vector3(player.localPosition.x - 20, 15, player.localPosition.z); //do da smoothdamp to player pos transform.position = Vector3.SmoothDamp(transform.position, currentPlayerPos, ref velocity, rainSmoothSpeed); } }
you could just set the world space of the system to world instead of local in the settings, then the particles will stay attached to the world instead of the player but will still spawn around it
@@RecombobulatedStuff The main point of this script is to keep the particles from sitting in the same spot while the player moves around to give the effect that the rain is in the world while it follows the player. I don't think your solution would do the same thing.
@@AvianFluu That's exactly what it does. If the particle positions are relative to world space then even if the emitter moves the particles don't follow the emiiter because they aren't relative to emitters position which is what local means, using world space looks more realistic than using local with a lerp/smoothdamp and it's its intended function.
Hello I have a question, Collision's type I choice world then i will have two problem. 1. when the shape scale too big ,rain will through my floor and house 2.when so many object in the Particle System range that will have the same problem
The thing is when it's covering a large area the particles will constantly run even when the player isn't in that part of the map making it lag or drop fps, witch you don't want, and you could use Occlusion Calling or make a chunk base system to only render the particles when the play is near.
you gotta change the simulation space from local to global. This way the particles stay where they fall and wont follow the player. Alternatively another approach would be using a GFX-Graph als these are made for large amounts of particle effects in paticular
Thank you for the tutorial! For anyone else using this in an FPS project and would like for their rain to be slightly offset from the players movement for a more believable look, I created a script to smoothdamp the rain to the players position over a small amount of time - this just adds to the look a bit.
I imagine you will likely need to play with the numbers a bit for your personal project.
(Careful where I put Vector3(dot)zero; I need to remove the link so youtube doesn't mark the comment as spam)
public class Rain : MonoBehaviour
{
///
/// The point of this script is to have the rain follow the player at a slight offset
/// this makes it so that as the player runs the rain doesn't match u perfectly, makes the rain more believeable as u run past some particles
///
//rainSmoothSpeed is how fast the rain will smoothdamp to the player pos, .2 seconds right now
private float rainSmoothSpeed = .2f;
//player
public Transform player;
//player pos
Vector3 currentPlayerPos;
private Vector3 velocity = Vector3(dot)zero;
// Update is called once per frame
void Update()
{
//player pos but I'm adding -20 to the X because it seems like the particle zone does not use the center, offset to keep player near the center of the particle zone
//also setting y to 15 to keep it above player (its rain)
currentPlayerPos = new Vector3(player.localPosition.x - 20, 15, player.localPosition.z);
//do da smoothdamp to player pos
transform.position = Vector3.SmoothDamp(transform.position, currentPlayerPos, ref velocity, rainSmoothSpeed);
}
}
thanks very much good sir/madam/somthingelse
you could just set the world space of the system to world instead of local in the settings, then the particles will stay attached to the world instead of the player but will still spawn around it
@@RecombobulatedStuff The main point of this script is to keep the particles from sitting in the same spot while the player moves around to give the effect that the rain is in the world while it follows the player. I don't think your solution would do the same thing.
@@AvianFluu That's exactly what it does. If the particle positions are relative to world space then even if the emitter moves the particles don't follow the emiiter because they aren't relative to emitters position which is what local means, using world space looks more realistic than using local with a lerp/smoothdamp and it's its intended function.
awesome rain effect and straight to the point!
2 years later still incredibly useful thank you so much for the tutorial!
Thank you bro it helped a lot a perfect short tutorial straight to the point, you are underrated man
Appreciate it, glad it helped 😀
@@LordEvilM44 :)
Awesome! I can not wait to use this to make rain, snow, hail and sleet in my game.
thanks so much! it's very easy and good! i love it!!!!!!!!
Now I really want to make something that requires rain lmao
Very helpful! Keep up the great work!
Thanks mate!
Good job i will use it in a project, tahnk you
Brilliant!
Nice vid. Please make more tutorials!
Oh my god ,you're awesome!!!!
Thanks alot its working even on 2D
lit video
i suggest writing a scripot to make the rain follow the player but not rotate with the nplayer good tutorial though thanks
Good job!
I tried
Hello I have a question, Collision's type I choice world then i will have two problem. 1. when the shape scale too big ,rain will through my floor and house 2.when so many object in the Particle System range that will have the same problem
grate video
is there a way to make a weather CYCLE so over time it rains randomly? please
Well, in Particle Effects, for example, we make it snow, but we do not want every grain to be the same. What should we not do for this?
Poggers vid!
I have an issue that the rain particles are not showing up when I enter play mode.
Do you have a solution for that cause i have it too?
bbut it wass nice
This is what's missing in Subnautica
Is this good performance wise, if it's covering an extremely large area? It kinda ruins the immersion if it's following the player
The thing is when it's covering a large area the particles will constantly run even when the player isn't in that part of the map making it lag or drop fps, witch you don't want, and you could use Occlusion Calling or make a chunk base system to only render the particles when the play is near.
Wouldn't it be better to set the rain particles to world space (instead of local space)? That should solve the problem.
you gotta change the simulation space from local to global. This way the particles stay where they fall and wont follow the player. Alternatively another approach would be using a GFX-Graph als these are made for large amounts of particle effects in paticular
hay quá
tooo fast!
Thanks this really helped me It's nice and simple, but I find this color to be better for rain 9099A1.
I'm happy it helped you.