How do i add a boost in velocity to a 2D ball when you press it?

I want to make as when you click the ball, it gets a small velocity boost.

I added gravity through code and programmed it so when you click it checks of you clicked the ball and if you did, it gives it the boost. At first for the rigidbody 2D i was using Kinematic and it worked only ONCE as when i clicked it, it went like rigid2D.velocity = new Vector 3(0, 10f, 0). But this doesn’t ADD to the velocity.

I tried rigid2D.Addforce(new Vector 3(0, 10f, 0)); and it didnt work at all. Prob bc the person on yt using this was in 3D and Rigidbody without 2D and Dynamic.

It sees i click the ball as it Debugs something i wrote. But i am out of ideas and i dont know what to do anymore. Help plss

Rigidbody2D.AddForce is a valid method and should help you achieve what you want, IF your rigidbody is not kinematic. Kinematic rigidbodies don’t respond to physics, so adding force won’t work. To give a boost you will want to set the ForceMode parameter to ForceMode.lmpulse. on a non-kinematic rigidbody.

Otherwise you will probably have to set the velocity directly and apply and remove it with a timer in a coroutine.