# How to measure the time it takes an object to go through two points with blueprint?

**URL:** <https://forums.unrealengine.com/t/how-to-measure-the-time-it-takes-an-object-to-go-through-two-points-with-blueprint/1182614>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [May 29, 2023, 6:01pm UTC](https://forums.unrealengine.com/t/how-to-measure-the-time-it-takes-an-object-to-go-through-two-points-with-blueprint/1182614 "2023-05-29T18:01:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corz\_Dev1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Corz\_Dev1](https://forums.unrealengine.com/u/Corz_Dev1)\
**Post date:** [May 29, 2023, 6:01pm UTC](https://forums.unrealengine.com/t/how-to-measure-the-time-it-takes-an-object-to-go-through-two-points-with-blueprint/1182614/1 "2023-05-29T18:01:17Z")

</div>

Im new to Blueprint and i ve been trying to create a way to measure the time it takes the ball to go from point a to point b ( in this case the horizontal planes) but after hours and hours of trying i´ve had no success even after using as base various Youtube tutorials that do diferent timers, so any help would be very aprecciated.

 ![ScreenShot00001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/d/eedd4fa09d2cd9f58dd62a3ebebedc5d703da762.jpeg)

Thanks.

(Please excuse my english, it is not my first languaje)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 29, 2023, 6:48pm UTC](https://forums.unrealengine.com/t/how-to-measure-the-time-it-takes-an-object-to-go-through-two-points-with-blueprint/1182614/2 "2023-05-29T18:48:57Z")

</div>

Well, just use

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/0/7903aee78f6186910353dafeb78efc8703dbd649.png)

when it’s at A, and again at B. Done.

But… how do you know when it passes A and B? Have you setup collision, or…?

---

<div class="post-metadata">

**Author:** ![SamiTheGreat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SamiTheGreat](https://forums.unrealengine.com/u/SamiTheGreat)\
**Post date:** [May 29, 2023, 8:24pm UTC](https://forums.unrealengine.com/t/how-to-measure-the-time-it-takes-an-object-to-go-through-two-points-with-blueprint/1182614/3 "2023-05-29T20:24:37Z")

</div>

If you aren’t having any collisions to check A and B and would like to calculate the time, you can use the following formula:

` s = vt <-> t = s/v, where t = time, s = distance between A and B, and v = velocity of the ball relative to direction of segment from A to B`

In case you are physics simulating the ball and it has gravity (assuming it falls straight down and starts with velocity 0):

`t = sqrt(2 * a * s) / a, where a = gravity (980 cm/s^2), and s = Z-distance between A and B`

If you have starting velocity and the ball respects gravity, you need to use quadratic equation solving from equation:

` s = vt + 0.5at^2 <-> 0.5at^2 + vt + s = 0 <-> t = (-v +-sqrt(v^2 - 4 * a * s)) / a`

---

<div class="post-metadata">

**Author:** ![Corz\_Dev1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Corz\_Dev1](https://forums.unrealengine.com/u/Corz_Dev1)\
**Post date:** [May 29, 2023, 8:58pm UTC](https://forums.unrealengine.com/t/how-to-measure-the-time-it-takes-an-object-to-go-through-two-points-with-blueprint/1182614/4 "2023-05-29T20:58:43Z")

</div>

im still trying to find a way to do so, or think of a way to measure the time with a relation with distance. again, any help would be very aprecciated.

> [@ClockworkOcean](#):
>
> But… how do you know when it passes A and B? Have you setup collision, or…?
