Going crazy here… I have worked in Unreal Engine for years, with only Blueprints. However, there are definitely times when I have needed to do C++ stuff - BUT each time it’s sooooo hard to even get started that I give up after a while.
Why?
Well for starters, each time I create a C++ class and start editing it, Visual Studio complains about missing stuff - even if I have added NOTHING to the code. Like the header thing - why in gods name can’t VS find it’s own files? WHY do I have to figure out where a *.generated.h file is that I haven’t created? The application should know this already from get go.
And, every time… Same thing, I try starting workarounds to get the thing to even compile, and then I break the project, getting hundreds of error messages in which I don’t even know where to start.
I a normal world this would be the procedure:
Create a C++ class in Unreal.
Start learning to edit it in VS or other app, add your own stuff to an ALREADY working base code template.
Thing is, I never get past step 2 - because UE/VS can’t even create a simple base code template that compiles!
WHAT am I missing here?
Should also say that I have coded some in C# and Python during my years, also in Unity.
I have never come across this crazy behavior of a platform before.
Gahh… Sorry for the rant but I need to learn this really badly and right now I just feel like an idiot.
Moving away from Visual Studio to JetBrains Rider has ultimately given me the best developer experience I ever had with Unreal Engine. I first tried Visual Studio w/ Visual Assist X, but Rider definitely comes with it all.
Visual Studio comes out of the box with poor Unreal Engine support for intellisense. Visual Assist X plugin for VS and the Rider IDE tries to take care of this.
Besides this, Unreal Engine is huge and difficult to get started with.
Ah, ok, maybe I should try Rider.
Yes UE is huge, but I believe I have a fairly good knowledge about it’s general structure since I have been working with it a lot the last few years, with Blueprinting then…
looks like you are experiencing a frustrating issue with setting up C++ projects in Unreal Engine.
Make sure you have installed the required components for C++ development in Unreal Engine. This includes installing Visual Studio with the necessary components. You can find instructions on how to do this in the Unreal Engine documentation.
When you create a new C++ class in Unreal Engine, make sure to select the “Create a new asset based on this class” option. This will generate the necessary header files and other required files for your class.
When you open the generated header file in Visual Studio, make sure to include the necessary headers for the classes and functions you want to use.
If you encounter errors during compilation, start by looking at the first error message and work your way down. Often, one error will cause multiple other errors to occur further down the list, so fixing the first error may resolve many of the others.
PLEASE IGNORE THE ERRORS TAB FROM VISUAL STUDIO, CHECK THE OUTPUT LOG ALWAYS!
If you are still having difficulty, consider seeking help here in the Unreal Engine Forums. There are many experienced people around here who are willing to offer assistance and advices
learning a new programming language or platform can be challenging, and it’s important to be patient and persistent. With time and practice, you will become more comfortable with C++ development and Unreal Engine
i’ve felt the same way. after about a week i got past all the initial troubles though. much of it is just some includes or modules have to be added.
i have been using free trial of rider. it seems to be pretty smart about including a lot of things automatically and intellisense works good.
i think the main difficulty is just that you are working blind a lot of times and have to troubleshoot every little tihng. So it feels very slow compared to blueprint where you seldom have to figure out how to say what you want, and there is never problems of syntax errors or forgetting some include or w/e.
So far I honestly havne’t seen a great benefit to c++ though. It just takes longer to do same thing I could in blueprint, and for the sort of games I am making if htere is a performance benefit it is negligible.
Some things are more ergonomic to do in code, but overall as a solodev I’ve felt like it just increases overall complexity while not benefitting production speed or ergonomics in any significant way.
As someone mentioned, use Tools/Create New C++ Class.
As for missing headers right off the start, this is usually caused by not adding the modules to your build.cs file. You can look up any UE class online and the docs will tell you what module its in. You can then make sure it’s in your PublicDependencyModuleNames. Then you should be able to do #include with just the header name directly.
Thanks for your input, much appreciated! My main objective for using C++ is actually to avoid having to use plugins to some point, i.e. doing things that aren’t possible with Blueprints.