Have multiple UObject (Static Mesh & Anim) available

Hi :slight_smile:
I have a class which created in c++ a car (it’s nearly the simple c++ class from the tutorial)
This sets up it’s mesh and anim in the constructor:

    static ConstructorHelpers::FObjectFinder<USkeletalMesh> CarMesh(TEXT("/Game/Vehicle/Sedan/Sedan_SkelMesh.Sedan_SkelMesh"));
    static ConstructorHelpers::FClassFinder<UObject> AnimBPClass(TEXT("/Game/Vehicle/Sedan/Sedan_AnimBP"));

So now I’d like to have multiple possible meshes and anim classes available for multiple cars.
I can not send a parameter to the constructor, I have to set the FObjectFinder in the constructor (unreal specifications).
So how can I do it now?
Is is possible to have these CarMesh in the .h, set multiple of them in the constructor and use the


later in the begin() for the one I want? How to it then, I can not find the functions for setting the text after it was implemented in the header.

Any ideas how to resolve it?

Hi HarryHighDef,
they are currently set in the constructor - but i can not determine which one should be used because i can not pass any parameters to the constructor.

You could look at performing the set skeletal and set anim bp operations in your construction script, that way you can change the variable and have the model update before begin play.

I’d still set the mesh up but I do anything else until the construction script.

Then in the c++ construction script, read the variables for your skeletal and anim BP and set them on the car.