Loop for a spline
Hello there, So I'm trying to make an object to follow a spline in a loop. As of right now, I've got the object to follow the spline but it only does it once. Whenever it does goes around the spline it stops. Please help me. I'm pretty new to Unreal Engine 4 and all the blueprinting stuff. Here is the blueprint that I have so far.
asked Apr 08 '18 at 03:20 AM in Blueprint Scripting
Had never thought about moving a object along a spline in this fashion, especially as the "Event BeginPlay" is only called one time. Hence the "Time" node must be invoking to keep the movement going (assuming that the movement is not completed in just one call, I.E. the object moves from the start point, to the endpoint with just one call, which if that is the case, the Event BeginPlay is your issue, in that it will only be called one time).
Personally I would set it up to be driven by a Timer, or the Tick. I would in the Event BeginPlay, grab the length of the spline (if it is not changing at run time), and just store that off in a variable, if I needed it, or during the construction of the spline if that is being done at Construction time of the Blueprint).
If you know the object is being moved more than one time before it stops moving, then I would suggest that the value that you are using from the Animation Pin, from the Time Node, has went to a constant value, hence it would look like it was not moving, because the value is never changing. OR The Time node itself is no longer being called. Either of those would stop this blueprint from working as you desire.
But if I was you, I would choose another way of driving the movement, unless you are using some animation that is important to you.
Hope this helps,
answered Apr 08 '18 at 04:49 AM
While I fully agree with Parkyeeun and this approach would make more sense in some / most scenarios; you can loop the Timeline easily with a CustomEvent, like so:
answered Apr 08 '18 at 10:12 AM
Try adding WhileLoop to the Graph.
answered Aug 22 '18 at 10:00 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here