Download

Is a blueprint extension of an actor the "preferred" method to setup subcomponents?

Background: I’m trying to design an “Infinite Runner” style game, similar to the BP Endless runner tutorial, except I’m starting with the Flying CPP project.

So for my instantiated floors, I added a CPP class to my project that extends Actor.

Now based on the C++ tutorial for components https://docs.unrealengine.com/latest/INT/Programming/Tutorials/Components/1/index.html, it uses static object references to assign and set up the subcomponents programmatically, however, it specifically states this is not the typical method:
From tutorial:"Although you can see the asset location of our Static Mesh asset in the code, hard-coding asset paths is not generally considered the best way to load assets. It is usually preferred to create the Component itself in code if the class needs to use it, and then select the assets in the Unreal Editor. However, it is possible to do this directly in code, and could be faster for programmers debugging or building new features."

So I see how that could easily be done with for instance a player pawn, since there is likely to be only one in a scene, and it can already exist in the editor. My issue is that my actor cannot exist in the scene until run-time since it will be created and placed in a random fashion.

Now my “FloorActor” needs to have many subcomponents, box triggers, arrow components, etc added to it and aligned/scaled specifically relative to their root scene component, so doing that in the editor would be simple and optimal. So for me to use the Unreal Editor to add and align all of the subcomponents, must I then create a blueprint of my CPP class to do that? Double clicking on a blueprint in the content browser opens up the blueprint editor with its viewport…whereas clicking on my CPP actor just opens the class in Visual Studio…

There is no reason that I cannot do this with a Blueprint…but I feel like maybe I am missing something here, since that seems to negate much of the point (performance wise) of using CPP classes when ultimately I will need to create a blueprint for it anyway…