I have a FInterpCurveVector with 3 points (Start Location, Middle Location, End Location).
Every tick I use the Eval function to get the point on the curve to move a projectile on a curved trajectory but now it moves only in a triangle pattern.
How can I apply some type of easing to the curve?
This is what I have now:
This is what I’m trying to achieve:
this is the code for now
void AProjectile::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
lifeTime += DeltaTime;
if (bCurvedProjectile) {
FVector newLocation = bCurve.Eval(lifeTime, newLocation);
SetActorLocation(newLocation);
}
}
void AProjectile::CreateCurve(FVector vTargetLocation, FVector vMediumLocation, FVector vStartLocation) {
bCurvedProjectile = true;
ProjectileMovementComponent->Velocity = FVector::ZeroVector;
bCurve.AddPoint(0, vStartLocation);
bCurve.AddPoint(1, vMediumLocation);
bCurve.AddPoint(2, vTargetLocation);
}