# What is the cause of this "infinite loop"

**URL:** <https://forums.unrealengine.com/t/what-is-the-cause-of-this-infinite-loop/2679506>\
**Category:** Blueprint\
**Tags:** infinite-loop, unreal-engine, Spline, Blueprint, question\
**Created:** [November 27, 2025, 8:27pm UTC](https://forums.unrealengine.com/t/what-is-the-cause-of-this-infinite-loop/2679506 "2025-11-27T20:27:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ByNovex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ByNovex](https://forums.unrealengine.com/u/ByNovex)\
**Post date:** [November 27, 2025, 8:27pm UTC](https://forums.unrealengine.com/t/what-is-the-cause-of-this-infinite-loop/2679506/1 "2025-11-27T20:27:51Z")

</div>

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:

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [November 28, 2025, 9:13am UTC](https://forums.unrealengine.com/t/what-is-the-cause-of-this-infinite-loop/2679506/2 "2025-11-28T09:13:35Z")

</div>

> [@ByNovex](#):
>
> My guess is that updating the spline is re-calling the construction script

my thoughts too, you could add a bool for canupdate or something?

another option is to split the loop over multiple frames but i dont think you can do that on construction, however you can maybe move it from construction to a CallInEditor Function.

the best option these days though is to use PCG, thats whats its for

---

<div class="post-metadata">

**Author:** ![ByNovex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ByNovex](https://forums.unrealengine.com/u/ByNovex)\
**Post date:** [November 28, 2025, 1:10pm UTC](https://forums.unrealengine.com/t/what-is-the-cause-of-this-infinite-loop/2679506/3 "2025-11-28T13:10:33Z")

</div>

Thanks for answering.

Tried both options but still got the same result.

I’ll definitely use other options in the future. I just wanted to have a better idea of what’s happening here, learn about splines and trying to figure it out a better way to fix this situation since it’s bugging my mind for a while now.
