Rather simple task, but having trouble wrapping my head around it:
I want the player to be able to select the the vehicle they want before a race.
the idea so far is to:
- save the selection to their gameinstance,
- load the level
- change the skeletal mesh and animation of the pawn once the level loads.
my problem is this:
AFESPawn::AFESPawn(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// Car mesh
static ConstructorHelpers::FObjectFinder CarMesh(TEXT("/Game/Vehicle/Sedan/Sedan_SkelMesh.Sedan_SkelMesh"));
GetMesh()->SetSkeletalMesh(CarMesh.Object);
static ConstructorHelpers::FClassFinder<UObject> AnimBPClass(TEXT("/Game/Vehicle/Sedan/Sedan_AnimBP"));
GetMesh()->SetAnimInstanceClass(AnimBPClass.Class);
(Pulled from the Vehicle C++ starter project pawn code)
When it does the FClassFinder and then loads the mesh from a string, how would i go about generating that string at run time? My first guess is to make a enum to represent all possible vehicles, then load the respective string paths of all possible vehicles and pass that in…
Note: I trying to make a multiplayer project, so if this would break a networked game, maybe you could point me in the right direction?