The Easiest Way To Learn Unreal Engine 5 C++

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it's time to stop searching for a guide on unre engine C++ that doesn't actually teach you anything trust me I've been will go small adding custom components and making a custom jump system I've help countless beginners skill into programming and this is a quick and simple guide on how to start first of all you're going to want to create a blank C++ project you're going to want to learn how unre engine works and you're going to want to learn basic C++ I also recommend learning blueprint before you do anything we're going to want to click these three dots here la coding needs to be enabled click settings and re instancing this here it needs to be disabled and you're going to want to close on with engine you're going to right click the project name on the games and here you're going to want to go down to set a start a project you're going to select development add to Windows 64 your project name and you can click this start with debuging or with debuging I think this is better just cuz it's less cled just click that and you can see in the output log it will start building and we've build one succeeded it might take time depending on your PC and the first time is always the slowest and here we have our un engine project we're going to create our first C++ file by going tools and use C++ class and we have all these common classes here and we also have all of these classes we go search for actor we can see there a hierarchy actor is a child of object and Camera actor is a child of camera you go through all of this you'll eventually see character so character deprives from Pawn Pawn deprives from actor I don't think deprives is the righted word which is going to create a character so we're creating a class which is a child of character going to call it player character and we can select a folder you can click here or we can just type in a new folder name called player and create class and this will take a while it always depends on the speed of your PC if you're going to commit to on Eng C++ buying a fast SSD is great this is the live coding thing and you can see we can compile using Control Alt f11 I don't really do that I always compile in visual to do so I'm just going to close this to get it out of my way you can see we have this popup this is because visual shio has detected changes I'm need to reload everything and now under here we have a source folder this is where all of our C++ files are we can see our project name we expand that we can see in the player folder we have created we have the player CPP player H we open up that and we already have a whole bunch of O that's because this include file there's player player character do H as you can see player player character but it doesn't take into account our project name and and we can do two things we can do the project name which is the basics I chose and I'll get rid of the O's in a second once it compiles or we can delete that and just do two different dots and I'll automatically get a file beforehand here we have our header file and a C++ file it both has this copyright notice I'm just going to delete I'm going to save both I'm going to go over what the header and C++ file means in a second but we're going to create a blueprint sub class so right now player character is a child of the character class and we're going to create a blueprint which will be a child of player character so new folder player blueprint class and we have all of these options we picked character for C++ if we search here player character we're not going to get anything but we all it exists see you can see in the fullness it exists but we need to compile again so close unhe engine and compile once again and my unhe engine will scan for changes it'll detect a new class you can see not there's a lot of hierarchy it's not as complex it's a lot better like coding in for example Unity for Unity if you want to have different different enemies you'll have to code multiple different scripts whereas an Unreal Engine you can create an enemy class and you can create children of that class and you can have multiple different enemy types just from one script so right click blue class and now if you search for our player player character we can see we have this which is from character and which is a whole bunch of children and the root is just object select player character name it I'm going to call it blueprint player character and we can open that up here we have our blueprint version and if you look at this menu here and these two tabs here they are both exactly the same except one is a menu and one is two different programming files so to break it down everything in the left side which is my blueprint and components everything here is in the header file what I mean by this uh we can see my blueprint has event begin player event take in here we have begin player tick and we have setup player input component we also have all these components and if you want to create a component it's quite simple over here is all the default values and if you want to change default value you go to the cppp file and change it in the Constructor you can also do everything in here the construction script inside here and as you can see if you go on event graph we have I'm going to delete this one with begin player and we have tick we have begin player and we have tick so let's do something let's do jumping we can delete these to we're going to do it in Blueprint very quickly get UT space and on P it will call jump so this calls a function called jump and we're also going to play a sign to we don't have aign right now these are all add to sign so let's just find a random sign effect that I have saved and just drag and drop it and this will have it and we can search jump now be a jump sign effect so now we also need to do one more thing we need to create a open class uh gameer base I'm going to call it default GMB open it up uh new default Pawn class will be BP player character not the C++ one the blueprint one compile save and in World settings I'm going to select the default game mod base if we press play you can see now we have jumping how we doing this in C++ we're going to go into file and now it's edit project settings and find input I'm pretty sure it's at bottom here and we're going to create an action mapping called jump you can see that these are dicated and to use enhanced input but now it take far too long to set up as a complete beginner so we're going to use the old version since it's isue hopefully in the future un engine make it easier to set up enhanced input in C++ we just click this thing press space bar and that's our input so L go on here and inside our setup player input and this is where we set up our input to call the function we're going to do input component and then an arrow input component is the variable we have here oh wait no it's player input component so player input component is the variable we have here at the top so we're going to call that and we're going to call bind action and this is a variable that will get the action fun name which is here and then we'll call a function that you choose so we're going to do B action and we called it jump so make sure it's the exact same as the name here it's called jump we're going to be IE and then PR we're going to call this which is meaning we're going to affect this class which is the character class and we're going to call a function with an an sign the name of the function and the function name no the name of the class and the function name we don't have any functions now now for jumping so under here do protected this basically means it's not callable from other classes for example an enemy can't make a jump only we can make a jump so jump and two colons not colons brackets and we put void at the start we have a green line just press control Dot and quit definition of Jump by pressing enter so now we can just copy paste this here paste it in we don't need the two and blackets so now when you pess jump it will call the function so that's part one done so we've done the input delete that now I need to call a function and call a sign to call the function it's really simple recreated the player character from a character class character class is called a character and we're looking to color function from a character to do this two colons and then we have all these options that we can choose from we just want to call jump cuz you can see here it's jump and the target is character so Target is character and the function is called jump so now we can jump but how do we call it ass signed where we have a function called Play sign 2D let's say for example you're brand new to programming you have haven't seen any tutorials and you want to know what this is in C++ where as a program you're going to have to learn how to Google so let's go for example and call signed 2D unre C++ and we can see we have play sign 2D here click onto that and if we go here Play sign 2D is the name as soon as the function we're looking for now I might be confused what does all of this mean this is the function we're going to call this is the class we calling it from this is the function name and we also have this thing call it an include file because to F this include file the script cannot access this class so if we go in here up here we going to add a new include file and is kissm and then new folder game play static. H and then we're going to use game play Statics player signed 2D and if you have the two brackets we have a whole bunch of requirements we need to type in we can also go down here we can see the requirements here we can see it requires a world context object it requires assigned and we have volume pitch start time and all of these things these things down here don't matter we just need aign and a world context object World context object is get world and I have assigned which is igned base we don't have assigned yet so inside our header file I'm going to create a new sign B I create an Alx and we're going to call this jump signed now in here we can just press or type jump signed and that's how call assigned now we need to set this has a value and we don't want to do it inside the Constructor or inside begin player or anywhere we want to call it in the X at the details panel to do this do you property and added it anywh save and now the loers edited in here so I'm going to delete that compile save close everything and compile we go into your player blint and we search a jump sign we can see we can add this here because you picked edit anywhere and we're going to do search our jump compile save and player and we have the exact same thing we just did in Blueprint except you don't in C++ I said we do one more thing and we add a custom camera component so in here underneath protected I'm going to go under here actually I'm going to do at the top protected class new camera component camera and you might be wondering your how am I supposed to know this well once again as a programmer you're going to have to learn how to Google so you do camera component on the C++ and we see oh we have a you camer component here it's you camera component so we have to type class since a component the variable name ARS after the variable and the whatever you want to call it inside here you're going to want to camera uh create equals not an Amo equals create default sub object and inside Triangle brackets we're going to want the same class name as here you camera component paste that in over here want to call it camera that's just the name you're going to give it and under here camera setup attachment and you can see we have an o That's because we don't have the include file here we can copy paste that enter here we have setup attachment and Ro component compile we now have our camera which we created in Blueprint we don't see it in the details panel because we didn't give it Vision to do this you do your cop here and last time we did edit any but we just want to make it visible anywhere and we also want to do it blueprint read right and this is just in case you want to edit anything in Blueprint so compile we can see we have our camera we can now move it apart move it up to the head level and we can drag it inside blueprint cuz we've enabled blueprint read right and that's all for the tutorial and that's all we need that's the B basics of on engine this isem really quick if my YouTube tutorials helped I'm cating the course that go above or beyond that improving your skills no matter what your current level of experiences this course will go in much more detail have much more content and even higher quality videos allowing you to skip to toal Hill the release it for this course will be announced very soon
Info
Channel: Acromata
Views: 10,812
Rating: undefined out of 5
Keywords: UE, UE4, UE5, blueprint, blueprint vs c++, course, devlog, game development, input system, programming, tutorial, unreal engine 5, unreal engine 4
Id: GNABEvIaa08
Channel Id: undefined
Length: 16min 11sec (971 seconds)
Published: Fri Mar 22 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.