Why would I instanciate components in the constructor ?

Hi !
I’m new to Unreal Engine (I’m coming from Unity) and I’ve troubles understanding when to use C++ or blueprints. The thing I don’t understand is why would I instanciate components in the C++ contructor and not in a Child blueprint of one C++ script.

I understand that we can do that to have the reference in code and then use it for logic. But I see a lot of tutorial setup the camera or the mesh inside the constructor and I don’t understand why. Isn’t it simplier to setup camera position, parent, etc… inside a blueprint ?

They’re tutorials, they just show you how to do that in case you want to. There’s no rule saying you have to.

I put things in C++ that either need to be there (as in the thing they’re doing isn’t available in blueprints) or if I want that code to be rock solid and never change. It reduces the amount of things I have to debug after a blueprint change.

The primary consideration you need to balance out when doing C++/Blueprints is “do I need to access this from C++?” If the answer is yes, then you have to declare and instantiate the thing you’re accessing in C++ as well. You can’t define a variable or reference in blueprints and then access it in C++.

Oh ok ! Thanks you very much for the answer !