How to smooth reinterp to without having a very slow movement?

Hello,

So my problem is quite simple but I can’t find a way to correct it.

Basically I have an animation that stop when it overlap something and continue when there is no overlap anymore.
I have a float that can goes from 0 to 100, it represent the position of the object in the animation, the object can move from 0 to 100 to 0 to 50 to 0 to… basically it can goes and stop at any value.
Most of the time it has to go from 0 to 100 but interp to makes it move very fast at first and very slow when there is not much distance anymore.
The problem with this is when I have two close overlap, it doesn’t look smooth at all.
For example the object overlap at 10 and there will be an other one at 12. So when the first overlap ends, it basically teleport to around 17-18 making it looks not smooth at all and not even be at the correct position.
The problem disapear when the two overlap are at around 80-82 and more.
The problem also disapear at 79 and less if I make reinterp to slower but it has to be incredibly slow and it’s not what I want to do.

What I want is to make the movement constant and not too fast so this problem doesn’t happen.
I think interp to is simply teleporting to a certain percentage of the distance left which is exactly what I was doing before learning about interp to with similar results.

Also some precision, when it’s at 10 and there will be an other overlap at 12, I can’t know about it so I always have to set the goal to 100. So I know I will never have a very smooth movement this way but at least it shouldn’t goes further than 12 or 13 and moves a bit slower. Also the movement is around 20cm from 0 to 100.

So any idea how I could make this smoother?

Other question I just thought about while writing this, any way of detecting an overlap or collision before it happens? The animation is a rotation so I guess it’s maybe not that simple. That way I could set the goal to 12 instead of 100 and have a better movement.

For such a fine level of control and to define your own easing you can use timelines: Timelines | Unreal Engine Documentation

Raycasting can help you predict overlaps and collisions:
https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/

Thanks for the reply!

I knew about timelines but I always got problem with it so I didn’t really consider it for my problem.
I still tried thought from your recommandation but again I can’t make it work the way I want so I had to simplify it’s use by a lot and do most maths myself instead of using play/stop/reverse.
I only use it with play from start and stop, the result is still not perfect but it`s a lot better and I finally have something smooth!

Raycasting is overkill thought and I would have a lot of maths to do to know where my value should be.

Thanks!

Have you tried FInterp to Constant? FInterp to Constant | Unreal Engine Documentation

1 Like

Just what i needed :slight_smile: