Dust Effect when Running & Jumping in Unity [Particle Effect]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thanks for the tutorial, I found it really enjoying to watch and pariclurary (heh) useful as I was struggling to make such an effect.

I am still curious about how the emission shapes work however. Any guide or link to material on how to better understand them?

Thanks for creating this tutorial :)

👍︎︎ 5 👤︎︎ u/ParallelWolf 📅︎︎ Sep 01 2019 🗫︎ replies

This is amazing. Thank you!

👍︎︎ 2 👤︎︎ u/[deleted] 📅︎︎ Sep 02 2019 🗫︎ replies

Simple, quick, and effective. Nice tutorial.

👍︎︎ 2 👤︎︎ u/ShawryAU 📅︎︎ Sep 03 2019 🗫︎ replies
Captions
while playing a couple of my favorite games I started to notice the subtleties and the animations that really added a lot of value to the game for example while planks Celeste how the character stretches when jumping really adds a fluid elastic motion that gives it a really nice feel and while playing Super Mario World there's a little dust effect that pops out whenever Mario tries to change directions at full speed I also noticed a similar effect whenever Madeline jumps it's a little effects like this that can take pixel animation to a whole new level and today I want to show you how you can recreate this effect with just a particle system and two lines of code so go ahead and open up you knee and let's get started the first thing we want to do is add a particle effect as a child object for our player object by right-clicking and selecting effects and then particle effect right off the bat I see a bunch of giant black squares using from behind my player we will fix that in a second but for now let's get our new particle system a name I'll just go ahead and name this one dust PS then let's scroll to the bottom until we see a category called renderer and let's click to expand it to change the look of these black shapes I'm going to change the material to sprites to fall this works great for my pixel art style game but any type of material could work here so at justice as you need if you don't see anything on your screen it could either be because your particle effect is behind your camera or it's behind other objects to adjust this we can change our sorting layer ID and for this video I'm going to place it on the same layer as my player then below that I'm going to give it a negative order value this way it's behind my player but renders above everything else if it's still not showing up for you let's go back to the top and right click to reset the transform so it zeros out our position this makes our Z position equals zero which should position it in front of your camera if it's not set to that already then I'm going to move this down so that the entry point is at the very bottom of my object for my player this just happens to be negative 0.5 - this is kind of hard to see so let's go down to where it says start size and let's change this value from 1 to 0.1 and immediately you should see it now it looks a lot like our snow effect but we can change that by controlling the shape so let's scroll down to the shape category and expand it for this effect we want to use the box shape and then down below we want to modify the scale values go ahead and set the Y value to zero this should create a white line at the very base of our characters feet feel free to adjust the transforms y value if it's not exactly in this location then from x value go ahead and adjust this so this white line is about the width of your object for me this value is about 0.5 next let's add some motion to our line to mimic the effect of dust let's change the velocity of our particle effects so our dust rises and fades away from our character so first let's scroll down to the velocity over lifetime category for linear let's change the x value to something like negative zero point two and the Y value to positive zero point two then we want our particles to fade over time so let's expand the color over lifetime category here is where we can change the color of our particle but for this example I just want to set the Alpha to zero on the right side this makes it so our particles fade out before they disappear completely now that that is starting to look better we want to transform this particle so our character only kicks up dust at actual moments like when he changes direction or jumps in the air in order for that to work properly we actually don't want this animation to loop so go ahead and uncheck the box where it says looping and also the box where it says play on awake our particle effect should be more like a burst of dust than a constant snowfall but in order for that to work we must trigger the play button during these actionable moments we can do this in a script so I'm going to go ahead and open up my player script where I have my running and jumping function setup and the first thing I want to do is create a public particle system called dust then let's just create a function called create dust and inside it let's write dust play now whenever we want our character to kick up dust we just need to call create dust so for now I'm just going to place it in the function where I flipped my character when he changes directions back in unity we want to drag our particle effect into the inspector where it says dust then when I press play and start to run and then change directions we should see our particle effect kick into action although as you might notice this particle effect follows our character as he keeps running the reason for this is because our particles are acting in a local simulation so to fix this let's change the value for simulation space from local to world let's also do the same for velocity over time and while we're at it let's add more particles to the scene by increasing the rate of emissions so under missions change the value for rate over time to something higher like 100 and upon testing we now have a cool dust effect whenever we change directions now that we have the effect looking good we can keep tinkering with these settings to adjust at how we like for example we can lower the start lifetime value to control how long our particles last on the scene for me I think a good number is about 0.5 and let's also adjust our duration down to 0.1 and now we can also apply this effect to any actionable moment like for example whenever our character jumps all we have to do is call create dust anywhere in our script and then when we test this in unity and actually works pretty good so if you enjoyed this video and would like us to make more please help us out by pressing the like button and subscribe to the channel so you don't miss any future videos [Music] [Music]
Info
Channel: Press Start
Views: 70,682
Rating: undefined out of 5
Keywords: unity c#, unity programming, unity tutorial, particle system, unity particle system, unity particle tutorial, super mario world dust trail, mario brothers running, celeste dust trail, celeste animation, super mario world animation, super mario maker, platformer game design, 2d animation tutorial, unity platformer particle effect, dust trail when running, dust trail when jumping, unity dust trail, unity dust particles 2d, unity dust effect, unity dust particles
Id: 1CXVbCbqKyg
Channel Id: undefined
Length: 5min 55sec (355 seconds)
Published: Sun Sep 01 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.