What is the syntax for using super?
Hey, I am used to programming in UE3, and just started getting into UE4. However, while I'm recognizing a lot, I am also confused by some of the new syntaxes for functions (are they called constructors now? Or is that something else?)
I am currently simply trying to call a super in a function so that I can modify it while keeping the parent functionality.
This is what I got so far:
But I am obviously getting a ton of syntax errors, please help? What am I missing?
Also, how do I know my class is correctly parented? I assume the wizard would sort it out, is it this stuff:
asked Dec 13 '15 at 07:57 PM in C++ Programming
You can't override the constructor like that. Instead, ABrawler_Character_Player will need its own constructor and override any values different from the base/parent class' settings in that one.
The syntax for a constructor calling the parent class' constructor looks like this:
For functions, you need to use the virtual and override keywords as described by getnamo and then, yes, call it as Super::Function_Name().
Either way, every function defined in the .cpp file needs to be declared in the corresponding header file (there are exceptions but they're not important here). I mention this because your class example doesn't contain a declaration of the constructor. Forgetting this will also result in some syntax errors.
Try declaring the inherited function in the header of the child class as
The keyword being override. If that doesn't solve it we may need a sample of your compiler errors.
Follow this question
Once you sign in you will be able to subscribe for any updates here