We're working on a game that their default attack is a sort of boomerang type weapon where it shoots from the player and once it reaches a certain point, it returns back to the player regardless of where the player is.

It's a platforming game, and the player is constantly moving so we can have a smooth like animation for the boomerang. I was thinking of using the sine function, but I really have no idea how that works.

If anyone knows how to do something like this, please let me know, thank you.