2D boomerang effect

Hello,

I’m currently working on a 2D game with a top-down view of a static player throwing a sword towards enemies. I have managed to make the sword lunge and spin based on the distance you drag your mouse but I can’t manage to make it come back to the player after reaching its maximum “y” value. How would I create that function? I’m new to C# and have mostly worked with GML and Javascript.

I appreciate your answers!

You can use:

float timeCount = 0.0f;

void Update(){

sword.transform.position = Vector2.Lerp(endPosition, playerHandPosition, timeCount);
timeCount = timeCount + Time.deltaTime;
}