How to make a "ball throw"?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TheBaldChick

I am making a 2D game where the player is able to aim and throw a projectile. He will then teleport where the projectile lands like Ender Pearls from Minecraft, but in 2D. My question is: how to code the projectile’s movement so that it is smooth and affected by gravity.

Thank you

:bust_in_silhouette: Reply From: andersmmg

You’ll want to use the apply impulse function to start it moving, and the physics will still work but it will act as if it was thrown or launched.