Changed Custom movement component begin play execution order to prevent disable before initialization

This commit is contained in:
Axel 2022-11-18 17:13:14 +01:00 committed by Axel1092
parent e468508862
commit 1e6472ac15
3 changed files with 3 additions and 3 deletions

View File

@ -21,8 +21,8 @@ void UCarSimManagerComponent::CreateCarsimComponent(
#ifdef WITH_CARSIM
UCarSimManagerComponent* CarSimManagerComponent = NewObject<UCarSimManagerComponent>(Vehicle);
CarSimManagerComponent->SimfilePath = Simfile;
CarSimManagerComponent->RegisterComponent();
Vehicle->SetCarlaMovementComponent(CarSimManagerComponent);
CarSimManagerComponent->RegisterComponent();
#else
UE_LOG(LogCarla, Warning, TEXT("Error: CarSim plugin is not enabled") );
#endif

View File

@ -47,8 +47,8 @@ void UChronoMovementComponent::CreateChronoMovementComponent(
}
ChronoMovementComponent->MaxSubsteps = MaxSubsteps;
ChronoMovementComponent->MaxSubstepDeltaTime = MaxSubstepDeltaTime;
ChronoMovementComponent->RegisterComponent();
Vehicle->SetCarlaMovementComponent(ChronoMovementComponent);
ChronoMovementComponent->RegisterComponent();
#else
UE_LOG(LogCarla, Warning, TEXT("Error: Chrono is not enabled") );
#endif

View File

@ -11,8 +11,8 @@
void UDefaultMovementComponent::CreateDefaultMovementComponent(ACarlaWheeledVehicle* Vehicle)
{
UDefaultMovementComponent* DefaultMovementComponent = NewObject<UDefaultMovementComponent>(Vehicle);
DefaultMovementComponent->RegisterComponent();
Vehicle->SetCarlaMovementComponent(DefaultMovementComponent);
DefaultMovementComponent->RegisterComponent();
}
void UDefaultMovementComponent::BeginPlay()