How to create a Scanner! | Part 1 Pickup! | Unreal engine 5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone how are you doing this is the first part of a series that I'm going to teach you how you can create a scanning effect here in a real Engine 5 so as you can see I'm here in an open Word level with my character and as you can see I have nothing on the character so if I press F now which is the key to do the scanning nothing happens but we do have this device as you can see so if I pick this now I have the device on my left arm as you can see and now I can do the scanning so for this I add this boxes here to show so if I press F now there we go we do the scanning and as you can see the icons for the boxes appear in the screen and stay there for a little bit and just disappear of course you can change all this parameter but this is what I'm going to teach you in this series so if you do like this video please hit the like button and subscribe so you don't lose any new content and if you have any questions on this feel free to ask in the comments and I'll try to help you out so let's start first let's import the static mesh for the scanner so for this here in the content folder I'm going to create a new folder let's call this meshes then inside this folder let's create a new folder for the scanner and now let's import the scanner um mesh so I'll leave a link in the description below so you can download all the assets that I'm going to use in this system if you want to follow along just download these assets so now let's import here let's go to import and just navigate to the folders and here in the models folder scanner folder we have the static mesh for the scanner I also have here a skeleton mesh but for now let's only import the static mesh let's select this and let's open I'll leave this as default and just import and as you can see the textures is imported as well but we are missing the metallic map here so for this let's import again right click then import to here in the same folder in the scanner folder we have the textures here and in here we can import the metallic one so let's select this and import there we go now we have all the textures so let's just create a new folder here for textures and let's put all the textures inside this folder let's move here there we go let's open the scanner material here so we can fix some things because it's wrong so as you can see this map is in the in the OB OBO I think it's right let me see so it is the obido so we have the roughness on the metallic so this is wrong let's unplug this we have the emission on the emission it's right and the normal on the normal so let's put the roughness here into the roughness now let's grab the um the metallic map that we imported there you go let me put here and now let's plug this into the metallic um pin here there we go now everything is correct but we can increase a little bit by adding some color to the emission here so for this I'm going to hold three on the keyboard and left click to create a constant Tre Vector here let me put this in white by default and let's multiply this map with this color so we can change the color later and to change the intensity let's multiply again this value by some scaler parameter so just hold s on the keyboard and left click to create a scaler parameter let's call this um emission intensity I'm going to default this with 50 by by default let's plug here in the multiply and then the results of this into the emission let's apply and save and now if you open the uh the mesh as you can see we have the mesh working here there we go now let's import the pickup mesh the mesh that we're going to use to create the effect around the item for this let's create a new folder here let's call this pickup f effect mesh and let's import so in the same folder that I I'll leave to download we have in the modeles folder we have the pickup mesh and then we have the fpx here just import this let's import here there we go and while we're here let's create a new folder for the textures and then let's import the textures that is inside the pickup mesh folder the pickup line and pickup mask let's import this two there we go now let's create the Shader for the pickup effect mesh so let's go to here to the pickup effect mesh folder right click and create a new material let me call this m pickup effect there we go let's create an instance for that so right click and create material instance let me name this Mi pickup effect and now let's open the Shader there you go and first let's change the blend mode from opaque to translucent because we need to deal with the opacity here and the shading model from the full lit to unlit because this doesn't need to be affected by light so first let's start with the color here this would be really simple so let's add a constant Tre Vector here by holding three on the keyboard left click there you go let me convert this to parameter so right click and convert to parameter let me call this pickup color there we go let me default this to maybe something a little bit orange here there we go and now let's multiply this with some intensity so let's hold M on the keyboard and left click to add a multiply node let's multiply this color with a scale parameter so hold s on the keyboard and left click to add a scale parameter let's call this um intensity there you go and by Thea let's put one here there we go let's put in B and this is the color so let's put in the mive column there we go and for the opacity we're going to use those two textures that I leave to download so let's go here in the folders in the pickup effect mesh in the textures first let's use this pickup line so let's drag to the graph here and I want this to be going from uh the bottom to the up of the model in an animated way so let's add a Panner here right click and add Panner there you go with this you can move the text so let's connect this into the UVS and for the speed I'm going to create a parameter here so let's um add a constant two Vector here with holding two on the keyboard and left click to add this then right click and convert to parameter there we go let's name this um speed let's connect this into the speed here pin in the banner and by default I'm going to put one on the red and one on the green so the X and Y values here and now let's connect this into the opacity so you can see as you can see we have the texture moving from down to up here in the model let's apply now and save and let me put this into the model here so let's open this static mesh pickup here there we go it's just a simp simple model as you can see just a simple cylinder let's go to the material here and let's find the Mi pickup effect and there we go as you can see we have this cool unitt effect going from down to up here but as you can see we are not seeing the inside of this mesh to do this let's go to back to the material and then here in the two-sided we need to check this box so let's check this let's apply and save and there we go now we are seeing the uh both sides of the mesh so let's go back to the material here let's add the coordinates to this spanner so for this just hold U on the keyboard and left click to add texture coordinates here and I'm going to multiply this with a tiling parameter so let's hold s and left click C to add a scal parameter and let's name this tiling by default I'm going to put one here just to see if if it is working so let's multiply these two together then let's add this into the coordinate here and nothing has changed which means it's right as you can see now let me put maybe five here to add more of these strips and and there we go we have this effect now I want to fade these lines close to the to the upper part of the mesh here so for this we're going to use the second texture so let's go to the content browser here if you don't remember just um press control and space on the keyboard to open the content browser and let's drag these textures here and we just need to multiply these two together so let's add add a multiply here let's multiply this two together and add this into the opacity and as you can see the lines start to fade close to the middle here so let's apply save let's go here there we go we created this cool effect here now we can start creating the blueprint for the pickup so let's close these tabs right now we don't need this let's go to content here and let me create a new folder let's call this blueprints let's open this in here let's create a blueprint Class A simple actor let me name this BP um pickup scanner there you go let's open this and first let's add the scanner mesh so for this just go to add here in in the components and then typee static mesh there you go let me rename this to SM scanner SM stands for static mesh and here in the SM scanner let's choose the static mesh here in the static mesh so let's click here and then let's search for the scanner there we go and as you can see we just added this scanner here let me put a little bit up here there we go and now let's add the effect the pickup effect so let's add another static mesh here there we go let me name this SM pickup effect let's choose the setic mesh here this one there we go now let me compile and save and let me put this in the level so you can see so let's put here let me play this let me increase the size here of the window and there you go we have this pickup here let's now make the device the scanner device move a little bit so it seems like a pickup so let's go back here to the pickup scanner and let's go to the event graph first let's make the model go up and down so for this first we need to get the relative location of the scanner so let's delete these two events here we don't need this and let's create a new variable let me call this scanner uh start position this will be the start position of the motion so this is a vector we need this to be a vector so it is a position now let's set this variable here in the begin play and the values here will be this scanner here so let's get this and from here we can get the relative location there we go and this is the start location of the scanner later we will use this value here so now let's create a timeline to define the motion so let's grab from this and let's type add timeline so for this I'm going to name this um scanner position timeline there go let me put a capital S here there you go let's open this timeline and let's add a new track here so in the track let's add a float track I'm going to name this Alpha there go the length here will be 1 second and now let's add three points to this graph so to add a point just hold shift and left click to add a point so let's add one here and for this point point the time will be zero and the value will be also zero let's add a new Point here so this would be the time would be 0.5 and the value would be one there we go and now let's add a new Point here the time would be one and the value will be zero again so now you can click on these two buttons here to frame this um points in the screen here and and as you can see we have a motion going up and down this is basically the scanner here going up and down as well so let's make this nice curve so it is a little bit smooth so let's select all these points here just hold shift and select these points then right click on a point and change to Auto there we go now we have a nice curve like this now we can compile and say and let's go back to the main graph here we can close this timeline and as you can see we have the alpha here so this is what we're going to use in a lurp node so let's add a lurp here just type lurp and because we are luring between two positions we need the lurp Vector choose lurp Vector here there we go and the first position is the start position so let's get this let's but in the A and for the B we need the up Vector of the scanner so for this let's get this scanner here and let's get the relative rotation there we go and from here we can get the up Vector so let's get up Vector so this is basically the up direction of this scanner so now we can multiply this with with some dist so you can change how far up this motion will be so let's go here in the variables and let's create a new variable here let's name this up distance and this should be a float there you go for now let's put maybe um 50 here let's compile so we can change the default value let's put 50 here so we can test and now we just need to multiply this two so let's drag this and type multiply and for the B let's get the up distance here and this is the B value of the lurp and for the alpha of course is the alpha of the timeline here let's grab this and put here let me add this route here just double click on the line to add this re routes here and now we can set again this value on the scanner so with the scanner here let's drag a reference to the scanner Let's uh drag a wire here and let's type set relative location so we need to set a new location here from the update of the timeline so every time that this timeline updates we need to update the location with this new location here there we go and now if we compile and save let's hit play here let me increase the size here as you can see the motion I think you can see the motion doing only once that's because I forgot to change the timeline to a loop so just add this timeline again double click to open it and here in the timeline just click in this button the loop button just click here now we can compile and save and if we hit play now let me increase as you can see it is going up and down now let's add a way of changing this velocity here for this is really simple we just need to change the rate of this timeline so first let's me drag this a little bit to the left here so we make some room here before playing this timeline we need to change its rate so for this let's get the timeline so every timeline that you add is a component so you can find it here in the variables components it is here scanner position timeline let's get a reference to this and from here we can set the rate set the play rate there we go let's set this before playing the timeline and the new rate we're going to create a variable for this so let me create a new variable here let me call this um position speed there we go let me um put one by default here and now we just need to divide one by this value so let's from this let's type divide but this should be in the B value here the second value and the first one should be one so it is one ided by this value and this is the new rate there we go and now so we can change these values on every instance of this blueprint let's enable the I here just clicking this IE in the variable so you enable the instance editable now let's compile this and save and if we select this blueprint here as you can see in the details we have the position speed so if I increase this this actually makes this a little bit slower because this is in seconds so if I save this and hit play Let Me increase here as you can see now it takes 5 Seconds to do the full motion as you can see and of course you can change this name to um something like let's change this now so position is speed let's change this position Motion in seconds so it is more explanatory so let's save this there we go and now if we increase this we are actually increasing the seconds of this motion so now let's make so while this is going up and down it is actually rotating as well so let's do this okay let's do the rotation now so first let me select all this let me comment this with position there we go let me put a nice blue here there we go and down here let's create the rotation so this will happen every frame so let's add a che event here there we go and first I need to get the rotation of the scanner the the current rotation so let's grab a reference to this scanner here and let's get the relative rot there we go now let's right click on this pin here and split structure pin so we have the X Y and Z here now I need to change this rotation on the z-axis here so first let's create a variable for the rotation speed so let's add here a rotation speed variable this will be a float as well and first let's get this and multiply with the Delta seconds so let's from the Delta seconds here let's multiply with the rotation speed so we get the final velocity here so we we are multiplying this with the Delta time to make this Frame independent so now we just need to add this value on the current Z rotation so let's from this let's add so this is actually on the second pin here and the Z in the first one so this the is the new Z rotation so let's set now in the scanner so let's get this scanner from here we can set the relative rotation there we go let's put the the flow here in the set relev location and from here we can right click and split as well so we we are only changing the Z rotation so let's plug this in the Z here so now if we save and compile let's add some rotation here to the speed maybe 50 there we go let's compile and save now if we hit play Let Me increase this as you can see the scanner are rotating as well so as you as you wish you can go here to the scanner and make this public as well so we can addit this in the instance so if select here the rotation speed is right here so we can increase this maybe to 100 let's see and we increase the rotation speed of the scanner there we go and I forgot to mention but if you want you can go to the blueprint here and then in the up distance you can make this instance editable as well so you can change the up distance in the blueprint so if you want this to go a little bit bit less up you can change this value to maybe 30 let's save this and let's hit play to see and as you can see now it's um is not that high and that's basically it for this first part so in this part we created just the basic structure of this pickup item so in the second part we're going to add functionality to this blueprint so we can actually pick this and add to the character so if you have any questions on this please feel free to ask in the comments and I'll try to help you so if you like this video please hit the like button and subscribe that helps me a lot and as always thank you for watching keep learning and I'll see you next time
Info
Channel: NoWhere
Views: 4,340
Rating: undefined out of 5
Keywords:
Id: QC18yxu2K-s
Channel Id: undefined
Length: 25min 50sec (1550 seconds)
Published: Tue Feb 27 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.