How To Summon Creatures in Unity - VFX Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we are going to see how to summon creatures [Music] it's a very useful effect for when you need some kind of animal or creature in one of your abilities in my case I'm using a running Tiger but you can use pretty much any creature you want and I'm gonna show you how and if you want to get your hands on disability on this project it's all available on my patrons page links below so without further Ado let's jump right into this but first today we have a brilliant sponsor brilliant is an app and website that lets you grab knowledge interactively which is the best way to learn anything because you are going to learn by doing yourself it will teach you how to solve problems in a fun way and improve your critical thinking which is such an important skill for example for game developers I actually find Brilliant super cool and almost learn something new every other day and it sticks with me thanks to the interactive exercises I love the scientific thinking curse I finished recently and I gotta say anything related to space is awesome because you see through the end of the course it was all related to space solving problems our light bands or out light travels there's this cool one where you witness a spaceship battle which is strictly legal in this hypothetical scenario and you are invited as a witness to the court to establish Usha their laser beams first from your point of view it's just brilliant way to begin the theory of relativity you guys got to try this it's free for 30 days so visit brilliant.org Gabriel agyaprod or click the link below the first 200 will get 20 percent of brilliant's annual premium subscription foreign [Music] so as you must imagine we need a 3D model of the beast of the creature of the animal that you want to summon in my case I went to sketchfap and search for raining tiger I was looking for a running cycle of any kind of animal and I found this one you can download it right here probably need to create an account if you download don't forget to credit the Creator we want the fbx version of this it will unlock zip file once you have unzipped this you can drag and drop this fbx model to your Unity project and here we go the tiger is running in unity just gonna turn on Loop time for the Run animation because I want this cycle to keep on looping right and now to create the effect we are going to start with an empty game object we can rename it to VFX underscore tiger attack because in my case it's a tiger I'm going to reset the transform and parent the Tiger fbx this tiger right here is way too big as you can see so I'm going to decrease the scale to 0.5 on all of the axis right now as you can see it doesn't have any animator and it's really important we need an animator so I'm going to go ahead to the model and in the rig tab I'm going to say the Avatar definition is Created from this model and then press apply so it creates the Avatar and now it has an animator the Tiger we just need an animator controller now right click animate the controller rename it and drag and drop it to your tiger to your beasts I'm gonna double click the anime control because now I only need this to create a new empty State for the Run Cycle and assign the Run animation that came with this model and that's it if I press play now the tiger is running cool that's the first part we are going to make this move forward first let's take care of the aspect so let's create a Shader I'm going to go ahead right click create a blank to the graph and rename it to Tiger Shader by the way if you want to use the Galaxy Shader that I have demonstrated in the beginning it's available from this tutorial that I did a while back and it will work very nice with this tiger for example or other animals I have linked below the tutorial in case you are interested or else you can follow this Shader it's going to be very simple we are going to now say the active Target is universal and and Lead allow material override so we can change this in the inspector in case we need it and basically all we got to do is create a freno effect spacebar to search for it and multiply this with a color so I'm going to create the color property up here and then a float for the fresnel power with a default value of 1. because we want to control these right it's useful so let's drag the color right here save the mode it's HDR and color white with Alpha at 100 and multiply these two together and connect to the base color of the fragment function and save these assets and that's it we can create a material out of this Shader and then assign it to our tiger with the skinhead mesh render this one replace this material here we go now it's all a matter of choosing the color you like the most right I'm going to stick with the purple that I've used previously and increase the intensity I have a global volume with Bloom by the way that's why it's glowing looking nice okay so that's one of the first steps for the Shader let's go ahead and create a prefab out of this VFX underscore tiger attack and now for the second part of the Shader and in case you followed the Galaxy Shader you are also going to need this it's the road effect we are going to use a noise you can search for it with spacebar you can try these three noises but I'm going to use the simple noise and say the scale is 30. and connect this to the alpha now it's very important that in the graph inspector we turn on Alpha clipping and as you can see it erodes away immediately because of a clip threshold is bigger than zero so we are going to control this with a float we can call it the road and say it's a slider between 0 and 1. connected to the alpha clip threshold and save this Shader once you go back to your tiger to the material if you play with the row then nothing happens that's because you also need to turn on Alpha clipping on the material exactly and here we go it's eroding away very nice so now let's see how we can control d0 via script it's going to be very simple guys nothing too fancy so I'm gonna go ahead and create a c-sharp script called the tiger attack for example and assign it to the prefab drag and drop it double click on the script to open this up and we are essentially going to need a couple of floats first float is for the road rate by default 0.03 second float is for the erode refresh rate at 0.01 and then another float for a row delay after how much time we want to start eroding which I'm gonna say it's 1.25 and then a public skinning mesh renderer because that's the component a tiger is using and we want to access the material of the skinhead mesh renderer right so on the script I'm going to call this the road object let's delete this and create a 9 numerator call it a road object and this needs to know after how much time are we going to start eroding the object we can use the nailed return new wait for seconds a road delay and then create a float tea that starts at zero no erosion and we say while T is smaller than one we are going to increment it by the rolled rate value and then we are going to go ahead and access the material of the road object because it's a skin and mesh render and set float we can manipulate values of the material Open brackets underscore erodes and pass the T value this and this Curry Road is this reference right here of the erode property it must be the same name you can rename this reference by the way but what's important is that in the script it's the same name as this reference right then we wait a tiny amount of time which is the refresh rate El return new wait for seconds erode refresh rate and to quickly test this out I'm gonna call this start core routine on the start function exactly like this road object Save The Script go to the VFX tiger attack and assign this kitten mesh render and apply the changes to the prefab and now if you press play it erodes away it's also very big basically the 0.5 of the scale that I've seted before it's not working in my case because I need to create an empty inside the prefab reset transform make sure the scale is one one one that's very important and parrot this tiger right here inside the scale here is one but on the game object it's 0.5 on all axis save the prefab and now if I press play it keeps the same scale and it erodes away which is exactly what we needed and want awesome looking good now it would be awesome if we could move this right if we could fire this like a projectile so I'm going to show you my setup that I have here in my scene I have a game object the FPS character with a character controller which comes with unity and then a camera and a fire Point inside this game object there's also this first person control script which you can find this script pretty much anywhere on the internet you can copy it if you want and then this this other script the tiger attack shooter which is a stupid name by the way but essentially this will fire any given projectile we have a camera we have a projectile Fire Point which is a transform a fire rate but basically every time we press the fire button there's a timer and then we call the shoot projectile function which will essentially see if there is a camera and then it will shoot array from the center of the camera to the infinite and then we save a point on that way to the destination and we call instantiate projecto which will basically instantiate the given project of the prefab we will access the tiger attack script in this case so we can get the speed of the projectile and pass it to the rigid body of the projectile and then we rotate to destination as you can see it only rotates in The Wire there's a quaternion lerp here and that's pretty much it you can copy this wall script you can pause this video and copy it in our tiger attack script for example we would need a float speed and a destroy delay which is going to be used in start and it will destroy this game object after the destroy delay in my specific case I have to change the tiger attack shooter to work with this script so I'm going to copy this to test this really quick place it here it here and there in the FPS character I'm going to assign the prefab we have created for this tutorial and on the tire attack prefab I'm going to assign a rigid body with no gravity and that's it if you are using the shooter script that I've showed you and the FPS character now you can press play and you can shoot flying cats Flying Tigers anywhere you want as you can see yeah that's the easy way to shoot things in this case if you want something a little bit more deep there's this script which is a tiger attack the original one by the way the names of these scripts are completely wrong but essentially this will snap the prefab to the ground it's the same script I have used for this video the ground slash yeah we can slow down we can detach our objects and we erode like we did but in this case I wrote In the Beginning as well I'm going to use this script now because it's a little bit more advanced and I'm going to revert the changes in the shooter script and on my prefab I'm going to disable this tutorial script and assign the tiger attack script say the speed is 14 slow down rate at 0.012 it's a few values that I've tested so this looks nice if you want to copy them just try delay objects to detach it's going to be useful in a moment I'm going to show you and then the road options and the object to erode I need to enter in prefab mode and assign the tiger right if you test this out now the tiger now follows the ground it snaps to the ground which is awesome that's great now we can test this with some particles with a trail of particles for example I'm going to use a VFX graph right click and I'm going to parent this to the prefab right here in the scene I will apply the changes in a moment essentially we need to Center this with our creature more or less in the middle yep and then press the edit button to open VFX graph you can see if you move this around it doesn't leave any trail of particles the trick here is to turn on world right here and then use the set position or a set Sphere for example but in local mode set the radius to 0.1 and the W here is set to world if we click it we can change it to local that's important and now you can drag this around it will leave particles bi let's make a few adjustments here for example how much time this is going to emit particles let's create a float duration and in spawn the loop duration is going to be constants and loop count constant as well and now we can connect this duration which we can say it's a second and a half for example increase the rate for example the capacity as well obviously this will impact the performance so be careful and let's take care of the aspect down here real quick set size random between something like 0.008 and 0.04 size of our lifetime from Big to small but it must be in multiply the composition and then we can switch this part to the default particle that comes with unity for example set the color here to a purple in my case and increase intensity you guys can play with this and personalize it even more but that's essentially it I'm just going to adjust the speed up here to to be minus 0.5 in all of the axis and 0.5 in all of the x is a minimum and a maximum or you can use the turbines down here and say the intensity is random between -5 and 5 something like that for example and you can even use both if you want the velocity and the turbulence yeah save this apply the changes to prefab disable these on the scene and press play because we are going to shoot these prefabs right and if we test this out the tiger is leaving a trail of particles looks nice but as you can see they disappear out of nowhere and the particles get also destroyed that's why it's useful to have this function to detach objects a list of objects that we want to detach and Destroy them after a moment I'm gonna go to the prefab and assign the VFX graph to the list of objects to detach it's set to detach a second and a half later and everything together will fit really nice as you can see now we can shoot tigers and particles they stay a little bit and then it gets destroyed the VFX graph right that's awesome now you can summon a tiger you can add a few Trails by the way you can use this tutorial to create Trails or some Trails I'll link below I made it well back and it's awesome information for you and yeah that's pretty much it in this case I hope this guides you in the right direction now to summon creatures and I made it all available on my patrons page in case you guys want to get this and test it out links below your sport will mean a lot and I want to say thank you to each Patron that support me last month and a quick shout out to the Top Thai patrons which are 3D sorcery Alexandra Breezy all Perez Achilles Benitez Christopher Vivas Kirby Dooby Doo cyber cradle Daniel Schmidt yakub Jag Maddox deutron effect yellow L El Sharif easy thanks Striker Gabriel Julio benvenuti Goblin plaque clearance Jason Marrero Joe arcash Casey Miller Karen campe curbs J Lee annault the thuli Lulu vermet Manuel Mora Mark Adam ozen and Safra neogendrix and are pradipson q216 radioactive bullfrog Revenant games Rohit Gupta very suitable mean will who's Will polian Town markdown and thank you all for your amazing support it means a lot I hope you have all enjoyed this video and I hope to see you on next video thanks bye [Music]
Info
Channel: Gabriel Aguiar Prod.
Views: 30,431
Rating: undefined out of 5
Keywords: Unity tutorial, vfx, vfx graph, vfx graph tutorial, unity, visual effect graph, unity visual effect graph, unity vfx graph, unity visual effect, tutorial, shader, shader graph, unity shader graph, unity shader, fx, graph, visual effect graph unity, unity tutorial, Fire, unity stylized, stylized, unity stylized effects, unity animal, unity summon, summon, how to summon, unity creature, creature, unity trails, stylized trails, summon animal, beast, unity beast, mrbeast, ability
Id: vMd5GnP5c8o
Channel Id: undefined
Length: 19min 0sec (1140 seconds)
Published: Tue Mar 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.