## The goal

.

To re-create Super Mario Maker 2’s player jump in Unity3D using recorded position points in game that were collected from multiple recordings I made.

.

.

The peak of the player’s jump is 5.4 units high, and is reached on the 33rd frame when the game is running at 60fps.

.

## Current Progress

.

I am able to re-create part of this by following Sebastian Lague’s YouTube tutorial series on how to create a 2D Platformer Controller, which shows the following formulas needed for solving for the values of gravity and jump velocity to be able to reach the 5.4 units peak at frame 33 /60fps:

.

```
gravity = (2 * jumpHeight) / (timeToJumpPeak^2)
jumpVelocity = gravity * timeToJumpPeak
```

.

I uploaded a copy of my current project folder here if needed. The project is setup to run at 60fps and has the player as a white square jump one frame after it detects the floor. This is for letting us skip frame by frame in the editor to make sure the position matches the SMM2 position recorded. Raycasts are used for collision detection for custom physics.

## My Findings

.

I do not believe the jump arc follows a common parabola. It better matches a polynomial when given a 4th order, but I do not know how to convert a polynomial to code. I simply used Excel to draw the jump arc using the recorded position coordinates of the jump arc and found the polynomial option with 4th order lined up with the positions really well:

.

.

I found a GDC video titled “Math for Game Programmers: Building a Better Jump” where they mention using Runge-Kutta (RK4) which looked promising, but I could not find how to relate that technique to coding a jump. I do think the jump is made up of two parts though. When rising the player follows one path (parabola), and when falling the math for gravity pulling the player changes (follows a different parabola).

.

## The Y Positions

.

Pasted y positions here if needed:

## Question

.

Any guidance in the right direction would be helpful, as I have spent a few months trying to find a way to replicate the jump on my own with no luck so far. Thank you

.