[Question] The Class Constructor and You

Okay so Ive been messing about, mainly failing but Ive come across something. When assigning components to my Character Actor in C++ the heirarchy set in the constructor isnt updated unless I create a new Blueprint from my Class. Now this makes sense but in a way it doesnt, because its extremely easy to assign and move components around within the blueprint editor, now Im stuck having to copy/paste alot of functionality from one Blueprint to another because I cant change the component heirarchy simply.

I understand the reasoning for having them fixed as the class is fixed but its the fact that the Class Constructor isnt run at all after the Blueprint initial creation thats worrying. I really want to be working in C++ and have my changes propagate and I thought this was one of the perks we would have in the new system vs the Old Archetypes but it seems the limitations will be there regardless.

What Im wondering is what the best workflow is, should I work just in Blueprint and ignore C++ because not all changes propagate? Or should I be working strictly in C++ and not start any Blueprint until Im finished, which is similar to Archetypes? Id prefer if I could switch between them and use them hand in hand, though Im not sure I’ll be accessing Blueprints from C++ as much most people will with hardcoded links to objects (agan like Archetypes).

Sorry for the trouble. We have had a few discussions about similar problems internally, I’m not quite sure if they are exactly what you describe though. We’ll get back to you soon.

That’s not a problem, I think these changes require a restart when doing it via the component editor its actually faster, there is no way to get that back into code.

Just marking this as done n dusted!

“When assigning components to my Character Actor in C++ the heirarchy set in the constructor isnt updated unless I create a new Blueprint from my Class”


You dont have to go as far as creating a new blueprint.

Even though the check mark is green, just click Recompile anyway, and it will update the constructor and the hiearchy properly.

I’ve already reported this issue here were I had to debug it for three hours to figure it out (so I can relate to your concern) :slight_smile:

https://rocket.unrealengine.com/questions/6839/staticmeshcomponent-added-in-c-only-shows-after-cl.html

Rama

PS: Epic staff repro-ed this issue and reported it according to my thread above

I did actually try all 3 compile buttons. The heirarchy doesnt change because attach has already been called:

/** First person camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
TSubobjectPtr EyeCameraComponent;

// Create a CameraComponent 
EyeCameraComponent = PCIP.CreateDefaultSubobject(this, TEXT("EyeCamera"));
EyeCameraComponent->SetWorldScale3D(FVector(0.5, 0.5, 0.5));
EyeCameraComponent->AttachParent = Mesh;
Components.Add(EyeCameraComponent);

Pretty standard Camera Constructor, that Parent doesnt get updated no matter how much I compile. If I knew the logging Id do an editor output. Biggest buff there is C concat, cool.

Hmm, well I hope Epic can help you with this

#Editor Logging
Regarding logging, in your editor shortcut, you can add -log to the end, here’s my editor shortcut:

"C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe" -log

Umm the log its on the windows tab, I was talking about the actual C++ logging commands.