Have multiple UObject (Static Mesh & Anim) available

Lunarix_
Mon, 07 May 2018 12:04:12 +0000
Character & Animation

Hi
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

GetMesh()->SetSkeletalMesh(CarMesh.Object);

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?
Thanks
L

3 posts - 1 participant