Launch enemy mechanic for platformer

Hi, I’m trying to launch characters with strong hits but I’m not getting the results I want. I’ve tried using lerp and move_towards but without much success.

I’m looking for a launch mechanic similar to Smash, where you can launch characters in an arc really fast, but with strong deceleration using a CharacterBody. I’ve been playing with the numbers but I’m not good enough at math to come up with something that looks and feels good.

Would appreciate if someone could shed some light on this for me.

Try the code snippet I wrote on this post. With that code, you can move a character body in an arc to a target position.

Sorry but I’ve been trying to mess with it and it keeps returning (0,0). I don’t think I understood correctly how to use this. I just put the function on the code and tried calling it on hit.

You set the velocity of the object by calling that function outside the physics process and use move and slide to apply gravity

func launch():
    velocity = calculate_arc_velocity(...)

func physics_process(_delta):
	velocity.y += gravity * _delta