Force Field and Impact Effect - (UE4 Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this tutorial I will show you how to make a force field and an impcat effect on the word field like this as you can see whenever we hit the force will with our project it will create some particles that will come out will be depending upon the embed location and also there will be a hotspot in the middle and two rings growing in and out and also the world first will will shake if we hit it like this it also has an intersection effect so first we are going to create the material so for that right click and material I will name this first field mat and open it up so let's change this to a translucent unlik material so it will be translucent and it won't receive any light and also click on two-sided because we need to be able to see the force field from inden outside now get a final notes so type in final and connect this to you may see color so as you can see now that center portion of this sphere will be zero and the outer rim will be one so the point where we are directly looking at through the camera will be 0 and the point which is perpendicular to the camera will have a value of 1 and anything in between will have a value between 0 and 1 so the outer portion will be this white color and the inner portion will be black we can access to opacity and apply this and I drag and drop a sphere I'm just going to scale it a bit son now I applied this I do look like this so it doesn't have that intersection at that right now we will add that later so I need this line to be a bit more sharper so for that we can use and constant and connect this to the exponent you can get the constant by pressing and holding one and clicking so I will give this value five so maybe 10 now we get a sharper edge now we will create a love note so press and hold I'll and lick this so we get this love and connect this gem you see color and connect this to alpha so for a we will give a blue color so press on all three and click so we'll this three vector and kind of Christian a and change this value to 45 then change the green value to two and for B we will give a white color so personal three and keep surveyed this three vector organic this to P and change this value to 1 1 1 1 so we get this type of an effect now let's create that intersection effect for that we are going to use a tab thread node tightly and I've been depth fade and connect this to the MSE color and opacity and present one and kick and connect this to for say distance and change this to 200 change that to 500 so the portions where this material intersects another material it will have a value of zero and it will progressively increase from there so the intersection point will have AZ value of zero and this point will have a value of one so we are going to use this to make this effect so delete this and right click and type in Max and connect this to a and connect this to be and connect this to alpha and I can't this gem I see color and connect this to the opacity so here we can see that there is one problem so the depth is node actually outputs a value of one when the mixture is not intersecting anything so we have to invert it to get this effect so drug from here and type in one minus and connect this to be so now we can have that intersection effect I think the link is just too much so we can produce that so kinetic constant here and ten this value to 10 so now this looks fine maybe you can give a value of 20 if you want so now we have two effects done now let's give this Connie come by fact so for that we are going to get your texture from this chato conduct this Tec hex type so if I just view the green Channel you can see that this black and white honeycomb-like shape we are going to use that as a mask so drag and drop that in now right click and type in Max and control drag this here and connect this here then kind of this to B and we need to connect the green channel to B so we get this right so basically a matte but a max node does say that whichever value is bigger and that gets outputted so if this value is 0 and this is 1 we will get an output of B from here and if this is 2 we get a value of 2 from here so now we need to reduce I mean increase the number of this honeycombs we can do that by using a texture coordinate node press and hold EU and click so it is just to coordinate and personally mine click so with this multiply I connect this to a and connectors to the Yogi's and change this value to 10 so now we have our honeycomb shape that looks fine we can also multiply this with a very between one and zero to control the opacity so if I give a value of 0.3 then it looks like this and if I give a value of 0.1 it looks bit more fader like this so this is Phi now we will create the impact effects so for that we need to create our forceful actor so go to the Gundam browser we open glass an actor force field VP then open it up and I will add a sphere collision so type in sphere collision not spear spear collision and Dragons of this into the defaults en route now we can add a sphere and I will increase the size observer sphere collision like this and I will increase the size of a sphere also okay that looks fine now go to even graph and one component hit drag from here and type in cast to first-person project I'll and connect this to other actor and drag from here right before that right click and I'm in print string and cactus here and characters here so we can see whether our projectile is colliding with the force field now for the sphere we are going to give a new material so the material is this force field material drag the dragon throat again okay now I'm just going to delete this spear mesh and drag and drop our actually I will scale it a bit by 2 in all axis so now if I shoot at it you can see that first person project so this projectile is basically the first person projectile you get from the template I just stretch to the J bit and change the material nothing else this is just cosmetic effect you don't really need to do this to get this working so now go to the event graph and drag and drop the sphere and we are going to create a dynamic material instance type in create so we can control the material using this so now we will create the impact effect for the material so right click and type in sphere mask and now type in ball position and for B we will input a vector parameter that we are going to control using the blueprint so person will be n click the weight is vector parameter and connect this to be I will change the name to pose for position POS and for the radius we will make a scalar parameter for so present whole assembly and kind of just your radius and I will name this radius so we are going to increase and decrease our radius using the time line and for hardness we are just going to hard-coded value point eight maybe and we will connect this to both of this using a max node so type in Max and control drag this here kind of this here and connect just to B so now we can control the two parameters using the blueprint so go to the blueprint and drag from here and type in sect vector parameter value and the name is pose what we named for the position so what basically sphere mask does is that it will create a sphere using this two positions and this radius so for the value we will break this hit result and get him back point and come close to the value and we will hard-code the radius for now so drag and type in set scalar parameter value and the name is radius radius for the value we will give a value of 200 so now let's see if this is working or not so now you can see that it is creating a radius I'm in a circular radius 200 on the force bill when we hit it so now we will make the radius grow in and out so for that we will use a timeline so disconnect this and drag from here and I've been timeline there we'll name is animate and here kind of this to play from star so every time we give an input it will play from this down and connect this update to the set scalar parameter value and opened a time line we will change this value to 1 and add a flow track and shift-click here so at the point here I change this time to zero I change this value to zero I choose to click here and change this value to 0.5 and change this value to 0.5 and shift click here again then change its value to 1 and change this value to 1 I mention this value to 0 so it is in a triangle looking thing you know combined so now we get a value of 0 to 1 from here meaning to convert that to a value 0 to 200 so verbs that we can multiply this value with 200 so when this value is 0 we get a 0 out through output from here and when this value is 0.5 we get a value 100 and when this value is 1 we get a value of 200 and then let's see if this working or not here you can see that it is growing and shrinking you can also control the wage is growing using curves you can play around with this curves so that till you get it at the fill do you want so now let's create that banding effect so for that we are going to use a sign and connect this to the max and if I start playing now so we get this one band if we need to we can change the period to point 5 so we get an effect like this now let's create that hot spot so for that we are just going to duplicate this peer mass and connect this to world position and position and drag from the radius and we will clamp this between a value 0 and 50 so our circle will be small and here we will create a new layer and connect this to a and characters to the MSC color and for alpha we will connect the output of this layer mask and for B we will create a new color and we will give value 33 for the red and 12 for we green so we get this orange e kind of Allah so now we will create a new mix and control drag it to here and connect its here and connect this to be I think the circle is just a tube big hmm we will clamp it to 20 okay that looks better quietly part of his system so right click and particle system I will name this debris and open it up we need to create a material for this so right click and material I will name this door and open it up then as always said this to translucent unlit and right click and Ivan radial gradient exponential now get to multiply node by pressing and holding a man click and connect this to a and connect this to MSC color and also do that for the opacity now we will get a particle color node and connect this to be and connect alpha to be so that's what we have to do here now go to debris and click this arrow so since we have the dots selected it will automatically add that to our particle system and I change the velocity to 200 for X and 200 for Y and to 100 for itself and here we will give a bed of - 200 - 200 and we will give this a value of 200 not - 200 because we need it to go up and for the spawn we will Inc this is 250 actually we are not going to use this bone but it is just for now now I will change the color I will give it a color of 22 two and point one and I will set this screen alignment to velocity in the required module so we can stretch this and go to initial size and max size we will give a value of ten and for y we will give you a rate of 25 and for that we will give a value of 10 and here are five for y we will give a value of ten and here we will give a value 5 for X so it looks like this so we can stretch it a bit more if you want there you we will give a rid of 25 that is bit more stretch like this now we will add the acceleration so acceleration slashed life so here we will add three points so for C Rosaura we will give a value 504 see and here we will give a value of minus 240 and then this 2.5 and here we will give you a value of 1 and change this to minus thousand or maybe two thousand so it kind of falls down like this now we will go to spawn and fix something they are going to change this to a constant and give a value of zero here and we are going to just burst the particle so it will just come out and the emitter gets destroyed so for the count they will give a value of 50 so it can deduct this and we will add one more and we will give this a value of 25 and 10 the time 2.5 so it can it looks like this and we will go to record and chain pee meter loop to 1 so it only lives one time so after this the emitter gets destroyed in the blueprint so I will duplicate this and change the color so for the blue I will give a value of 22 and 2 and 0 so it looks like this so we did it in the Z direction so it will just go up and down but usually in our force field it comes from the sideways so a quick way to do that it's by rotating the emitter 90 degrees in the y direction so changes for both of them so it looks like this now go to the event graph of your force field and before we animate we will spawn and emitter so drag from here and type in spawn emitter at location so the location will be the impact location or the impact point and the emitter template will be the debris that we created now let's see if this is working or not so it is kind of working so but it the rotation isn't working so to fix that we will go to the event graph and drag from hit impact normal and we will make Road from the x-axis and kind of this to rotation and now it should be fixed so now it will come out from thee now the rotation will be fix it I think we just have to fix the timing of the second debrief that coming out so go to spawn and change this value 2.1 and also here we will change this value 2.1 I think the falling is a little bit too fast so let's fix I do so with your ax relation and change this to 5,000 from 20,000 and if this is also by tossing like I think that's what we have to do so yeah that's it you can improve this in a lot of ways you can add sound effects you can create your own better looking particles so before that before I end I will show you how to make the world force field shaking effect so for that go to the force will material and we will duplicate this layer mask and connect table position here and the position here and the radius we will multiply this by 5 and I can exhaust your radius and get 2 more multiply so press and hold a man click so it is two multiplies and it connects us to a and connects us to world position and connect this to a here we will give a value of 10 and here we will multiply this with vertex normal so type in vertex normal and cactus here now let's see if this is working or not as you can see it has some effects so we will multiply I mean we will assign this so get this sign and change this to 0.1 in the period two point one now let's see so in order for the period I mean order for the sign to work we need to have a low hardness value so personal one I get seven is constant and then this value to point to supply so now our forceful is shaking whenever he hit you can also play around with the color and add a different texture to it and you can also add the texture to the circle you might not want to rings you just need a circle and you can apply a texture to that also you can play around with the refraction and the normal mask if we connect sends into the refraction you get access to the noble max so you can do some kind of distortion effect also using this sphere mass you can control what happened to the portion of the material that is being impacted by the project edge so you can do all sorts of things so that's it for this tutorial thanks for watching everyone and subscribe for more tutorials like this thanks
Info
Channel: UnrealCG
Views: 59,654
Rating: undefined out of 5
Keywords: Force Field and Impact Effect, force field reaction to projectile, Tutorials, ue4, tutorials, Unreal, game, development, dev, Material tutorial, impact position, force field material, magic shield, blueprint tutorial, depth fade node, particle system, unreal engine 4
Id: hQeJETEUzE4
Channel Id: undefined
Length: 31min 6sec (1866 seconds)
Published: Sat Sep 02 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.