FInterpTo over time

Hello!
I want to use FInterpTo to interpolate between two values to adjust the fov of my weapons while aiming, the thing is that i have a float variable (ADSTime) that i would want to feed in and i cannot figure out how because of the ease out this function produce.

Could anyone teach me how i could feed in this time variable to make this Interpolation over time?

PS: I know the existence of FInterpConstantTo, but i would want to use FInterpTo because of the convinient ease

If i understand your question correctly, you need to use the tick function’s DeltaTime parameter.

void AYourCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
    ADSTime = DeltaTime;
}

And then you can use this variable in your FInterpTo.

No, that would override my ADSTime variable completely which is predefined on the constructor, the intention here is doing the interpolation over time, for example, being the ADSTime 0.2f seconds, said interpolation should take exactly 0.2f seconds, if we are speaking about FInterpToConstant you can just resolve the formula but in this case the big ease out takes a big place in here.

I discovered that the speed parameter in this FInterpTo is more something like a 1/time parameter. But the Ease out increases the timing on said function. I don’t need anymore to know the solution of this problem as i worked around it with a lerp and some failsafe clamps, but would be nice having more information about what that speed really means.

Maybe we can solve it by looking at finterp and finterpConstant’s code, here they are :

CORE_API float FMath::FInterpTo( float Current, float Target, float DeltaTime, float InterpSpeed )
{
	// If no interp speed, jump to target value
	if( InterpSpeed <= 0.f )
	{
		return Target;
	}

	// Distance to reach
	const float Dist = Target - Current;

	// If distance is too small, just set the desired location
	if( FMath::Square(Dist) < SMALL_NUMBER )
	{
		return Target;
	}

	// Delta Move, Clamp so we do not over shoot.
	const float DeltaMove = Dist * FMath::Clamp<float>(DeltaTime * InterpSpeed, 0.f, 1.f);

	return Current + DeltaMove;
}

CORE_API float FMath::FInterpConstantTo( float Current, float Target, float DeltaTime, float InterpSpeed )
{
	const float Dist = Target - Current;

	// If distance is too small, just set the desired location
	if( FMath::Square(Dist) < SMALL_NUMBER )
	{
		return Target;
	}

	const float Step = InterpSpeed * DeltaTime;
	return Current + FMath::Clamp<float>(Dist, -Step, Step);
}

I guess now we can do it, but don’t understand why don’t you make your own function ? it would be easier to make a InterpTo over time.

Yes, ive spent some time looking at the code previously, thats what helped me to make that deduction. I would like to have more documentation about this matter because i wouldnt call that value a “Speed”.

Anyways thank you so much for the input. I won’t set it as resolved because it really isnt, but i’ll upvote your answers. As i said before i implemented something else by myself already.