This site uses strictly necessary cookies. More Information

X# What is the parabolic formula for a 2D projectile's trajectory

I have a little jumping game where the heigh of the jump varies, so to make the game easier, I want to display the trajectory of the jump. To display it I decided to make a while loop that updates a Line Renderer's vertices, given a resolution int of how many vertices I want.

The only problem now is that I don't know how to get the projectile's trajectory as a function/equation. I will have a constant x velocity, and at the beginning of a jump I add a certain upwards-force. I've only been able to find one potentially useful equation, but it requires a force magnitude and an angle.

**Answer** by elenzil
·
Sep 07, 2016 at 06:34 PM

at the beginning of the jump, figure out the vertical velocity.

then this is the y_position as a function of x_position:

```
// gravity_constant is typically 9.8
t = x_position / x_velocity.
y_position = y_original + t * y_velocity - (t * t * gravity_constant / 2.0).
```

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.