Making Damaging an enemy as JUICY and FUN as possible | Unity Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
one of the most important stages of making your game feel fun is Polish it is my absolute favorite part so today we're going to take this really super boring scene and figure out how to make damaging this enemy as fun and as juicy as possible ready let's go okay so here's our scene and we're just launching some little projectiles and you can see the enemy's health is decreasing if we check debug mode but as we said this is completely lifeless right now so where are we going to start we've got a lot of options at our osal but the obvious thing that we'll start with is get your enemies animating when they take damage that's going to be step one generally speaking depending on the style you're going for you can often get away with really exaggerated motions even just to convey movement so with damage you can really Crank that up to 11 the thing worth mentioning here that makes a difference is that we're calling this from any state which gives us this nice can transition to self checkbox here so you can see I'm able to hit him multiple times and it's just going to start the animation over even if it was busy already playing play which is really important for game feel you can see if we turn that off it doesn't look nearly as good and things aren't timed properly and it just looks weird I also checked next state as the interruption Source here otherwise there's a tiny window of time where the animation won't play as it's exiting and it just doesn't feel as good and this fixes that but okay this is pretty Bare Bones so let's keep it going and now I want to add some screen shake cinem machine is the easiest way to do this using an Impulse listener on the virtual camera and an Impulse Source on the enemy I kept this really basic but there's one really important detail I think that adds a lot of personality to the shake we're going to pass in the velocity which is going to be our direction from the bullet so to show you that's working you can see if we're standing on the enemy's head and we shoot down the camera shakes down just slightly and if we're over here then it goes away from the enemy it's a really small detail but it adds a lot all right so the next thing we're going to tackle is one of my favorites and that is particles and the thing to note here is I actually made two different particle systems here one is the impact particles those are to signify where the bullet actually hit the enemy and the second one is the actual damage particles which were a lot more obvious and in yourr face so the impact particles are pretty simple I used some spikes that Spawn from a partial Circle it's 120° and it's pointing to the right and that's important because here in the particle script we're going to do a from to rotation and we're using Vector 2pr as the from because we built our particles facing literally to the right and we're going to pass in the opposite direction that the bullet was traveling in so it's from the right to the opposite of the bullet's direction so it's a nice subtle effect that kind of spews out from the point where we actually hit the enemy now for the other one we're going to add in some gravity and we're going to make sure that it collides and disappears when it hits the ground using a stretched billboard here is going to ensure that the particles face the direction of their velocity and again we have this one spawning from an arc pointing to the right and for this one I'm going to do the same thing for the rotation except we'll use Direction instead of negative Direction so that the particles fly out in the same direction the bullet was flying but I'm also going to add an offset to the particles so that they don't spawn in the center of the enemy so there you go and the impact particles don't technically need to be called from the enemy I could spawn them in whenever a bullet touches anything even the ground but this second one shows that yes you definitely damaged the enemy all right this next one's really cool we're going to add some squash and stretch and you can very much do this with code but there is a fun little cheat that you can do that makes it really easy to do with the animator now if we squash him down on the Y we also need to fatten him up on the X otherwise everything looks off and then we'll have him spring up a little bit past his normal height and then back down to normal so I'm going to create a new layer in the animator and we'll use a blank animation as the default here and same as the other layer will transition from any state and allow it to transition to to itself and over here I want the interruption source to be next state now currently it's not going to do anything and that's because we need to slide the weight up and we also want to change this to additive additive is going to make sure that any changes you make don't override other changes in your animation layers it's just going to add these values on top of what's there in other layers all right next let's add a Sprite flash I'm going to create the easiest Shader in the entire world we're going to use our main text a color and a flash amount plug the sample into a blend node and add the color to the blend and amount to the opacity and change this to overwrite use that for the color and this for the alpha and once we've added new materials onto everything you can see we can very easily change colors now here's the code we're going to use to control that so we just call flash which sets is flashing to True resets a timer and changes the amount and color of the Shader and in the update if we're flashing we increment our timer and lurp our flash amount and then apply to the material and if the timer is over we stop flashing I love this effect but there is a whole bunch of extra functionality or options that you can add in you could use an animation curve to control the lurp directly or you could skip using a lurp and just flash him on then off it really depends on the style that you're going for all right but we're not done yet let's add some knockback next this is also going to take in the direction of the bullet and we're only applying Force once we just stop that motion after the timer is over in update and make sure you can strain the rotation on the Z unless you like this kind of behavior okay we're almost there but we are forgetting the biggest and most important part which is it's it's sound we're we Mystic sound games feel dead without sound and personal I always recommend that you add them as you're developing rather than waiting till the end honestly it just increases the fun factor for you by a lot but I also find it's really hard to tell if things are feeling right when you don't have sound in there so these are some of the most common techniques you can use to add juice in your games I hope you found it helpful let me know if you have any suggestions to get it feeling even better down below I do have much more in-depth videos on screen Shake particles knockback sound and Flash shaders which go into some more advanced techniques and more detail I will list them all in the description if you're interested like the video if you liked and if you want the source code for this project you can check out our patreon page thank you so much for watching bye I'd like to give a very special thank you to all of our Hall of Fame patrons yab yond Christopher Nichols zandre Kessler Fontaine weight brain waves binary couch KB at bird Tech games and Ian oral as well as our Early Access patrons Ken weight Mason Crow liquid egg Alexander press Jude Greaves Felipe GTO Santos obber Franchesco lamata Bill guo Alona Mars Alex fre Danny rlif Neil Ben kerer merler Sam maxar and meanon Tran if you choose to support us on patreon you can get early access to all of our YouTube videos monthly Alpha builds and more
Info
Channel: Sasquatch B Studios
Views: 7,368
Rating: undefined out of 5
Keywords: unity, unity2d, unity tutorial, sasquatch b, unity beginner tutorial, game development tips, game juice, game feel, how to add game juice, how to add game feel, what is game feel, what is game juice, how to add game juice in unity, how to add game feel in unity, game feel techniques, game juice techniques, make damaging enemies juicy, juicy game combat, making games feel fun
Id: S4pHJN8YclE
Channel Id: undefined
Length: 7min 14sec (434 seconds)
Published: Thu Dec 14 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.