Alright so to get acquainted with the workings of UE4 coding, I watched some tutorial videos from Epic. First, I followed this video to build the source. Then, I began to follow the steps of this video to add some code to a project. So, in line with the steps there, after building / running the solution, I created a new project (“Pizza”). Then I added the same code that he added:
Then, I ran the new code, using the “debug editor” mode. It then opens the screen where I can choose a project; I choose “Pizza”. But in “Pizza”, when I go to add a new blueprint and try to select “Powerup” as my parent class, it doesn’t show up! Here’s an image to show you what I mean.
Any idea what’s going wrong? I hope I didn’t miss something stupidly obvious… I’d be happy to provide any additional information about what I did, if that helps.
Were there any kind of errors in the compiler at all?
What happens if you try to do Add Code to project and check the show all classes to see if your powerup is in that list? I can not get into the editor currently as I’m adding new classes my self.
First of all, child class of AActor does not need Blueprintable as it’s inherent that specifier from AActor, so thats definitely was not a problem
Code looks ok to me, so best guess (guessing that too) is that compiler misses your class for some reason. Rebuild your project (so everything is compiled from zero) and paste compiler output.
Regarding errors - I don’t see anything in particular, besides “Cannot find or open PDB file” (which, I’m quite sure, is not important). Here’s a pastebin to my entire build output, though, just in case.
That might fix the rest case sensitive types. Also with just the solution open if you open the Pizzav2Character.cpp it should now show red marks for these errors.
2> Pizzav2Character.cpp
2>A:\Documents\Unreal Projects\Pizzav2\Source\Pizzav2\Powerup.cpp(21): error C2065: ‘fRotator’ : undeclared identifier
2>A:\Documents\Unreal Projects\Pizzav2\Source\Pizzav2\Powerup.cpp(21): error C2146: syntax error : missing ‘;’ before identifier ‘MyRot’
2>A:\Documents\Unreal Projects\Pizzav2\Source\Pizzav2\Powerup.cpp(21): error C2065: ‘MyRot’ : undeclared identifier
2>A:\Documents\Unreal Projects\Pizzav2\Source\Pizzav2\Powerup.cpp(22): error C2065: ‘MyRot’ : undeclared identifier
2>A:\Documents\Unreal Projects\Pizzav2\Source\Pizzav2\Powerup.cpp(22): error C2228: left of ‘.Roll’ must have class/struct/union
2> type is ‘unknown-type’
2>A:\Documents\Unreal Projects\Pizzav2\Source\Pizzav2\Powerup.cpp(23): error C2065: ‘MyRot’ : undeclared identifier
also note that if the but errors out it will still let you run the last properly built exe which is why you was able to run but saw none of your changes.
Ah, you must be right. I was rebuilding the whole thing (Solution ‘Pizzav2’), which included the engine as well. However, I did open the Pizzav2.sln file, as you can see from the screenshot. Here’s the output to rebuilding just the actual game project (the one inside the “Games” folder):