For anyone who had issues getting at the GitHub repo: I'm a dumbass, and I accidentally left it on 'private' so nobody but me could access it. REALLY SORRY FOR THAT! Should be fixed now 😉
Thank you so much for those tutorial man. im new to ue and had no idea where to start. everything is becoming gradually clearer. you deserve way more subs honestly
Excellent series. I can only imagine the effort required in the production with such detail. Although a long-time c++ dev, I've never wandered into games. So thanks for the great intro!
That is a refreshingly 'humble' comment - respect. Everyone might benefit from extra C++ learning, but perhaps some helpful feedback or clarification might get you back on track? (I was gonna say 'helpful pointers'... but you know... C++ ) Join our discord and ask about anything which confuses you. (unreal-cpp channel) Your attitude will inspire people to want to help you as much as they can. (We are NOT like stackoverflow,; we wont chastise you for 'incorrect' formatting of your question, or look down our noses at you because we *might* know something which you don't. We are all continually learning, and most of the Unreal gamedevs I have encountered so far are more than happy to try and share their knowledge as much as possible.)
@@ggamedev Thank you for the reply. In hindsight, I was probably too tired and overwhelmed by the previous videos, so I wasn't really concentrating. On a rewatch, it seemed much clearer, even though I'm a C++ beginner. The only things I was slightly confused about were some methods I'm unfamiliar with and things that just require practice. Awesome video. Oh, and you've got a nice Discord server. I look forward to asking questions there.
Oh nice. I'm glad you found it useful, and thanks for the comment; positive feedback is always useful - its kinda the thing that keeps us more 'niche' 'tubers making content :-)
i simply envy myself for finding your channel as a ex unity developer who would never try ue with out such help, thank you my friend and please dont stop!
Thank you for taking the time to leave that comment. While I didn't start the channel specifically to 'poach' unity devs, it is nice to know that some are using my content to ease a transition. (Especially after the recent debacle) Even though almost all my posted videos so far are heavily Unreal Engine focused, I fully intend to post more generalized content as well. I don't like that we, as independents; solo devs, small studios, etc., often feel like the engine we use somehow defines who we are, and separates us from each other in some way. After all, we are all facing the same uphill struggle in most cases, and we can learn so much from what our fellow devs do, regardless of any specific platform or framework affiliations. And I have gotta add, when I started the Discord server to support these videos I was really surprised; in almost all cases the people who joined have been great, not only asking questions (which was usually the reason they came in the first place!) but joining in friendly discussions, and taking the time to help other people. That, and the majority of comments left by people like you, here on UA-cam, has really led me to believe that people who make games contain a much higher percentage of 'nice' people, than the general population. :-)
Well done and very much enjoying this series. As a professional software engineer, I've watched my fair share of tutorials on youtube, and I can say that fast majority of them suck something else. You however, not only deliver information in a clear and well thought out manner, but actually make the content funny and enjoyable to watch. I tip my hat too you. I'm glad my buddies and I decided to start with your videos in our introduction to game development.
Great tutorial: gave me a lot of pain and misery untill I just accepted that my project will never find enhanced input and I could never finish it, so I just gave up and downloaded your repository and it somehow worked! I cannot still find any significant dfference between yours and mine projects, but still VERY BIG THANK YOU for this tutorial! I wonder HOW gamedev considers UE as a good business engine since it is so random and pain in the ...
The Unreal community (like many groups of people) is unfortunately divided between some REALLY lovely and helpful people, and the usual morons who simply tell you to 'git gud' and try to 'flex' because they (maybe) know a little more than you do at that point. Of course, that isn't restricted to UE development, you can find similar situations all over the place. Your comment is interesting, because many of us that have been using Unreal for a while had similar experiences when we started with it. It can seem like 'black magic' sometimes, and you don't understand why something happens, or works in a particular way. You get people online advising you to do all sorts of unrelated things to solve certain problems, not because they understand the problem and know that it is a solution, but just because they did a bunch of random stuff and maybe one thing in there happened to fix their issue. There are a couple of reasons why you may have failed to get your project working with EI by yourself, and honestly, you would find it WORTH KNOWING to get to the bottom of the reasons, because it would not only help you moving forward, but it would doubtlessly give you a better understanding of how unreal is set up and used - which has gotta be a good thing. Of course, nobody will really be able to assist you with something like that in UA-cam comments, its just not the right 'media' I suggest you join some unreal development related Discord servers (Ours is a good choice 😉) - people there may be able to help you, and it is easier to post error messages, screenshots, and get some helpful feedback. GOOD LUCK!
I was looking into moving from the old input system to this Enhanced system and was trying to wade through the non-existent, and in parts completely pants, documentation. Then I came across (not literally, of course) your wonderful video. Very thorough explanation that helps a great deal. I now have a lovely enhanced input system that I can show off to my grandchildren in years to come. I also love your delivery - Very dry :)
@@ggamedev Yeah it's a shame that every single beginner UE5 tutorial I've seen doesn't say jack about them and just shows a template and some engine features.
Great series, thanks for sharing all of this! I'm currently building a simple project on both Unity and UE to see which workflow suits me better and your tutorials are salvaging UE for me after the initial negative reaction where I was just overwhelmed by the complexity of it, lol.
Yeah, those initial feelings when you dive into Unreal can be a real downer. I'd love you to join our little discord and let people know what the results of your side-by-side experiments are. Apart from the obvious - the visible results, it would be good to get your feedback on things like the 'friction' of doing different things with each framework, etc. vs the power and capabilities provided by each.
I wanted to come back and thank you for the const FInputActionInstance& InputActionInstance, it's extremely useful, not a lot of people know it, don't forget it guys! I used it in my code to have multiple input actions call one handler function, but this handler function gets the source input action that fired it, and then use if-else to execute special stuff for each input action.
Cool tutorial series. I like how you show errors and how people commonly might have to figure things out on their own, however, it might be a good idea to stick to the Unreal coding/naming standard. You don't even have to dedicate time to explaining it in the video, just following it will make people learn it intuitively and it will help them read & understand UE's codebase, should they need to dive into it.
When the enhanced input system first came out back towards the end of UE4.x, it seemed to me like it was a lot more complicated to use in C++ than in blueprint only projects. I dunno what it was I missed at the time, but once I really 'got into it', i love using it now. I guess the difficulty for many people, is that there are a lot of separate bits that make it up. But once I got used to that, it was a lot better.
These videos have been really great so far! Im really surprised you dont have more subscribers. Do you know when youll upload the rest of the episodes? Im curious about that 6th or 7th episode you have been mentioning...
If you are talking about when I mention 'modules and plugins', that's part 7, and much of the work for that video has already been done, but I wanted to cover stuff in an order I figured would be less confusing specifically for newcomers. (Note: I say 'LESS confusing' 😉) Currently I'm still working on part 5, (literally doing it right now) focussing mainly on the player character class. But it also goes over the often abused 'Tick()' method, and how to use 'Delegates', which is really useful to know. I would do that standard UA-camr kinda thing of pushing you to: 'Subscribe if you haven't, blah blah, notification bell icon, teach your granny to suck eggs, whatever...' But also, if you join the Discord server, I generally message everyone to let them know when I release new videos. Plus, you can discuss stuff, ask questions, maybe even answer other peoples problems if you happen to know something they don't. And of course people on there request that I cover a certain topic, or suggest an ideas for a video, etc. At the moment of writing this, its a pretty quiet and generally very friendly affair, with < 200 users total, and often < 50 actually online at one time. Most people there are helpful, and even if someone doesn't have the specific answer you are looking for, you will at least find others who might be in the same boat as yourself. Which, I think, is kinda nice, especially when you are banging your head (figuratively) against a wall trying to solve something.
Thank you for noticing. Until I actually started making videos myself I kinda took it for granted, and didn't realise you actually needed to do 'work' of any kind to produce them! 😆
Ok, that is a lot more complicated than I expected it to be. I just checked what is generated by default by Unreal with 1st person shooter game and it is just a simple blueprint that is assigning mapping to a context mapping. Seems like a perfect place to use blueprint instead of C++. Or maybe I'm just stupid and missing something.
I actually talk about this in the next videos (both are part 6 lol), where specifically I cover it. Working on them right now, so they should be out soon.
Hey I love your UE tutorials and they've helped me tons! I wonder though, what compelled you to put a bunch of elf guys playing bagpipes at 9:30 while you were talking about the uses of enhanced input 😂 I want to know what relationship you found on your brain between both topics, but I love it and cracked me up!
You are right, I would like to focus and get stuff out there in a more consistent manner. But dude, if you could see some of the stuff I am working on lately... I got a custom photogrammetry hardware setup almost finished now, and I wanna release the schematics and a build video when its done; fully automated, programmable turntable/lighting/mechanized cross polarization filters, etc. I got a bunch of new game assets I made for my RPG project, and started assisting a team with another project. There is some good stuff going on... I wont abandon my UA-cam vids (But still gotta pay those bills you know) I have to say, I have been very pleasantly surprised by how nice *most* people are (compared to some other communities)
@@ggamedev Don't worry man, that last remark I made tongue in cheek. You take your time and focus on what's important to you. You don't owe anything to anyone around here, least of all me. Good luck with all of your projects, looking forward to your next videos.
Getting into the nitty-gritty of the code i'm starting to feel quite lost as it moves so fast and i dont really understand the syntax. Would be great if you could slow down and explain that stuff a little more. Im also really starting to feel the disparity between VS and Ryder. It's not easy to follow a tutorial when everything you do looks different to what i see.
In my project, I am using a Pawn class instead of a Character class and it is not working the same. The handler functions are firing off, with UElogs showing this to be the case, but the movement is not applying. Do I need to do anything differently to make this work?
I use ue4 and i have written the same code as you and the same classes but my project crashes if i press start do you know why? Is it maybe because ue4 is not so capable with enhanced input?
I would have to agree AND disagree there; if you don't have interactable UI to deal with, then you could go for miles without even realizing there was anything other than the default settings. Like the kind of FPS type things that have been the staple of Epic games (and maybe a large part of the reason Unreal does lean a bit in that direction) But don't worry... I'm working on part 6 right now, which is UI focused, and I do cover those settings there :-)
I'm trying to follow along in 5.3 ... and EnhancedInput in the build.cs file is not allowing me to grab the EnhancedInputComponent.h include file. Help?
There is no 5.3 specific reason it wouldnt work. I have a 5.3 project im working on open in front of me right now, it has: the EnhancedInput plugin listed in the .uproject file "EnhancedInput" in the publicdependencymodulenames (its a plugin, and in my case it needs to be a public dependency) And in a playercontroller base class .cpp file, there is a #include "EnhancedInputComponent.h" (not in the .h file, because it is not actually needed there in my specific case) So, that lot does all compile and run ok. First thing I would advise; try re generating the solution file... i know its kinda a generic answer like 'the IT crowd' - 'have you tried turning it off and on again', but you would be surprised how often it fixes things. Failing that, please join our discord and ask for help in the 'unreal-cpp' channel
@ggamedev OK. In between some other regular work, I've been poking at this problem. In service of this problem, I deleted the project and created a new project. I checked the installed files of Unreal 5.3. I checked that EnhancedInput is an activated module. Now... when I add EnhancedInput to the build.cs file before creating the new project, I was getting an error. Now afterwards, the end of the integration log just says this (after awhile of not updating)... unning UnrealHeaderTool for "C:\USERS\DGILBERT\DOCUMENTS\UNREAL PROJECTS\UT\SOURCE\UT\UTCHARACTER.CPP" Cannot find a valid build command in the project's active configuration. Stopping. Running UnrealHeaderTool for "C:\USERS\DGILBERT\DOCUMENTS\UNREAL PROJECTS\UT\SOURCE\UT\UTCHARACTER.H" Cannot find a valid build command in the project's active configuration. Stopping. ... and when I go to add the EnhancedInputComponent.h file to the top of my player controller cpp file, intelisense doesn't recognise it and building breaks with it. I'll relate here that I write code for FreeBSD's kernel and I have a great deal of C and C++ experience. I'm kinda pulling my hair out ... and looking at that utube video of creating an FPS without a prebuilt engine with some thought.
@@randomscribblings I'm actually running into the same problem. Were you able to fix it? EDIT: It somehow works now after I iteratively tried finding the lines that wouldn't compile by commenting everything out and adding it back in bit by bit.... intellisense still says it can't find the header files, but at least it compiles and starts the Unreal Editor ¯\_(ツ)_/¯ EDIT2: Got Intellisense recognizing the files after regenerating the VS Project file from within the Unreal Editor.
Is UInputAction* ActionMove = nullptr; No longer a valid code in latest UE 5.4 ? my Rider editor is not auto complete finding that and when added I get a RED “Cannot resolve symbol UInputAction” -- ?
@@ggamedev yea I did … but i think UE 5.4 has changed a bit.. I had to go cheat and look at your GitHub code which looks a tad different to the video now?
i just want to thank you for making this video. I was trying to learn enhanced input myself but the documentation is just so bad at explaining things i was losing my mind. I also want to ask if i want to learn a new concept for example beacuse the doc is terrible, how do you suggest that i learn about it because there just won't be videos for everything.
That's a great question, and I wish I had a great answer for you... but I don't. 😞 Obviously, the more you learn, and the more comfortable you become with the unreal engine, and its associated tools, etc, then the easier you will find it trying to understand certain things. All the source code is there, and it is certainly one resource you should always consider when trying to understand something. But I'm not going to tell you that is a good thing - IT ISN'T. Something as arguably 'high end' as UE shouldn't have people telling you 'Just read the source code' Because honestly, there are plenty of places where looking at source code wont help you much, and will just waste a HUGE amount of time, taking you down various rabbit holes you didn't really need to take. Yea, we have access to the source, and yes, sometimes it helps. But it is quite distressing to have people who *already* know how something works, usually because others helped them in some manner, tell you to read source code which now (obviously) makes sense to them, because they already know how it works. I stress the point, because a lot of people who go looking for help, get that response, and it just isn't good; it puts some people off continuing with UE completely. So, what *can* you do? Obviously net searches can help with some things. And checking out UA-cam might also help too. Although you may be disappointed, with the majority of YT seemingly focussed on Blueprints. (This is one of the reasons I actually started this YT channel in the first place) The official Unreal forums can also be another place to sometimes find useful assistance. Certain Discord servers.... Again, your mileage may vary - our own Discord server is small and friendly, and we emphasize the 'friendly', but the nature of the small size means that you might not always find someone who knows about the particular aspect you are interested in. (But we generally all try to help each other) Having said that, some of the larger servers either wont answer your questions because there are literally so many people posting, you might as well spit in a thunderstorm, or will treat you to the same kind of contemptuous BS that stack-overflow is famous for; That is... ignoring your actual question which might have been simple to answer, and spending more effort telling you why you didn't ask it in *exactly* the right format for their server. Then, there are a couple of what I would call 'gems'. These are various repositories of unreal related information that you can find on the internet. Its like sifting through elephant dung... and then finally you pull out a diamond which makes it all worth while. Some of these are blogs with useful coverage of certain UE features, others are actual repositories of information, perhaps in the form of notes taken by actual professionals while they were working on unreal projects themselves - then they were generous to put it up for all to refer to. If enough people show interest then I might have to make some kind of video talking about this, or at least a 'links' page on a website somewhere, that the community can update as new sources become available, etc.
at around 24:54 the input actions are mapped with UInputAction * ActionMove = nullptr; although that give errors in the Cpp file, I checked the source on github and it was reformatted to TObjectPtr ActionMove = nullptr; i have no idea when this happened but it caused me a headache. and im a bit lost on what the operator does
In this context the symbols are not operators, they are used in a similar manner as the () symbols are used on functions to specify parameters. In this case, what you are looking at is a TEMPLATE CLASS (Epic denote this by an initial 'T' in their naming convention) With generics, such as template classes, C++ uses those paired angle brackets to denote which 'types' the generic uses. You will see this with other Unreal template classes, such as the very commonly used TArray. You *could* make a class which encapsulated dynamic array functionality for a specific type, like an array of int32. But that was tedious, as you needed to implement very similar classes for every 'typed' array you wanted. If you wanted also an array of Int64, you needed to make another class. So generics were added to the language. TArray is 'generic', you can say you want a TArray 'of' Int32, like so: TArray MyArrayOfInts; TObjectPtr is something Epic added to Unreal around the time UE5 came out, and it is the way you are supposed to do things for UPROPERTIES, instead of using raw pointers. It is used instead of 'raw' pointers in UPROPERTY declarations. If you would like to know more, I have a short about it.... here: ua-cam.com/users/shortsrImAApHm008 Basically, as far as the code is concerned, they have no practical difference to you, the raw pointer way of doing things still works perfectly fine. (Its just that the Editor does not get the additional benefits which TObjectPtr provides) The reason you saw a difference within the video and the code, is because I was in the process of updating things after Epic encouraged us to make the change. A little snapshot of the continuing evolution of the Unreal engine, trapped, like a tiny fly in amber. How poetic? If you need more advice, join our discord, its a lot easier than these damn YT comments! 😉
What is a TObjectPtr and why does your code you uploaded use it but in the video you just use a * and it works? Is this an unreal engine pointer only used sometimes? Is it only for objects? How will I know when to use them or not?
Tobjectptr is a replacement for raw pointers (*). It is used for uproperty values. I talk about it in one of my more recent videos, sorry I can't give you a link, unable to get to a computer right now
Many thanks for the last videos of cpp and ue 5!! Could you make one more video explaining how to develop Crouching and sprint? Because i have seen the comments in this video but it didnt work in my project. Thanks again
Its in the start of the next video... (Which, at the time of writing this, I am currently still making, because... lots of other stuff keeps getting in the way 😉) But, if you are subscribed, or... (don't tell UA-cam) if you are on the Discord server, I usually do a @everyone when I release new videos.
Great video as always, but can you pause between paragraphs so I know that (for example) the word "That" is a start of a new paragraph or sentence not something related to a previous thing?
I do get where you are coming from here. 😉 Its a little bit like a disease... if you watch my earlier videos until now, you see it gets more and more! 😆 I have certainly noted your point, and I'll try to keep myself in check on that.
Wait, so 2 options are hardcoding the paths, or using blueprints (which are unoptimized) to have the references? There is no way to simply serialize the class and assign it in the editor similar to Unity (aka when you mark an asset as public)?
No no... forget the 'unoptimized' thing. Saying 'blueprints' is a bit of a bad thing really, and I wish epic hadn't made things look the way they did. Blueprints as such are actually a collection of different things. They are a subclass of something (ultimately) defined in C++, they are a way of persisting values for things (because they are an 'asset', and they also *CAN* have attached node based programming, or 'visual scripting' if you prefer. The method I proposed, results in what is called 'DATA ONLY BLUEPRINTS', that is, there is NO VISUAL SCRIPTING, and PERFORMANCE IS NOT AFFECTED. And it is basically the same result you describe with Unity. Just with different naming, etc. It is little more than a method to hook up property values (which is a GOOD thing, because those, in and of themselves, can be very complicated, and are often NOT something a programmer should be concerned with, especially for more visual things - sure we write code about them, but the actual runtime values are usually for a level designer or other team member to be concerned with more than the dev. The issue for you, is not that that it works, or is performant. Because IT IS. Trust us. Just look at the majority of professional Unreal games which DO use that technique. Its more that coming from Unity you need to adjust your mindset to get the best from Unreal. They don't work in the same way, and they don't use exactly interchangeable terms, etc. I say this to you regardless of your personal background, but I'm making the assumption you are a professional trying to do your work. Unreal is different, and it is in many ways 'quirky', or 'annoying' even. But it IS proven. It DOES work. And YOU CAN ADAPT. Its the same thing if you were a Java developer, presented with a juicy C# contract... 'YOU CAN DO THIS!' If you can make a game with Unity, you can make a game with basically ANY framework. And the community is there to help you. I'm not saying there wont be some 'pain' involved; there usually is with any platform change. And based on what went down, the most common questions Unity developers have moving to Unreal are about to get so much more popular. Join our discord if you wanna talk specifics, and we can try to help you get up to speed. And of course there are also the official unreal forums. Forums... You know, for people who like to ask a question, but want the answer.... maybe in several weeks or months time 😉
@@ggamedev Thank you for the response. I was a Unity dev, but far from professional. I'm a CompSci college student (mostly specializing in low-level c++), and Unity was my hobby sort to say. I wanted to move to Unreal for a while, especially since I heard it was in C++, but was always discouraged as I thought "why would I learn Unreal and basically start from the beginning when I already am pretty fluent in Unity and I can start working on projects instead of having to learn the basics" And regarding BPs, I have tried using Unreal back when BPs were new just to see what working with UE is like, and that's where my (as reading your reply got me to realize) missinformation came from. For me, due to the tutorials I used to watch at the time, blueprints were basically synonymous with UE's node graph programming. I wasn't aware blueprints represented a far bigger meaning (and now that I think about it, with the meaning you provided, the name "blueprint" makes much more sense)
how would you alter the code to support for possessing a character like the mannequin which moves and turns as expected, but then later possessing a different pawn that needs to move differently, like say a helicopter, boat, or a spaceship? assuming these don't move in the same way the mannequin character does.
Because these are different types of 'Pawn', and as you say yourself, they would move in different ways, you would more than likely have a different APlayerController each each different way of moving. So, for example, a helicopter might move with a control scheme similar to the how a hovering drone also moves - so you could make a controller that would work for both of those types of pawn. Similarly, you might have a controller for all types of boats (if you had different types in a game) The APawn devived classes for the different boats, or helicopters would work in specific ways. (Epic do give you a load of stuff related to vehicles, but imagine you do pretty much everything yourself) So you make an AHoveringVehicleBase class, and you give it methods like Hover() and Strafe(), and you even have them work with a VehicleMass UPROPERTY to do the inertia of the vehicle the way you want. Then the AHoverVehicleController you make would understand how to transfer the relative inputs to the methods the AHoveringVehicleBase would use, so it can direct input to ANY classes derived from it. Then you could knock out a Drone and a Helicopter, as blueprint classes parented to AHoverVehicleBase, assign the correct meshes and animations, and set the VehicleMass property appropriately - so when the drone moves its kinda snappy, and the larger helo has a tendency to keep moving in the same direction, etc. GETTING BACK TO YOUR ORIGINAL QUESTION... Its about how you change the player controller at runtime. Because either you have to have a single controller that understands how to control everything - which is only really a viable option if the different things are basically all pretty much the same - (Possible, but the code can get really messy and horrible) The simplest way, is to use different levels, because each has a different GameMode assiciated with it, and hence different playercontroller class. But no one is really satisfied with that solution, as people want to 'seamlessly' change; the player walks up to a vehicle, and gets in it, for example. There are some really nice ways of doing it with C++, that are a little too complicated to talk about here, maybe in a dedicated video at some point, I dunno. However, there is this way (which I think also is supported by blueprints.) Assuming you can get a reference to your GameMode, and that you have pointers to the Controllers you want to swap between: AMyGameMode* ThisGameMode = Cast(UGameplayStatics::GetGameMode(GetWorld())); ThisGameMode->SwapPlayerControllers(OldController, NewController); Obviously you would need to already have those controllers existing, etc; but its a start at pointing you towards what you wanted to know. Good luck! (Also, if you didn't already, consider joining our Discord and talking about this kind of thing on there. Not only are there a few people who might help you, it is certainly a subject many others would appreciate knowing more about themselves.)
Thanky you so much for such an elaborate answer @@ggamedev I do mostly C++ in UE5, and I'm trying to get my head around the new Enhanced Input system, it does seem to change things up quite significantly, and what used to be "the way to do it" seem to be intentionally avoided by most people I've seen trying to implement a solution with the new system. You say that one would need a single controller for all the functionality, and indeed that does get messy very fast. however I'm not entirely happy with multiple controllers and switching between them. It's fine when switching between modes like from a online lobby where you mostly do menu interactions or just run around while waiting for everyone to ready up, before you transition and get the new GameMode's player controller. Another issue I have with multiple controllers would be AI, and keeping the AI capable without over complicating it even further with multiple different AIControllers for the same entity. In my experience this method you present in this video is very similar to how we would usually go about implementing a input system. Keep a layer of abstraction between the pawn and the controller, where the Controller call functions on the Pawn and the Pawn handles the logic internally. However with this new Enhanced input system I see most people tend to leave the implementation entirely in the pawn, and do nothing with the Controller, which leads me to wonder if that's intended, as it's technically what's done in the Sample Project of Lyra as well, however their input is set up and handled in a separate PawnComponent, (instead of directly in the Pawn). I'll get to my point, with what I've read and gathered. I does seem like one could entirely leave out any and all abstraction out of the Controller, and let the Pawns OnPossess take care of swapping all the input schematics and only implement whats needed in the pawn. Very similar to how we used to do it, except we no longer add an abstraction layer in the controller as it's entirely taken care of by the Enhanced Input system. Is this something you have attempted to implement yet? Switching between different pawns/Characters who has different input schemes. If so, I would love to hear what you found out, what worked and what didn't :) I'll be attempting a few different implementations this weekend :) I'll take you up on the Discord, you'll probably see me there this weekend, trying to get to the bottom of this :)
First of all Thank you for helpful video about Enhanced input. I think we need use hard reference for work with Widgets, I know that you can use the widget component for the character, But if we want to replace the current widget with a new widget to the viewport during at runtime, We need make hard reference, Am I wrong?
You are correct... that you are wrong 😄 In pretty much 99.9% of cases we *never* need to use hard references... to ANY asset. I'm not really sure of your use of the word 'widget' here though, as this video didn't cover widgets (that's coming up in the HUD video) Join the discord if you want to talk about this in more detail, but, to (try) and explain briefly: Say you have 3 different widgets, all for displaying player health, and they all do it in kinda different ways. One if if the player is 'regular', one if they are a 'vampire', and one if they are a 'spirit' (whatever) And you want to change which one is used at runtime, depending on the player's circumstances. So, you make a dataasset, which either; has a property for each one (of type UUserWidget, or a derived type thereof) OR EVEN MORE FLEXIBLE You have a dataasset with a property which is a TArray (or TSet whatever) of another dataasset class. The other data asset has a NAME property and a UUserWidget property. That way you can now, at runtime, dynamically change widgets either by 1) Referencing the specific property (first example) or 2) Giving an FString with the Name of the widget you want to display In theory, the second method would even allow you to have a DLC which had extra UUserWidgets for other player circumstances, not covered by the main game.
how does it look like with the licence. Is this the standart way to implement the enhanced input in c++ because if i want to develop something and i use the same code as in the video how will it look like with the licence about the code? (its possible that i said something wrong or i understand something wrong pls correct me)
@@derallerechte4286 Ahhh I see! All the code for this (and my other tutorials) is available on github, and is released under one of the permissive licenses. Basically you can use that code and do whatever you want with it (As long as you don't do anything naughty; like build a death robot, and use the code to remotely control it, and attack a bunch of people)
@@ggamedev ah okay thanks for your reply! But for my knowledge is it right that this code is the Basic implementation of the enhanced Movement? Is there other versions of implementing the enhanced movement? Other question... Iam new with unreal engine but I want to get in! I saw it has a marketplace with 3d objects. How does it look like with the copyright in the store do you have any knowledge?
@derallerechte4286 it is not THE implementation, simply one way you can do it. You may do things differently depending on the needs of your specific project; certain code might be in different classes, there may be more or less code, etc. This is just a way to get you started. Yes, unreal has a marketplace. It is for more than 'just' assets though, you can buy and sell code, plugins containing classes, even entire frameworks with classes and associated assets. You are not free to do whatever licence you want, you must agree to the epic marketplace licensing. Simply put you can use anything you buy on market place in your unreal games and sell those games.
The 'best'? If you have a pc without a gamepad.... Go and get a gamepad! 😄 I mean, otherwise you have the standard keyboard and mouse, which have been used for various game styles for decades. But honestly, if you connect a gamepad, then you have all of the common input 'bases' covered; you can design and test interfaces that work on a pc, and the same as regards consoles. You might be able to pick up a second-hand xbox one controller from somewhere (or ebay), any of the ones with a USB connector built in (I think the older type had USB Micro and the newer ones USB C, but they both work the same.) You can even use it to navigate within the unreal editor itself (I never do that, though) If you wanna be really swank, then you can go the whole route of getting the windows interface thing, and then you can use it wirelessly, and have to constantly worry about changing batteries... just like the 'real' console players do. NOTE: If you do get a second hand one... give it a going over with alcohol rubs or an antibacterial wipe or two before you use it - the crud from sweaty gamers hands (or any other places they touch - GET IT OUT YOUR DAMN MOUTH!) can really build up on those things. 😉
hwy ohk so i tried implimenting the crouch function the project builds but my player wont crouch can some one help me here is what i did void ACharaController::HandleCrouch() { if (Playercharacter) { if (!Playercharacter->GetCharacterMovement()->IsCrouching()) { Playercharacter->Crouch(); } if (Playercharacter->GetCharacterMovement()->IsCrouching()) { Playercharacter->UnCrouch(); } } }
You want to use ELSE What you are doing is; if you ARE crouching, you try to crouch (again) Then, you test (AGAIN) if you are crouching, and uncrouch end result will always be uncrouching. You don't actually need to reference the CharacterMovement component directly for this, there are properties and functions exposed directly on the Character pawn. You could try something like this: if (Playercharacter->bIsCrouched) Playercharacter->UnCrouch(); else Playercharacter->Crouch();
For anyone who had issues getting at the GitHub repo:
I'm a dumbass, and I accidentally left it on 'private' so nobody but me could access it.
REALLY SORRY FOR THAT!
Should be fixed now 😉
Thank you so much for those tutorial man. im new to ue and had no idea where to start. everything is becoming gradually clearer. you deserve way more subs honestly
Excellent series. I can only imagine the effort required in the production with such detail. Although a long-time c++ dev, I've never wandered into games. So thanks for the great intro!
Thank you for taking the time to post that comment. Its always nice to have one's hard work recognised. 👍
Thank you so much for making these. Your teaching quality is in a tier of its own.
I can fairly say that I reached the point in this guide where I'm lost. I'll be back when I'm better at C++.
That is a refreshingly 'humble' comment - respect.
Everyone might benefit from extra C++ learning, but perhaps some helpful feedback or clarification might get you back on track?
(I was gonna say 'helpful pointers'... but you know... C++ )
Join our discord and ask about anything which confuses you. (unreal-cpp channel)
Your attitude will inspire people to want to help you as much as they can.
(We are NOT like stackoverflow,; we wont chastise you for 'incorrect' formatting of your question, or look down our noses at you because we *might* know something which you don't.
We are all continually learning, and most of the Unreal gamedevs I have encountered so far are more than happy to try and share their knowledge as much as possible.)
@@ggamedev Thank you for the reply.
In hindsight, I was probably too tired and overwhelmed by the previous videos, so I wasn't really concentrating. On a rewatch, it seemed much clearer, even though I'm a C++ beginner. The only things I was slightly confused about were some methods I'm unfamiliar with and things that just require practice. Awesome video.
Oh, and you've got a nice Discord server. I look forward to asking questions there.
@@spaaaaace8952 So is it fair to say you were spaaaaaced out?
@@Phraxas52 Please...
it's been 3months how's your journey learning c++?
29:44 is all I needed. Thank you for the heads up
I've never seen such a fun and informative video in my life. You are really great. Thank you so much for making the video.
And thank you, for taking the time to leave a friendly comment! 👍
Thanks for helping me making my first steps in c++ after 1+ year of learning UE5 👍 It's overwhelming, but with you it's also fun
Oh nice. I'm glad you found it useful, and thanks for the comment; positive feedback is always useful - its kinda the thing that keeps us more 'niche' 'tubers making content :-)
i simply envy myself for finding your channel
as a ex unity developer who would never try ue with out such help, thank you my friend
and please dont stop!
Thank you for taking the time to leave that comment.
While I didn't start the channel specifically to 'poach' unity devs, it is nice to know that some are using my content to ease a transition. (Especially after the recent debacle)
Even though almost all my posted videos so far are heavily Unreal Engine focused, I fully intend to post more generalized content as well.
I don't like that we, as independents; solo devs, small studios, etc., often feel like the engine we use somehow defines who we are, and separates us from each other in some way. After all, we are all facing the same uphill struggle in most cases, and we can learn so much from what our fellow devs do, regardless of any specific platform or framework affiliations.
And I have gotta add, when I started the Discord server to support these videos I was really surprised; in almost all cases the people who joined have been great, not only asking questions (which was usually the reason they came in the first place!) but joining in friendly discussions, and taking the time to help other people.
That, and the majority of comments left by people like you, here on UA-cam, has really led me to believe that people who make games contain a much higher percentage of 'nice' people, than the general population. :-)
Well done and very much enjoying this series. As a professional software engineer, I've watched my fair share of tutorials on youtube, and I can say that fast majority of them suck something else. You however, not only deliver information in a clear and well thought out manner, but actually make the content funny and enjoyable to watch. I tip my hat too you. I'm glad my buddies and I decided to start with your videos in our introduction to game development.
Thank you very much for that feedback, I do appreciate it.
I hope I can continue providing something that is useful. 👍
I REALLY appreciate the work you put into this video, thank you!!!
Great tutorial: gave me a lot of pain and misery untill I just accepted that my project will never find enhanced input and I could never finish it, so I just gave up and downloaded your repository and it somehow worked! I cannot still find any significant dfference between yours and mine projects, but still VERY BIG THANK YOU for this tutorial!
I wonder HOW gamedev considers UE as a good business engine since it is so random and pain in the ...
The Unreal community (like many groups of people) is unfortunately divided between some REALLY lovely and helpful people, and the usual morons who simply tell you to 'git gud' and try to 'flex' because they (maybe) know a little more than you do at that point.
Of course, that isn't restricted to UE development, you can find similar situations all over the place.
Your comment is interesting, because many of us that have been using Unreal for a while had similar experiences when we started with it.
It can seem like 'black magic' sometimes, and you don't understand why something happens, or works in a particular way.
You get people online advising you to do all sorts of unrelated things to solve certain problems, not because they understand the problem and know that it is a solution, but just because they did a bunch of random stuff and maybe one thing in there happened to fix their issue.
There are a couple of reasons why you may have failed to get your project working with EI by yourself, and honestly, you would find it WORTH KNOWING to get to the bottom of the reasons, because it would not only help you moving forward, but it would doubtlessly give you a better understanding of how unreal is set up and used - which has gotta be a good thing.
Of course, nobody will really be able to assist you with something like that in UA-cam comments, its just not the right 'media'
I suggest you join some unreal development related Discord servers (Ours is a good choice 😉) - people there may be able to help you, and it is easier to post error messages, screenshots, and get some helpful feedback.
GOOD LUCK!
AMAZING tutorial! Fun to watch and very informative. Thanks!
Glad you found it helpful. And thanks for taking a moment to leave the comment :-)
I was looking into moving from the old input system to this Enhanced system and was trying to wade through the non-existent, and in parts completely pants, documentation. Then I came across (not literally, of course) your wonderful video. Very thorough explanation that helps a great deal. I now have a lovely enhanced input system that I can show off to my grandchildren in years to come.
I also love your delivery - Very dry :)
It's totally worth it though. The new system is so much better than what we were working with before. 👍
@@ggamedev Yeah it's a shame that every single beginner UE5 tutorial I've seen doesn't say jack about them and just shows a template and some engine features.
Great series, thanks for sharing all of this!
I'm currently building a simple project on both Unity and UE to see which workflow suits me better and your tutorials are salvaging UE for me after the initial negative reaction where I was just overwhelmed by the complexity of it, lol.
Yeah, those initial feelings when you dive into Unreal can be a real downer.
I'd love you to join our little discord and let people know what the results of your side-by-side experiments are.
Apart from the obvious - the visible results, it would be good to get your feedback on things like the 'friction' of doing different things with each framework, etc. vs the power and capabilities provided by each.
@@ggamedev Just joined, thanks for the invitation!
Excellent tutorial! Thank you for putting the time and effort into this
I wanted to come back and thank you for the const FInputActionInstance& InputActionInstance, it's extremely useful, not a lot of people know it, don't forget it guys! I used it in my code to have multiple input actions call one handler function, but this handler function gets the source input action that fired it, and then use if-else to execute special stuff for each input action.
I'm glad it was helpful! :-)
Infusing your courses with humor proves invaluable for navigating the brisk pace of learning.
Cool tutorial series. I like how you show errors and how people commonly might have to figure things out on their own, however, it might be a good idea to stick to the Unreal coding/naming standard. You don't even have to dedicate time to explaining it in the video, just following it will make people learn it intuitively and it will help them read & understand UE's codebase, should they need to dive into it.
These tutorials are incredible!
Thank you very much.
It is nice to know that people find them useful. 😄
I found it quite useful to do all input mapping in C++, as well as binding like you did, personally. good vid!
When the enhanced input system first came out back towards the end of UE4.x, it seemed to me like it was a lot more complicated to use in C++ than in blueprint only projects.
I dunno what it was I missed at the time, but once I really 'got into it', i love using it now.
I guess the difficulty for many people, is that there are a lot of separate bits that make it up. But once I got used to that, it was a lot better.
These videos have been really great so far! Im really surprised you dont have more subscribers. Do you know when youll upload the rest of the episodes? Im curious about that 6th or 7th episode you have been mentioning...
If you are talking about when I mention 'modules and plugins', that's part 7, and much of the work for that video has already been done, but I wanted to cover stuff in an order I figured would be less confusing specifically for newcomers.
(Note: I say 'LESS confusing' 😉)
Currently I'm still working on part 5, (literally doing it right now) focussing mainly on the player character class.
But it also goes over the often abused 'Tick()' method, and how to use 'Delegates', which is really useful to know.
I would do that standard UA-camr kinda thing of pushing you to:
'Subscribe if you haven't, blah blah, notification bell icon, teach your granny to suck eggs, whatever...'
But also, if you join the Discord server, I generally message everyone to let them know when I release new videos.
Plus, you can discuss stuff, ask questions, maybe even answer other peoples problems if you happen to know something they don't.
And of course people on there request that I cover a certain topic, or suggest an ideas for a video, etc.
At the moment of writing this, its a pretty quiet and generally very friendly affair, with < 200 users total, and often < 50 actually online at one time.
Most people there are helpful, and even if someone doesn't have the specific answer you are looking for, you will at least find others who might be in the same boat as yourself.
Which, I think, is kinda nice, especially when you are banging your head (figuratively) against a wall trying to solve something.
@@ggamedev Ok I'll make sure to do that. Thanks for the answer!
thanks for your hardwork
Thank you for noticing.
Until I actually started making videos myself I kinda took it for granted, and didn't realise you actually needed to do 'work' of any kind to produce them! 😆
Ok, that is a lot more complicated than I expected it to be. I just checked what is generated by default by Unreal with 1st person shooter game and it is just a simple blueprint that is assigning mapping to a context mapping. Seems like a perfect place to use blueprint instead of C++.
Or maybe I'm just stupid and missing something.
Thanks for the videos! A little wish: please, make an accent on the decision you've made on changing "UInputAction*" to "TObjectPtr"
I actually talk about this in the next videos (both are part 6 lol), where specifically I cover it.
Working on them right now, so they should be out soon.
Hey I love your UE tutorials and they've helped me tons! I wonder though, what compelled you to put a bunch of elf guys playing bagpipes at 9:30 while you were talking about the uses of enhanced input 😂 I want to know what relationship you found on your brain between both topics, but I love it and cracked me up!
You are underrated and deserve a lot more subs.
Also get your shit together and spit out more parts. I don't want to switch to other inferior guides.
You are right, I would like to focus and get stuff out there in a more consistent manner.
But dude, if you could see some of the stuff I am working on lately...
I got a custom photogrammetry hardware setup almost finished now, and I wanna release the schematics and a build video when its done; fully automated, programmable turntable/lighting/mechanized cross polarization filters, etc.
I got a bunch of new game assets I made for my RPG project,
and started assisting a team with another project.
There is some good stuff going on... I wont abandon my UA-cam vids (But still gotta pay those bills you know)
I have to say, I have been very pleasantly surprised by how nice *most* people are (compared to some other communities)
@@ggamedev Don't worry man, that last remark I made tongue in cheek. You take your time and focus on what's important to you. You don't owe anything to anyone around here, least of all me. Good luck with all of your projects, looking forward to your next videos.
Getting into the nitty-gritty of the code i'm starting to feel quite lost as it moves so fast and i dont really understand the syntax. Would be great if you could slow down and explain that stuff a little more. Im also really starting to feel the disparity between VS and Ryder. It's not easy to follow a tutorial when everything you do looks different to what i see.
Instant subb!!!,you are a legend!!
Thank you, its good to know that you found it useful :-)
In my project, I am using a Pawn class instead of a Character class and it is not working the same.
The handler functions are firing off, with UElogs showing this to be the case, but the movement is not applying.
Do I need to do anything differently to make this work?
for the jump part why are we not able to do something like PlayerCharacter->Jump() for the binding function for the input
I use ue4 and i have written the same code as you and the same classes but my project crashes if i press start do you know why? Is it maybe because ue4 is not so capable with enhanced input?
ADHD approved 👍
A solid tutorial, but input mode is missing, GameAndUI, UIOnly etc. If you don't use mouse in your game, input mode is very useful.
I would have to agree AND disagree there; if you don't have interactable UI to deal with, then you could go for miles without even realizing there was anything other than the default settings. Like the kind of FPS type things that have been the staple of Epic games (and maybe a large part of the reason Unreal does lean a bit in that direction)
But don't worry... I'm working on part 6 right now, which is UI focused, and I do cover those settings there :-)
@@ggamedev Looks like someone finally caught a break! Looking forward to your new videos!
I'm trying to follow along in 5.3 ... and EnhancedInput in the build.cs file is not allowing me to grab the EnhancedInputComponent.h include file. Help?
There is no 5.3 specific reason it wouldnt work. I have a 5.3 project im working on open in front of me right now, it has:
the EnhancedInput plugin listed in the .uproject file
"EnhancedInput" in the publicdependencymodulenames (its a plugin, and in my case it needs to be a public dependency)
And in a playercontroller base class .cpp file, there is a #include "EnhancedInputComponent.h" (not in the .h file, because it is not actually needed there in my specific case)
So, that lot does all compile and run ok.
First thing I would advise; try re generating the solution file... i know its kinda a generic answer like 'the IT crowd' - 'have you tried turning it off and on again', but you would be surprised how often it fixes things.
Failing that, please join our discord and ask for help in the 'unreal-cpp' channel
@ggamedev
OK. In between some other regular work, I've been poking at this problem. In service of this problem, I deleted the project and created a new project. I checked the installed files of Unreal 5.3. I checked that EnhancedInput is an activated module. Now... when I add EnhancedInput to the build.cs file before creating the new project, I was getting an error. Now afterwards, the end of the integration log just says this (after awhile of not updating)...
unning UnrealHeaderTool for "C:\USERS\DGILBERT\DOCUMENTS\UNREAL PROJECTS\UT\SOURCE\UT\UTCHARACTER.CPP"
Cannot find a valid build command in the project's active configuration. Stopping.
Running UnrealHeaderTool for "C:\USERS\DGILBERT\DOCUMENTS\UNREAL PROJECTS\UT\SOURCE\UT\UTCHARACTER.H"
Cannot find a valid build command in the project's active configuration. Stopping.
... and when I go to add the EnhancedInputComponent.h file to the top of my player controller cpp file, intelisense doesn't recognise it and building breaks with it.
I'll relate here that I write code for FreeBSD's kernel and I have a great deal of C and C++ experience. I'm kinda pulling my hair out ... and looking at that utube video of creating an FPS without a prebuilt engine with some thought.
@@randomscribblings I'm actually running into the same problem. Were you able to fix it?
EDIT: It somehow works now after I iteratively tried finding the lines that wouldn't compile by commenting everything out and adding it back in bit by bit....
intellisense still says it can't find the header files, but at least it compiles and starts the Unreal Editor ¯\_(ツ)_/¯
EDIT2: Got Intellisense recognizing the files after regenerating the VS Project file from within the Unreal Editor.
Is UInputAction* ActionMove = nullptr; No longer a valid code in latest UE 5.4 ? my Rider editor is not auto complete finding that and when added I get a RED “Cannot resolve symbol UInputAction” -- ?
Did you add enhanced input plugin to the project, and the enhanced input module to your build Cs file?
@@ggamedev yea I did … but i think UE 5.4 has changed a bit.. I had to go cheat and look at your GitHub code which looks a tad different to the video now?
@@ggamedev and great tutorial thank you!
i just want to thank you for making this video. I was trying to learn enhanced input myself but the documentation is just so bad at explaining things i was losing my mind. I also want to ask if i want to learn a new concept for example beacuse the doc is terrible, how do you suggest that i learn about it because there just won't be videos for everything.
That's a great question, and I wish I had a great answer for you... but I don't. 😞
Obviously, the more you learn, and the more comfortable you become with the unreal engine, and its associated tools, etc, then the easier you will find it trying to understand certain things.
All the source code is there, and it is certainly one resource you should always consider when trying to understand something.
But I'm not going to tell you that is a good thing - IT ISN'T.
Something as arguably 'high end' as UE shouldn't have people telling you 'Just read the source code'
Because honestly, there are plenty of places where looking at source code wont help you much, and will just waste a HUGE amount of time, taking you down various rabbit holes you didn't really need to take.
Yea, we have access to the source, and yes, sometimes it helps.
But it is quite distressing to have people who *already* know how something works, usually because others helped them in some manner, tell you to read source code which now (obviously) makes sense to them, because they already know how it works.
I stress the point, because a lot of people who go looking for help, get that response, and it just isn't good; it puts some people off continuing with UE completely.
So, what *can* you do?
Obviously net searches can help with some things.
And checking out UA-cam might also help too.
Although you may be disappointed, with the majority of YT seemingly focussed on Blueprints.
(This is one of the reasons I actually started this YT channel in the first place)
The official Unreal forums can also be another place to sometimes find useful assistance.
Certain Discord servers.... Again, your mileage may vary - our own Discord server is small and friendly, and we emphasize the 'friendly', but the nature of the small size means that you might not always find someone who knows about the particular aspect you are interested in. (But we generally all try to help each other)
Having said that, some of the larger servers either wont answer your questions because there are literally so many people posting, you might as well spit in a thunderstorm, or will treat you to the same kind of contemptuous BS that stack-overflow is famous for;
That is... ignoring your actual question which might have been simple to answer, and spending more effort telling you why you didn't ask it in *exactly* the right format for their server.
Then, there are a couple of what I would call 'gems'.
These are various repositories of unreal related information that you can find on the internet.
Its like sifting through elephant dung... and then finally you pull out a diamond which makes it all worth while.
Some of these are blogs with useful coverage of certain UE features, others are actual repositories of information, perhaps in the form of notes taken by actual professionals while they were working on unreal projects themselves - then they were generous to put it up for all to refer to.
If enough people show interest then I might have to make some kind of video talking about this, or at least a 'links' page on a website somewhere, that the community can update as new sources become available, etc.
Jumping is not violence at all!
That might depend what, or whom you are jumping upon... and what you are wearing on your feet.
@@ggamedev Jumping is not violence, what you're talking about is landing, which could be very violence.
at around 24:54 the input actions are mapped with
UInputAction * ActionMove = nullptr;
although that give errors in the Cpp file, I checked the source on github and it was reformatted to
TObjectPtr ActionMove = nullptr;
i have no idea when this happened but it caused me a headache. and im a bit lost on what the operator does
In this context the symbols are not operators, they are used in a similar manner as the () symbols are used on functions to specify parameters.
In this case, what you are looking at is a TEMPLATE CLASS (Epic denote this by an initial 'T' in their naming convention)
With generics, such as template classes, C++ uses those paired angle brackets to denote which 'types' the generic uses.
You will see this with other Unreal template classes, such as the very commonly used TArray.
You *could* make a class which encapsulated dynamic array functionality for a specific type, like an array of int32.
But that was tedious, as you needed to implement very similar classes for every 'typed' array you wanted. If you wanted also an array of Int64, you needed to make another class.
So generics were added to the language.
TArray is 'generic', you can say you want a TArray 'of' Int32, like so: TArray MyArrayOfInts;
TObjectPtr is something Epic added to Unreal around the time UE5 came out, and it is the way you are supposed to do things for UPROPERTIES, instead of using raw pointers.
It is used instead of 'raw' pointers in UPROPERTY declarations.
If you would like to know more, I have a short about it.... here:
ua-cam.com/users/shortsrImAApHm008
Basically, as far as the code is concerned, they have no practical difference to you, the raw pointer way of doing things still works perfectly fine.
(Its just that the Editor does not get the additional benefits which TObjectPtr provides)
The reason you saw a difference within the video and the code, is because I was in the process of updating things after Epic encouraged us to make the change.
A little snapshot of the continuing evolution of the Unreal engine, trapped, like a tiny fly in amber.
How poetic?
If you need more advice, join our discord, its a lot easier than these damn YT comments! 😉
@@ggamedev thank you so much
Great series for the rookie like me ! & by the way the github link is 404
I just tried the GitHub link, its working for me....so I dunno what's going on?
@@ggamedev It is 404 for me aswell, might be some repository visibility issue?
The last commit I can see is at May 25 2023 of SQLiteGameDb.@@ggamedev
@razlau1336 & @bruce1887... Please see my pinned comment re: me being a dumbass. Thanks for pointing it out 😄
What is a TObjectPtr and why does your code you uploaded use it but in the video you just use a * and it works?
Is this an unreal engine pointer only used sometimes? Is it only for objects? How will I know when to use them or not?
Tobjectptr is a replacement for raw pointers (*). It is used for uproperty values.
I talk about it in one of my more recent videos, sorry I can't give you a link, unable to get to a computer right now
Thank you a bunch! They were just a little surprising!@@ggamedev
Many thanks for the last videos of cpp and ue 5!! Could you make one more video explaining how to develop Crouching and sprint? Because i have seen the comments in this video but it didnt work in my project. Thanks again
Its in the start of the next video...
(Which, at the time of writing this, I am currently still making, because... lots of other stuff keeps getting in the way 😉)
But, if you are subscribed, or... (don't tell UA-cam) if you are on the Discord server, I usually do a @everyone when I release new videos.
@@ggamedev oh thats great, cant wait to watch it! Thanks
Great video as always, but can you pause between paragraphs so I know that (for example) the word "That" is a start of a new paragraph or sentence not something related to a previous thing?
I do get where you are coming from here. 😉
Its a little bit like a disease... if you watch my earlier videos until now, you see it gets more and more! 😆
I have certainly noted your point, and I'll try to keep myself in check on that.
Wait, so 2 options are hardcoding the paths, or using blueprints (which are unoptimized) to have the references? There is no way to simply serialize the class and assign it in the editor similar to Unity (aka when you mark an asset as public)?
No no... forget the 'unoptimized' thing. Saying 'blueprints' is a bit of a bad thing really, and I wish epic hadn't made things look the way they did.
Blueprints as such are actually a collection of different things. They are a subclass of something (ultimately) defined in C++, they are a way of persisting values for things (because they are an 'asset', and they also *CAN* have attached node based programming, or 'visual scripting' if you prefer.
The method I proposed, results in what is called 'DATA ONLY BLUEPRINTS', that is, there is NO VISUAL SCRIPTING, and PERFORMANCE IS NOT AFFECTED.
And it is basically the same result you describe with Unity. Just with different naming, etc.
It is little more than a method to hook up property values (which is a GOOD thing, because those, in and of themselves, can be very complicated, and are often NOT something a programmer should be concerned with, especially for more visual things - sure we write code about them, but the actual runtime values are usually for a level designer or other team member to be concerned with more than the dev.
The issue for you, is not that that it works, or is performant. Because IT IS. Trust us.
Just look at the majority of professional Unreal games which DO use that technique.
Its more that coming from Unity you need to adjust your mindset to get the best from Unreal.
They don't work in the same way, and they don't use exactly interchangeable terms, etc.
I say this to you regardless of your personal background, but I'm making the assumption you are a professional trying to do your work.
Unreal is different, and it is in many ways 'quirky', or 'annoying' even. But it IS proven. It DOES work. And YOU CAN ADAPT.
Its the same thing if you were a Java developer, presented with a juicy C# contract... 'YOU CAN DO THIS!'
If you can make a game with Unity, you can make a game with basically ANY framework.
And the community is there to help you. I'm not saying there wont be some 'pain' involved; there usually is with any platform change.
And based on what went down, the most common questions Unity developers have moving to Unreal are about to get so much more popular.
Join our discord if you wanna talk specifics, and we can try to help you get up to speed.
And of course there are also the official unreal forums.
Forums...
You know, for people who like to ask a question, but want the answer.... maybe in several weeks or months time 😉
@@ggamedev Thank you for the response. I was a Unity dev, but far from professional. I'm a CompSci college student (mostly specializing in low-level c++), and Unity was my hobby sort to say. I wanted to move to Unreal for a while, especially since I heard it was in C++, but was always discouraged as I thought "why would I learn Unreal and basically start from the beginning when I already am pretty fluent in Unity and I can start working on projects instead of having to learn the basics"
And regarding BPs, I have tried using Unreal back when BPs were new just to see what working with UE is like, and that's where my (as reading your reply got me to realize) missinformation came from. For me, due to the tutorials I used to watch at the time, blueprints were basically synonymous with UE's node graph programming. I wasn't aware blueprints represented a far bigger meaning (and now that I think about it, with the meaning you provided, the name "blueprint" makes much more sense)
how would you alter the code to support for possessing a character like the mannequin which moves and turns as expected, but then later possessing a different pawn that needs to move differently, like say a helicopter, boat, or a spaceship?
assuming these don't move in the same way the mannequin character does.
Because these are different types of 'Pawn', and as you say yourself, they would move in different ways, you would more than likely have a different APlayerController each each different way of moving.
So, for example, a helicopter might move with a control scheme similar to the how a hovering drone also moves - so you could make a controller that would work for both of those types of pawn.
Similarly, you might have a controller for all types of boats (if you had different types in a game)
The APawn devived classes for the different boats, or helicopters would work in specific ways.
(Epic do give you a load of stuff related to vehicles, but imagine you do pretty much everything yourself)
So you make an AHoveringVehicleBase class, and you give it methods like Hover() and Strafe(), and you even have them work with a VehicleMass UPROPERTY to do the inertia of the vehicle the way you want.
Then the AHoverVehicleController you make would understand how to transfer the relative inputs to the methods the AHoveringVehicleBase would use, so it can direct input to ANY classes derived from it.
Then you could knock out a Drone and a Helicopter, as blueprint classes parented to AHoverVehicleBase, assign the correct meshes and animations, and set the VehicleMass property appropriately - so when the drone moves its kinda snappy, and the larger helo has a tendency to keep moving in the same direction, etc.
GETTING BACK TO YOUR ORIGINAL QUESTION...
Its about how you change the player controller at runtime.
Because either you have to have a single controller that understands how to control everything - which is only really a viable option if the different things are basically all pretty much the same - (Possible, but the code can get really messy and horrible)
The simplest way, is to use different levels, because each has a different GameMode assiciated with it, and hence different playercontroller class.
But no one is really satisfied with that solution, as people want to 'seamlessly' change; the player walks up to a vehicle, and gets in it, for example.
There are some really nice ways of doing it with C++,
that are a little too complicated to talk about here, maybe in a dedicated video at some point, I dunno.
However, there is this way (which I think also is supported by blueprints.)
Assuming you can get a reference to your GameMode, and that you have pointers to the Controllers you want to swap between:
AMyGameMode* ThisGameMode = Cast(UGameplayStatics::GetGameMode(GetWorld()));
ThisGameMode->SwapPlayerControllers(OldController, NewController);
Obviously you would need to already have those controllers existing, etc; but its a start at pointing you towards what you wanted to know.
Good luck!
(Also, if you didn't already, consider joining our Discord and talking about this kind of thing on there. Not only are there a few people who might help you, it is certainly a subject many others would appreciate knowing more about themselves.)
Thanky you so much for such an elaborate answer @@ggamedev
I do mostly C++ in UE5, and I'm trying to get my head around the new Enhanced Input system, it does seem to change things up quite significantly, and what used to be "the way to do it" seem to be intentionally avoided by most people I've seen trying to implement a solution with the new system.
You say that one would need a single controller for all the functionality, and indeed that does get messy very fast. however I'm not entirely happy with multiple controllers and switching between them. It's fine when switching between modes like from a online lobby where you mostly do menu interactions or just run around while waiting for everyone to ready up, before you transition and get the new GameMode's player controller.
Another issue I have with multiple controllers would be AI, and keeping the AI capable without over complicating it even further with multiple different AIControllers for the same entity.
In my experience this method you present in this video is very similar to how we would usually go about implementing a input system. Keep a layer of abstraction between the pawn and the controller, where the Controller call functions on the Pawn and the Pawn handles the logic internally.
However with this new Enhanced input system I see most people tend to leave the implementation entirely in the pawn, and do nothing with the Controller, which leads me to wonder if that's intended, as it's technically what's done in the Sample Project of Lyra as well, however their input is set up and handled in a separate PawnComponent, (instead of directly in the Pawn).
I'll get to my point, with what I've read and gathered. I does seem like one could entirely leave out any and all abstraction out of the Controller, and let the Pawns OnPossess take care of swapping all the input schematics and only implement whats needed in the pawn. Very similar to how we used to do it, except we no longer add an abstraction layer in the controller as it's entirely taken care of by the Enhanced Input system.
Is this something you have attempted to implement yet? Switching between different pawns/Characters who has different input schemes. If so, I would love to hear what you found out, what worked and what didn't :)
I'll be attempting a few different implementations this weekend :)
I'll take you up on the Discord, you'll probably see me there this weekend, trying to get to the bottom of this :)
First of all Thank you for helpful video about Enhanced input. I think we need use hard reference for work with Widgets, I know that you can use the widget component for the character, But if we want to replace the current widget with a new widget to the viewport during at runtime, We need make hard reference, Am I wrong?
You are correct... that you are wrong 😄
In pretty much 99.9% of cases we *never* need to use hard references... to ANY asset.
I'm not really sure of your use of the word 'widget' here though, as this video didn't cover widgets (that's coming up in the HUD video)
Join the discord if you want to talk about this in more detail, but, to (try) and explain briefly:
Say you have 3 different widgets, all for displaying player health, and they all do it in kinda different ways.
One if if the player is 'regular', one if they are a 'vampire', and one if they are a 'spirit' (whatever)
And you want to change which one is used at runtime, depending on the player's circumstances.
So, you make a dataasset, which either; has a property for each one (of type UUserWidget, or a derived type thereof)
OR EVEN MORE FLEXIBLE
You have a dataasset with a property which is a TArray (or TSet whatever) of another dataasset class.
The other data asset has a NAME property and a UUserWidget property.
That way you can now, at runtime, dynamically change widgets either by
1) Referencing the specific property (first example)
or
2) Giving an FString with the Name of the widget you want to display
In theory, the second method would even allow you to have a DLC which had extra UUserWidgets for other player circumstances, not covered by the main game.
how does it look like with the licence. Is this the standart way to implement the enhanced input in c++ because if i want to develop something and i use the same code as in the video how will it look like with the licence about the code?
(its possible that i said something wrong or i understand something wrong pls correct me)
I do not understand what you mean regarding **LICENCE**?
What license?
@@ggamedev okay sorry for the weak explanation. I mean about the code copyright(stealing code)
@@derallerechte4286 Ahhh I see!
All the code for this (and my other tutorials) is available on github, and is released under one of the permissive licenses.
Basically you can use that code and do whatever you want with it
(As long as you don't do anything naughty; like build a death robot, and use the code to remotely control it, and attack a bunch of people)
@@ggamedev ah okay thanks for your reply!
But for my knowledge is it right that this code is the Basic implementation of the enhanced Movement?
Is there other versions of implementing the enhanced movement?
Other question...
Iam new with unreal engine but I want to get in! I saw it has a marketplace with 3d objects. How does it look like with the copyright in the store do you have any knowledge?
@derallerechte4286 it is not THE implementation, simply one way you can do it. You may do things differently depending on the needs of your specific project; certain code might be in different classes, there may be more or less code, etc.
This is just a way to get you started.
Yes, unreal has a marketplace.
It is for more than 'just' assets though, you can buy and sell code, plugins containing classes, even entire frameworks with classes and associated assets.
You are not free to do whatever licence you want, you must agree to the epic marketplace licensing.
Simply put you can use anything you buy on market place in your unreal games and sell those games.
So what is the best input for PC without Gamepad ??
The 'best'? If you have a pc without a gamepad....
Go and get a gamepad! 😄
I mean, otherwise you have the standard keyboard and mouse, which have been used for various game styles for decades.
But honestly, if you connect a gamepad, then you have all of the common input 'bases' covered; you can design and test interfaces that work on a pc, and the same as regards consoles.
You might be able to pick up a second-hand xbox one controller from somewhere (or ebay), any of the ones with a USB connector built in (I think the older type had USB Micro and the newer ones USB C, but they both work the same.)
You can even use it to navigate within the unreal editor itself (I never do that, though)
If you wanna be really swank, then you can go the whole route of getting the windows interface thing, and then you can use it wirelessly, and have to constantly worry about changing batteries... just like the 'real' console players do.
NOTE: If you do get a second hand one... give it a going over with alcohol rubs or an antibacterial wipe or two before you use it - the crud from sweaty gamers hands (or any other places they touch - GET IT OUT YOUR DAMN MOUTH!) can really build up on those things. 😉
I was talking about like RPG and only for PC.@@ggamedev
Btw how many Characters classes can this Player Controller posses ??@@ggamedev
hwy ohk so i tried implimenting the crouch function
the project builds but my player wont crouch
can some one help me
here is what i did
void ACharaController::HandleCrouch()
{
if (Playercharacter)
{
if (!Playercharacter->GetCharacterMovement()->IsCrouching())
{
Playercharacter->Crouch();
}
if (Playercharacter->GetCharacterMovement()->IsCrouching())
{
Playercharacter->UnCrouch();
}
}
}
You want to use ELSE
What you are doing is; if you ARE crouching, you try to crouch (again)
Then, you test (AGAIN) if you are crouching, and uncrouch
end result will always be uncrouching.
You don't actually need to reference the CharacterMovement component directly for this, there are properties and functions exposed directly on the Character pawn.
You could try something like this:
if (Playercharacter->bIsCrouched)
Playercharacter->UnCrouch();
else
Playercharacter->Crouch();
thanks @@ggamedev
22:30 For Me
Good work, thx