# AddSplinePoint causing C++ infinite creation and creating in a loop

**URL:** <https://forums.unrealengine.com/t/addsplinepoint-causing-c-infinite-creation-and-creating-in-a-loop/477656>\
**Category:** C++\
**Tags:** splinecomponent, unreal-engine, Spline, CPP, question\
**Created:** [January 25, 2021, 10:48am UTC](https://forums.unrealengine.com/t/addsplinepoint-causing-c-infinite-creation-and-creating-in-a-loop/477656 "2021-01-25T10:48:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maddy13294](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maddy13294](https://forums.unrealengine.com/u/Maddy13294)\
**Post date:** [January 25, 2021, 10:48am UTC](https://forums.unrealengine.com/t/addsplinepoint-causing-c-infinite-creation-and-creating-in-a-loop/477656/1 "2021-01-25T10:48:16Z")

</div>

1. When I added spline point manually using C++ as follows

> const FVector position1(0, 0, 0);  
> SplineComponent-\>AddSplinePoint(position1, ESplineCoordinateSpace::Local, true);

It kept creating infinite number of points on top of each other. I called it in an overriden OnConstruction() function.  
How can I create only one spline point?

1. And also how can we create a spline points in a closed loop without in a line. I tried addinga few points with the last point creating on top of starting point. It didn’t work

Thanks in advance
