diff --git a/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.cpp b/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.cpp index 971b7ac..1f2360b 100644 --- a/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.cpp +++ b/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.cpp @@ -25,6 +25,7 @@ void ASplineActor::BeginPlay() { Super::BeginPlay(); + CreateSplineMeshComponents(); } // Called every frame @@ -37,7 +38,12 @@ void ASplineActor::Tick(float DeltaTime) void ASplineActor::OnConstruction(const FTransform& Transform) { Super::OnConstruction(Transform); + + CreateSplineMeshComponents(); +} +void ASplineActor::CreateSplineMeshComponents() +{ if(SplineComponent && SplineMeshMap.Num() > 0) { // lookup all pertinent values diff --git a/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.h b/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.h index 13962e2..7ee2016 100644 --- a/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.h +++ b/UE4Fundamentals12/Source/UE4Fundamentals12/Props/Spline/SplineActor.h @@ -50,6 +50,7 @@ class UE4FUNDAMENTALS12_API ASplineActor : public AActor ASplineActor(); void OnConstruction(const FTransform& Transform) override; + void CreateSplineMeshComponents(); protected: // Called when the game starts or when spawned