How to make Particles and Visual Effects in Godot ( and grab the FREE Textures!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome i'm rafa and this is the first time i actually do a tutorial like this in the video format so please if it's not perfect forgive me and today i'd like to try to show you a little bit about visual effects made in godot i will put all the files that you need to recreate this project onto github you will find the link in the description of this video so if you want to try it out to recreate it you can find everything there so let's jump right into making it i just used a little sprite of a cup of hot chocolate from my game bottomless and i will try to make it interesting by adding different kind of effects so let's start by adding a particle to d node i make a new material here to have animated particles you can check this option here and then set up the sprite sheet as you need it you need to drag the texture in and then you can already see right now it's on the first frame and if you then set up the particle material accordingly you can just let it run the animation over and over depending on the time the lifetime of the particle the whole sprite sheet will basically run one time now here i randomized the angle a little bit to make it more interesting this price sheet was made in blender i will also add the blender file to the github repo so you can find and download it there and experiment in blender increasing the emission shape size to make it a bit bigger and make it a bit more random i will also change the direction to a spread of 180 meaning basically it's emitting and 360 degrees from the emitter center and increase the velocity a little bit and you can already see how the particles emit away from the center and there i inverted the gravity it looks a bit more magical and i really like the effect so yeah you can experiment a little bit with lifetime shorter lifetime gives a more intense effect and longer lifetimes give a more calm effect so just position it behind the sprite and it already looks kind of interesting experiment around with particle systems like this to for example make items appear more interesting to have effects on characters a color gradient basically means this color will change over the lifetime of each particle so i will add some violet to the start of the particle a little bit of magenta to the center of the particle and another interesting color to the end playing around with the colors in the gradient can really make a particle system much more interesting you can see how it looks now much more alive than before have a look out that the colors in the middle are not too bright otherwise it will look a bit strange you can see now by turning it down by making it a little bit a little bit more dark it looks much more natural and the gradient is much smoother what also works really well is adding a little bit of view variation to a particle system so each particle has a slightly different color play around with the values here to see how it affects your particle system but it can make it look much more interesting and much more alive it's just a subtle change but it will really get you far you can also add a little bit of explosiveness if you turn up explosiveness to 1 it will emit all the particles each cycle but if you put it at like 0.2 or something like that it will just make it a little bit more random and the emission looks a bit more interesting so let's make a new example let's add another particle 2d this time i use the offset texture that is also supplied in the repo and by using a texture that had a slight offset to the center you can get really interesting effects in a very short amount of time and it just makes the particle system more alive if you apply an angular motion to it first set the angle to 360 and the randomness to one meaning that each particle is spawned in a random angle i will also decrease the size a little bit under angular velocity you can set up how fast the particles spin you can already see that gives a really interesting effect if combined went random or with a curve so particles are spinning less in the beginning and more to the end from the offset of the texture it looks like a slight turbulence i reverse the gravity and you can see how the particles just disappear when they die this is because the color is consistent if you use one texture that has no animation or anything it will just be one color over the lifetime of a particle so we have to add a gradient you can see i play around with the scale a little bit to make the particles smaller when they start to disappear and with the gradient you can really make the whole animation a lot more smooth you can now see they fade out when they reach their life cycle end now i just play around with the color a little bit to match my personal taste and one thing that is really interesting is if you go to raw mode on colors and increase the amount to more than one you can see that it already gets much more intense and if you use a post-process note with glow it will also add the glow effect to this particle system or to the i will just put them more to the top so it looks a little bit like the hot chocolate is magical and it comes out of the cup one important thing is when you use textures that have an offset that they will never spawn at the center that's a little bit of a problem but you can counter that by decreasing the scale in the beginning of the particle using a curve so it will be a little bit smaller and so it will look more like coming from a center and you can see that effect much more or much better if you increase the emission amount it looks almost like a circle because all those textures are offset from center changing the mission shape to a sphere with a slight radius will make that a little bit better let's make another example and add another particle to the node and this time i will show you how to use a texture that has a random frame for each particle so to do that you need a spreadsheet with multiple sprites or multiple frames you add a canvas material and enable particle animation and you can see now it always uses the first frame i disable gravity because it looks really strange now in animation there's the offset parameter this offset parameter basically tells which frame of the sprite sheet the particle will use if we randomize this it will always use one of those frames using a gradient texture for the color we can make the transition smooth the kind of effect that i'm going for it's kind of like speed lines almost or divine shine around the object but it's a very cool effect it's very simple we can randomize the angle the spawn angle and the scale a little bit and if we change the scale over the lifetime it just flows outward and it looks pretty cool you can see the effect looks a bit strange if you use a low amount and i would always advise for such effects to use local coordinates if you use world coordinates and you move the object it will start to look really strange yeah you can add a little hue variation it starts to look really funny with that and i think i would call that one done let's make another example and this time i use a texture that looks a bit like a vortex you can see that i always use add mode that's because the textures have no alpha i realize that when making this video so i will add versions with alpha from those textures to the ray pose so you can also use it in mix mode or subtraction mode now with just adding an angular velocity you can already see the effect that i'm going for just reduce the scale to the end and you kind of have a vortex effect and it looks like it's pulling to the center and adding an angular randomness to the spawn and it already looks really interesting you can also see sometimes it's good to reduce the emission amount so you can really see what's going on and sure also adding gradient otherwise it will just pop out and now it really starts to look very smooth and kind of windy we can increase the particle emission amount again and i really like the effect already if you use a gradient in the color slot i usually try to stay black and white and so you can just use the color modulation of the node to change its color and it will basically just modulate the color that you set up in the in the gradient slot of the particle system and it looks especially interesting if you go over one like i already said you can get very cool effects like almost like a fiery effect because the the single particles always add up and then you get very intense colors so let's create one more example and this time i will use more textures and add mode to add a lens flare like effect just add a material set it to add mode and there you go basically then you can just adjust values and play around with color with scale to get a nice looking effect and i will also show you how to add a very simple little script to make it more interesting more alive so i changed texture out here because the original was a bit too boring but i used the original texture in front to just make it a little bit more interesting and integrate the artwork better into the effect i selected both notes and then change around the color so i can change color on both objects at the same time that's very practical for making such effects i just take the particle system of another example move it to the place where i need it and you can already see how combining different effects gets very interesting very fast and play around a little bit with the color but i want to go for something different here let's make it sparkly i'm just using one of the other textures supplied in the package i will change around the emission shape to a box shape right now it's a little hard to see what's going on i reduce the gravity to zero reduce the scale of the sprite or of the particle and you can already see now it's a little bit easier to see what's going on i add another gradient texture to stop the popping in and out of the texture now i added a curve to the scale property to fade in and out really smoothly but it's still hard to see the box is a little bit small let's make it bigger and you can see the sparkly effect that it was going for the color is a bit strange it doesn't really fit very well so let's change that too going a bit more for a brighter look and it already looks much more sparkly so now it already looks a bit interesting we have different examples but you can see that the glow looks a bit boring without any movement compared to the other examples so let's just go forward and add a little script there so let's make a new little script for that effect let's make a new variable called time we will use that to basically create a loop that will change the scale of the object that the script is attached to so in the process function i will take time and put it inside a rep float and i will just take time and add delta to it and then wrap it between 0 and 1 meaning each time time will be bigger than 1 it will go back to 0. so i can guarantee it will always stay between 0 and 1. now we take the scale of the object and set it to vector one we can also use the constant that is supplied by godot so vector2.1 and then i just realized it will skip if i just use time so we wrap time around minus pi and plus pi instead of zero and one and that just should give us a slowly pulsing effect for that sprite at the moment it's very intense and it's very slow so let's add some variables there to give us some control over the effect i will add a new export variable called power so i can control the intensity of the effect i have to multiply my sine wave with the power and i will change it up a little bit i will add vector 1 to vector 1 and multiply the second vector 1 with that time variable or with the sine wave basically i will also add a speed variable so i have control over how fast the effect is appearing or is changing the scale of the object so let's play around with the variables here a bit and you can see that it works and now it looks pretty interesting much more alive than before everyone should be able to do it or you can just take the script from the repo and use it in your project i want to be able to change the size of the sprite so i have to save the original scale before i apply the effect i could do that like this just add an original scale variable and set it in the ready function or i could just do it on the top say on ready set the scale to the original scale i can delete the ready function and change that out and now i can change the scale of the sprite to make it a little bit more interesting and the script will still respect that new scaling i want to add another effect or another script and that script will be basically rotating an object around its own axis over time basically it's very similar to the other script so i can just copy what i have change what i need if i want to rotate i change scale to rotation for sure i can just use time i can delete the variables that i don't need i will keep speed because that will be very useful to change the rotation speed of the object and then the effect will look like this so it's very easy you don't have a lot of setup to do and a little tip don't always overdo it sometimes it can look much better if it's a little bit subtle and not too intense when i use that script on the normal note 2d i will get an error saying hey the script extends bright and not node to d but i can just change it to node to d because sprite is also node 2d so the script will now work on basically most 2d objects the icon scales a little bit up and down and all of its childs of course so it can make for some interesting effect for an item or a pickup or something like that and that's it i hope this will be useful for you and if you liked the video subscribe my channel even if i never post on it or join the discord of my game and we can have a little chat about the techniques and i hope the repo will be useful for you don't forget that you can download all the examples and all of the textures that i used down in the video description hope you have fun with it and maybe it will improve your projects a little bit so see you soon bye
Info
Channel: Picster
Views: 72,140
Rating: undefined out of 5
Keywords: Godot Engine, Tutorial, Particles, Particles2D, Visual Effect, Textures, Step by Step, Game Development
Id: DPDPI5zDeoM
Channel Id: undefined
Length: 16min 28sec (988 seconds)
Published: Wed Dec 02 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.