and I want to create consturctor in my own class which I created via Editor. But what happens it says “Constructor cannot be redeclared”. I am using latest UE4 (4.6)
And if you don’t need to use that initialize u can just remove it, if still have the problem i recommend u to try GENERATED_UCLASS_BODY() instead for now
You need to use GENERATED_UCLASS_BODY() and the declaration for the constructor is created automatically. At which point, you only need to add this to your cpp file.
AAmmoPickupActor::AAmmoPickupActor(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
Keep in mind that the editor uses this constructor to create a default object.
I’ve followed the same tutorial yesterday and had no issue. If you hit the build button, does it compile ? From my exprience, Visual Studio can display false positive information, I have noticed this behavior even on the official video tutorials,
Got stumped by this as well, seems to like this is just xcode complaining unnecessarily… it built fine for me when I tried to recompile from the editor and then the error went away in xcode as well.