Call a method when actor reaches a point on spline

I have a spline on which there are multiple points.

I move my actor over the spline.

I want a way to know when the actor reached a specific point on the spline.

How can I do it?

Thanks!

How are you moving the Actor on over the spline?

I am asking because you can probably use your movement method to determine the pair of points (segment of the spline) the Actor is between.

I suspect you change the pair as soon as you reach the end point of the segment in which case you can fire an event as soon as a point is reached.

I am moving the actor based on the timeline calculation as below:

FVector newLocation =
splineComponent->GetLocationAtDistanceAlongSpline(Value

  • splineLength, ESplineCoordinateSpace::World);

    actor->SetActorLocation(newLocation);

You can Add a float Track to your Timeline which changes its value from 0 to 1 at the same time as the object would reach that point on the spline, and use the output of that track in the update execution wire to Branch and if True, it sets a Boolean, executes a function, or fires an event before doing the rest of what it always does during timeline Update. You can Gate or DoOnce that action and make sure it still does the rest of the Update stuff after.