- Home /

# Object movement with different time scale

Hi everyone,

**bodyTransform.position = new Vector3(bodyTransform.position.x, bodyTransform.position.y + heightDelta, bodyTransform.position.z);**

Ricardo

**Answer** by ricardoluz19
·
Jun 22 at 02:29 PM

Hi Everyone,

I have managed to found the solution if this can help anyone in the same situation.

Basically I knew that I had to relate the **heightDelta** with the the Time.DeltaTime somehow, but if I multiply it directly in the instruction above (in the position update), the car when in slow motion will just jump lower as the **Time.DeltaTime** is smaller with a smaller **Time.TimeScale**.

The solution was to use the **Time.DeltaTime** as I am calculating the **heightDelta**. To calculate the jump trajectory I am using a parabolic equation like:

** h = -t^2 + (ti+tf)*t - ti*tf + h0** where (ti,h0) is the initial jump height and time instant.

Let's consider that the car is jumping from the current car position and we start to measure time from the instant we jump, so we can consider

**(ti,h0) = (0,0)**. The tf is the duration of the jump we want. With this we endup with:

**.**

*h = -t^2 + tf*t*Refer to this page where I found similar information: https://answers.unity.com/questions/1113304/how-can-make-my-player-to-jump-like-parabola.html

From this point we can simply replace

**t**by the current

**Time.DeltaTime**to get the height value.

As the car position is being calculated by using the current position itself, I cannot use the

**height**directly coming from the above equation because we will be always adding positive values which will make the car only go up but will not go down.

What we need to do is to calculate the

**heightDelta**that will be result from recursively subtracting the previous from the current

**height**:

*heightDelta = h(n) - h(n-1)*With this we can use different time scales and still mantain the same behaviour when jumping.

### 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.