InterpToMovementComponent not moving completely to last control point

Hello,

when you set up a UInterpToMovementComponent to stop after one run (OneShot) the last control point is not reached exactly.

From looking at the source code this results from just stopping when the time is greater than the duration, which ignores the fact that the object may not quite be at the last control point due to the last tick not hitting the duration exactly.
Especially when ticks get very long (due to debugging or low fps for example) the difference from the endlocation and desired destination control point become very large.

IMO the component should set the location of the destination control point when stopping by reaching the time limit. This could as well be an option for the component and may apply to the other movementcomponents (didnt check them yet)

To make it most visible create the same InterpToMovementComponent on two objects running parallel to eachother with vastly different MIN_TICK_TIMES. they stop at different locations.

As for now: I think you can work around this by using the OnInterpToStop events and checking for time > 1.0f.

Didnt test this work around just yet, will report how it turns out once i did.

Hope this helps,
Greetings

Hello,

I have attempted to reproduce the issue you are seeing, but I’m not necessarily seeing the same results as you. Could you provide some more information on your setup (code, blueprint screenshots, etc) so I can ensure that I am mirroring what you have?

Thank you

Hello,

I am marking this topic resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

It does persist.

Exact problem:

Using a InterpToMovementComponent with mode oneshot does not update up to the last controlpoint when following conditions are met:

CalculateNewTime(…) at the end of TickComponent(…) hits the timelimit (1.0).
Then the whole component is stopped. And because bStopped is set to true no further update (from the time before CalculateNewTime(…) to 1.0) is done in the next TickComponent(…) iteration. There should be one last call to ComputeMoveDelta(…) with time = 1.0 and MoveUpdatedComponent(…).

This all does only apply to EInterpToBehaviourType::OneShot and EInterpToBehaviourType::OneShot_Reverse. because they have to stop at a defined point which they dont manage to do at all times.

Source:
https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/Components/InterpToMovementComponent.cpp

Hello,

Thank you for the information. In an earlier comment, I requested that you provide a screenshot of your blueprint or the full code that you are using when you are seeing this issue, as I have not been able to reproduce it with my setup. Could you please provide this information?

i dont have the time to set up a project to CONSISTENTLY resproduce the issue to notice it since this is time based and will occur more obvious the less FPS you gain. every oneshot UInterpToMovementComponent should suffer this issue to some extent.

the information i provided should be enough for every developer to see and fix the issue. can you please just hand it over?
it basicly just wont update for time = 1.0 even though it should do that once before stopping.

i will probably fix it myself the next time i want to use this component and submit a pull request since this would be less time consuming than creating a constant reproducable (notable) case.

Without repro steps, we will be unable to log the report. If you are able to fix the issue yourself, definitely feel free to enter a pull request.

If you do end up coming across a consistent repro case, feel free to reopen this topic.

Have a great day

the repro steps are:
create UInterpToMovementComponent with 2 control points,
have it run once (oneshot),
debug and see that actor position != lastControlPoint

anyway if thats not enough i guess we all have to wait until I or someone else decides to fix this.
have a great day