Star Wars in UE5 Tutorial Series! #6 - Lightsaber Combat Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello welcome back to Star game studios RPG Series in Unreal Engine 5 in today's video we will create the beginnings of the combat system we will give the character a lightsaber combo attack so get your Jedi robes on it's time to swing the blade okay the first thing I want to do in this video is increase the strength of the lightsaber emission open the weapons folder and go to materials doubleclick the saber emissions material change the strength from 50 to 500 the result will be evident at the end of the video next let's get rid of the Frack unless you are going for the kylo ren thing we want a little less flicker increase the pulse speed to 10 click save also rename the file to matore lightsaber glow I want to start with just a couple of animations for the combo attack the first one is in download package number one you should already have it if not there will be a link in the description for the second animation go to the mixim animations page next search for a sword and shield slash choose the first one download the animation without skin to your mixim converter incoming folder if you don't know how to use the converter I have a video on how to do everything the link will be in the description now we can upload the two combat animations into the core animations folder be sure to use the SK mannequin rename the sword slash to saber Attack One and the sword and shield slash to saber Attack 2 let's begin creating the combat system create a new blueprint class of the type actor component in the core blueprints folder name the blueprint bpc uncore saber attacks now we can open up the event vent graph delete the nodes and start with a clean board let's add to the input system so that we have a way to trigger the attacks open the third person folder and go to input go into actions and create a new input action name this I aore saber attack we don't need to change anything here open the input mapping context and add a new mapping find the new input action we just created click the keyboard and press one on the keyboard to set the key we want to use nothing else to change go back into your saber attack event graph and rightclick to search for IIA saber attack use the enhan input action node create a new variable called can attack this will be of type Boolean this will let us know if the character is able to attack drag the new variable out and select get make a branch node connect the branch node to the started pin we want this over the triggered because triggered will play all the attack animations even if we don't want them played started will play only one at a time next create a custom event node name it saber attack from the true Branch pin call the saber attack event set the can attack variable to true so that the character can attack until we make use of the variable later on make another variable of type Boolean and name it is attacking make a branch node and connect it the is attacking to condition create one more variable and name it save attack we need to set this variable to true so we can use it to continue with the combo if we desire from the false pin set the is attacking to true this needs to be true to continue with the attack now to set up the combo create a new custom event and name it saber attack combo under that create another custom event named stop combo connect a branch to the saber attack combo and connect the save attack to the condition pin set the save attack to false to reset it after it is applied from the false pin connect the stop combo event from the saber attack section dragged from is attacking and search for the switch on int node this determines the number of attacks are used during the combo I will explain it further in a bit right right click on the selection pin and promote to variable name the variable attack connect this save attack as well add two pins to represent our two attacks as well from the stop combo event node set the is attacking variable to false to end the combo from there set the attack variable to zero now we need to make the animation montages montages enable you to combine and selectively play animations in a single asset go to your core animations folder and select the two attacks we imported earlier rightclick and select create and then create montages just leave the names as is back in the event graph make another custom event name this event saber attack one drag off and connect to a do once node add a delay of 0.1 just to keep the animations from spamming after that connect a play Montage node select the Montage to play to saber Attack One set the attack variable to one drag a wire all the way back to the reset pin on the do once node doubleclick the wire and make a couple of nodes to clean up select everything and press C on the keyboard give it a comment of saber attack one we have to get a reference to the character mesh but at the moment we don't have access let's create a way to access the X2 blueprint this can be done by doing a cast two a cast two is a way to communicate between Blueprints and use information from one another start by placing an event begin play node then a cast to bpor X2 attach a get owner get owner is where the reference to the character comes from get the mesh from X2 just delete the get skeletal mesh asset node and promote two variable name this variable character mesh over in saber Attack One add the character mesh to the skeletal mesh component pin duplicate the entire attack function and rename it to saber Attack 2 change the custom event to saber attack two select the saber Attack 2 montage set the attack to two in the switch on int node call Saber attack one on the Zero pin and saber attack two on the one pin compile and Save next we must go to our attack animations and enable the root motion on both when it's enabled the animations translation rotation and scale information are applied to the character I've noticed the mixo converter hasn't converted this animation no worries since it is already an unreal engine we can convert it using the ue4 to ue5 retargeter rightclick on the animation and select retarget animation assets duplicate and retarget animation assets select the RTG ue4 Manny ue5 Manny retargeter select skm Manny change the folder to core animations click retarget now you will see it is correct delete the original saber attack one and rename the newly retargeted animation to saber attack 1 don't forget to enable root motion on saber Attack 2 delete the Montage for Attack One and create a new Montage because we deleted the Montage for attack one we need to go back and read it to the play Montage node now we will decide where the attack combo will start continue and end by creating an animation notify blueprint go to the core blueprints folder and create a new blueprint class search under all classes for anom notify name this file anim notify saber continue duplicate the blueprint and rename it anim notify saber end go to the X2 blueprint and add the bpc saber attacks as a component of X2 open the continue blueprint click the functions Tab and select received notify when the notify is triggered the function will be called we want to get the owner of the mesh and cast it to X2 just like before get the bpc saber attacks and call the saber attack combo copy the three nodes owner cast 2 and the bpc saber attacks open the end combo notify and paste them in there hook the nodes up just like before and add the stop combo function compile and save open the saber Attack One montage and pop pause the animation we need to find a point in the animation to continue to the next animation in the combo attack frame 25 looks about right in track one rightclick and add notify select the continue notify we made now we need to set an and notify for the non-combo attack I'm going to set it at frame 43 place the end notify we made so if you press the one key again in between the two notifies the combo will stop let's do the same thing for the second attack Montage open it up and pause the animation frame 28 looks good for the continue frame 42 will be good enough for the end now we can test out the combo attack press the one key once and the character will play the animation for the first attack press it twice in succession and it plays the combo attack great job in the next video we will continue with combat part two
Info
Channel: Stargames Studio
Views: 383
Rating: undefined out of 5
Keywords: Games, unreal engine, unreal engine 5, ue5, RPG game, tutorial, unreal engine RPG game, RPG game unreal engine 5, ue5 RPG game, ue5 beginner tutorial, ue5 how to make an RPG game, unreal engine 5 simple RPG tutorial, unreal engine 5 easy RPG game, easy RPG game tutorial, ue5 RPG series, RPG game series in ue5, star wars, Jedi, Lightsaber, Stargames Studio, combat, lightsaber combat, lightsaber duel, lightsaber, sith, clone trooper
Id: hBt3b5pKvl4
Channel Id: undefined
Length: 18min 59sec (1139 seconds)
Published: Thu Feb 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.