Help with splines and object iterators in c++

So I am trying to have an actor spawn at the start of a spline, and then move along it. I have this working in Blueprints but am trying to replicate this in c++.

Firstly, I’m trying to find the spline in the game world using an Object Iterator, so that I can then update the transform and rotation of my actor.

I have my actor, and have placed a spline component in my level. However I had a Object iterator which would then set the actors location to the beginning of the spline, however this would never work and the actor would move to near enough the center of the level. I changed my code to diagnose why this was happening, so this is what I have now:

This outputs this in the log:

235043-output.png

As you can see, this means that it thinks there are 5 spline components in my level/world. I don’t know if I’m missing something simple here, but why would it output for 5 splines. The third and fourth logged splines are in the location and of the length of the spline placed in my game world, which adds to my confusion, because there are only 3 points on the spline and they are far apart, so its not like its logging the various points on it, I think.

Any help is appreciated.

Due to the lack of answers and clarification from here, I figured that I should post how I eventually solved the issue. From what I can gather, Unreal has a number of spline initializing components within the game level which the splinecomponent iterator will iterate through, which whilst understandable, is a pain to realise after hours of toiling away trying to fix this.

This is how I resolved it for my project, simply check the name of the current splinecomponent against the name of the spline component you placed within your level. I’d imagine this works for other objectiterators that might run into the same issue.

Note: “Spline” in this instance is a previously defined USplineComponent.