Unreal Engine Character Editor Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this tutorial in this tutorial I want to show you how you can create this character editor where you can change the character like that and when you finish you can start the game with the created character so let's go so the first thing that we need is a character that we can actually edit for this let's copy and paste our third person character and let's rename this to editor character open this up and we can nearly delete everything inside here so we didn't need anything at either event graph we didn't need any variables and we didn't need any camera like that so just your basic character nothing is encrypted and we can just place this character inside the world here I prepared a little cylinder as a platform that the character can stand let's place them right in the middle and move in like that great the second thing is that we need two blueprint structures so right click blueprints structure the first structure will be called body part open this up body part gets three variables the first one is the name itself the name is um text the second one is the mesh itself that's a skeleton mesh object preference and the third one is the static mesh the static mesh is of course unstatic mesh object reference let's create another structures or blueprints structure and this will be the character underscore structure open this up as well the first variable will be the head itself the head is on skeleton mesh object reference so let's create a few more we need at least six like this the second one is the chest as well as the skeleton mesh object reference the third one are the hands the fourth is the legs and in my case the last parts are the hair and the beard in this case in my case it is on static mesh object reference so let's change this up here if yours is a skeleton mesh of course just choose the skeleton mesh doesn't matter so let's save this as well and basically we are done here for the preparing so basically we will use our modular character from the last tutorial link is in description so we have our instance here where just the inventory exists so we need one more variable for this that called character and the character gets of course our character structure if we compile and save this you can see we have all the parts that we can set inside our instance so that we can keep it over the whole game and we need one more function inside here as well so add custom event and this will be the sets character function we get our player character of course to our third person character like this and then we go from our character here pull this out say right clicks with structure pin and we have the body parts here so we get the body parts as well from the character so set skeleton mesh of the mesh itself put this down here like that be sure to uncheck re-enter pose and we can already check the head with the new mesh and we continue so set skeleton mesh for the chest so I skipped the process so basically we just set the skeleton mesh as well as the static mesh if you have one we need this function later if you change the level and want to load our configuration the next step is of course we need a widget so right click use interface widget I already prepared one this is called editor let's open this up let's take a look so basically we have these text blocks here and the text blocks in the middle of these arrows are variables so this is very important that we can set it later beside the text blocks are buttons that just have these text blocks so as an arrow we need this to change the values of course let's close this and we want to make the heart visible of course for this let's select our camera actor here and we want to show the heart next to the character so we go to the level blueprint we need one more variable here this will be left Mouse button press as in Boolean then we call our left Mouse button course on press we want to set it to true and on release we want to set it to false the next step is we say begin play create widget select our editor widget here get the player controller go from the return value and say set show mouse cursor and set it to true then we say right click create a reference to camera actor that we selected go from the camera and set view Target with blend and just connect it as well with the get player controller as you can see and then we go from the return value and say add to viewport like that we will now compile and save this and hit play you can see there's our character there's the heart the next step is we want to rotate the character with our Mouse here it's pretty easy so let's go back to our blueprint editor here and we need some tick event we get our Boolean here need a branch of course to ask like that we select our editor character here inside the world go to our level blueprint right click create a reference to editor character then we say get mouse X say float multiplied by another float set this to 10 again float multiplied by another float and put this to minus one then we go from the editor character and say get actor rotation say right clicks with structure pin again from the editor character we say set actor relative rotation from the true case of course we go here right click split structure pin and then we just go from the jar float plus float and connect it in this goes as well into the drawer and that's it compound save this play as you can see we can rotate the character with our Mouse the next step is of course we want to configrate our hot here so let's open up our part again and let's go to our graph here as you can see we have all the buttons all the text blocks and as well I add up some integers for every body part so nothing special and these body part arrays so as you remember we have our body part structure this one here and we just select the type to array I prepared some things here as you can see these are the head mails you can say it's on the head female the hair the beard chest hands and of course the legs the first thing that we need is a new function so let's create one it called update character so the update character function gets every integer that we have like that and of course every array for the mail and 40 female like that and then we say get actor from class select our editor character then we go from the gender number and say switch on Integer connected in my case I just have 0 and 1 so male and female you can add whatever you want and then we go from every array and say get a copy say right click split structure pin so the head mail was connected with the head number as well down here for the female like that and then we continue this for everything else so I skipped the process as well the next step is we want to set the skeleton mesh for the mesh itself so this will be the first step we copy and paste this down here of course connect it and this will be zero this will be one and uncheck of course the re-init pose so the idea is zero is male one is female so we want to set every skeleton mesh from every body part and as well the text so of course when we want to set the head in this case we will have to get the head text as well up here and want to set the text copy and paste this down here as well and connect the target and then we just go from here from the Hat male select the mesh and this will be the new mesh go from the name and put it into the text as well down here the Hat female the mesh goes into the new mesh the name goes into the text and we continue this for every body part so I skip the process as well as you can see we just set every body part and every text block very important at the end that you set the re-init pose of the last set skeleton mesh on both sides to true then we just get the game instance cars to our instance set the character variable that we set up earlier and set it to every body part that we selected the next step is we need two more functions here the first one is next body part next body part gets to inputs the index as an integer and the body parts of course Essen body part structure as an array it gets one output this will be the index Plus index plus is just an integer Essence single variable pull this out unplug this one copy and paste this down here the first thing is we go from the body parts and say length then we say integer minus integer leave this to 1. then we check if the index is so integer is equal to another integer like that we need to Branch to ask this will be the condition here true goes up here false down here we leave this index plus to zero and the other bond is just the index plus one like that so this will switch the body part that we call the next function is basically the same so we just can duplicate this function called is previous body part of course we can delete this part here so just have the condition and the length we go from the integer check if it's equal to zero this will be our condition go again from the length one to say integer minus integer leave this to one this will be the index plus up here and the second one is the index minus one this is down here and that's it compound safeties we can close the functions now and go back to our empty event graph so we go to details here select our gender next and gender previous on click sorry gender next and previous are the only one they are different to the other functions so we take out the gender number say switch on integer connect both of these here add up two pins and what we do we just switch around the number so if it's zero we want to go to one and if it's on we just go to zero then we just get the gender text here want to set the text in both cases here like that and we just type here female and this will be male and then we just call our update character function and that's it in the other situations we have of course again to the details let's start up with the head on click as well as the previous here and this will be always the same so we just get the head number here as well as the Hat male we call our next body part function up here of course connect the head number with the index the Hat male with the body parts then down here we call our previous body part function the head number goes again to the index the Hat male goes into the body parts and then we just want to set the head number up here to the index Plus as well down here to the index plus and again we just call our update character function so a skipped the process as well so we just do this for every body part last thing is we select our play button on click then we just call the open level function select our favorite level go inside our favorite level here open up the level blueprint called the begin play event get the game instance calls to our my instance and then we just call the set character function and that's it compile and save this let's go back to our character editor hit play can change some things here like that and when we hit the play button down here we can play as our custom character so I hope you enjoyed the tutorial if you have any questions please let me know and yeah goodbye
Info
Channel: Seredias
Views: 33,201
Rating: undefined out of 5
Keywords:
Id: b-YOze8qhws
Channel Id: undefined
Length: 16min 50sec (1010 seconds)
Published: Tue Sep 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.