What is the cause of this "infinite loop"

Hi!

I’ve a bp called road which has an actor child and two splines. This bp creates “decorations” along the splines randomly. On construction script I’ve some functionality that scales all the components based on an exposed variable, so I can have different sizes when using the road in other blueprints.

When level loads, I’ve spawn some hundreds of roads and I’m in a situation where adding an extra road triggers the infinite-loop error with this stack:

Script call stack:
Function /Game/Runner/LevelPrototyping/TileComponents/BP_Road.BP_Road_C:UserConstructionScript
Function /Game/Runner/LevelPrototyping/TileComponents/BP_Road.BP_Road_C:CacheDecorationTransform
Function /Game/Runner/Utils/BPF_SplineHelpers.BPF_SplineHelpers_C:GetSplineAllPoints

GetSplineAllPoints is a pure function that uses spline’s “GetSplineLenght” and “GetLocationiatDistanceAlongSpline” functions to return an array.

CacheDecorationTransform saves some random transforms values to a bp’s variable and uses the GetSplineAllPoints function

But before calling CacheDecorationTransform there’s another called function “UpdateScale” which scales the actor child with “SetRelative3DScale” and the splines with SetLocationatSplinePoint which has the “UpdateSpline” bool ticked.

When this bool unticked, it doesn’t trigger the infinite-loop error but the spline doesn’t “scale” as desired, so the decorations aren’t spawned properly.

Additionally, I’m also getting a lot of this logs from the decorations:

LogActor: Loaded Actor (NODE_AddChildActorComponent-5_BP_BaseBlock_C_CAT) with IsValid() == false

Increasing the “Maximum Loop Interation Count” patches this situation but I’d like to properly fix it. The problem is that I don’t know what else to do; moving this logic to beginPlay gets the same result and I hardly doubt that I’m spawning a million of decorations. My guess is that updating the spline is re-calling the construction script (?)

Am I missing something? Does anyone have a better idea what’s happening here?

Thanks a lot,
B.