Hi, I have a ship mesh and it has two steering meshes as external meshes.
The first steering is level one and it has low control on the ship while driving.
The second steering is level two and it has high control on the ship while driving.
I attach the first level mesh by default when the ship is spawned in the level, and I want to replace this default steering when the user picked up the second level steering.
How to replace it?
my struggle to achieve this:
if (DefaultSteeringActor != nullptr)
{
SteeringMesh->SetStaticMesh(OutRow.DefaultSteering);
}
else
{
if (const UDataTable* DT_ShipResources{ LoadObject<UDataTable>(GetWorld(), TEXT("/Game/Tables/ShipResources")) })
{
if (const FST_ShipResources * OutRow{ DT_ShipResources->FindRow<FST_ShipResources>(FName(DefaultSteeringActor->ID), "")})
{
if (ID != FName(TEXT("2")))
{
SteeringMesh->SetStaticMesh(OutRow->SteeringLevel_1);
}
else
{
SteeringMesh->SetStaticMesh(OutRow->SteeringLevel_2);
}
}
}
}
the problem is when I tried to replace the mesh, the engine crashed with error array not found