# How to get current acceleration/deceleration of actor in BP?

**URL:** <https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103>\
**Category:** World Creation\
**Tags:** unreal-engine, acceleration, Physics, UE4, question, Blueprint\
**Created:** [January 30, 2020, 4:09pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103 "2020-01-30T16:09:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheKehlim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheKehlim](https://forums.unrealengine.com/u/TheKehlim)\
**Post date:** [January 30, 2020, 4:09pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/1 "2020-01-30T16:09:15Z")

</div>

I’m trying to tilt an actor based on the current acceleration.

Using the `Character Movement` component with `Get Current Acceleration`, i am able to get the pure acceleration of the actor, meaning just the acceleration based on input. If i let go of the controls, my character decelerates, but `Get Current Acceleration` returns (0, 0, 0). This, sadly, is intended behaviour according to the [documentation](https://docs.unrealengine.com/en-US/BlueprintAPI/Pawn/Components/CharacterMovement/GetCurrentAcceleration/index.html).

I want to get the true acceleration in a physical sense. meaning a backwards facing (negative) acceleration vector, every time my character slows down.

Do you have any idea on how i can achieve this?

I want my character to tilt backwards, when he decelerates, similar to the behaviour described in [this video](https://youtu.be/LNidsMesxSE?t=304) by David Rosen of Wolfire Games

---

<div class="post-metadata">

**Author:** ![TheKehlim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheKehlim](https://forums.unrealengine.com/u/TheKehlim)\
**Post date:** [January 30, 2020, 4:18pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/2 "2020-01-30T16:18:43Z")

</div>

Answering my own question with a workaround:

I might go the route of storing the current velocity every tick and then calculate the “true” acceleration using the current velocity, the velocity stored in the previous tick and `Delta Seconds`.

However i’m not satisfied with this solution, as im sure that the engine already calculated this internally and i don’t trust my mathematical ability to create a stable system. Reinventing the wheel and all that.

* * *

**UPDATE** : My current setup looks like this:

 ![296032-anmerkung-2020-01-30-202615.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/b/98b63d41f0ade935bfd75e968483594995488a93.png)

outputs -980.0 while jumping. This setup seems to work for the moment.

**UPDATE2** : Sadly this solution does not solve having the character tilt towards acceleration. As soon as the character reaches teminal velocity ( `Max Walk Speed` ) the effective acceleration is 0 and the character stands upright again. Oh well…

---

<div class="post-metadata">

**Author:** ![TheWraithDrit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheWraithDrit](https://forums.unrealengine.com/u/TheWraithDrit)\
**Post date:** [January 30, 2020, 5:18pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/3 "2020-01-30T17:18:06Z")

</div>

The problem here is that your acceleration is coming from the input component. Your deceleration on the other hand is coming from LACK of input. So you’d have to go into the systems that convert lack of input into slowing down, and figure out how to expose that. I don’t see anything in the engine that exposes that for you. I think your velocity calculations are the best way to handle this in blueprint currently.

---

<div class="post-metadata">

**Author:** ![TheKehlim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheKehlim](https://forums.unrealengine.com/u/TheKehlim)\
**Post date:** [January 30, 2020, 6:04pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/4 "2020-01-30T18:04:45Z")

</div>

as i understand it, the `Character Movement` component handles deceleration as it handles the values for Max Deceleration, Breaking force etc. But the current deceleration does not appear to be exposed.

---

<div class="post-metadata">

**Author:** ![TheWraithDrit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheWraithDrit](https://forums.unrealengine.com/u/TheWraithDrit)\
**Post date:** [January 30, 2020, 6:15pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/5 "2020-01-30T18:15:31Z")

</div>

That component does expose this: [Get Last Update Location | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/BlueprintAPI/Pawn/Components/CharacterMovement/GetLastUpdateLocation/index.html)  
At least then you would not have to store it locally.

---

<div class="post-metadata">

**Author:** ![TheKehlim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheKehlim](https://forums.unrealengine.com/u/TheKehlim)\
**Post date:** [January 30, 2020, 7:20pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/6 "2020-01-30T19:20:28Z")

</div>

hey, thats useful

**edit** : Whoops not really. It exposes location and I need velocity. I rather store “last tick velocity” locally, because if I use location to calculate acceleration, I have to worry about cases of teleportation and the likes.

---

<div class="post-metadata">

**Author:** ![TheWraithDrit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheWraithDrit](https://forums.unrealengine.com/u/TheWraithDrit)\
**Post date:** [January 30, 2020, 7:32pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/7 "2020-01-30T19:32:49Z")

</div>

How about this one: [Get Last Update Velocity | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/BlueprintAPI/Pawn/Components/CharacterMovement/GetLastUpdateVelocity/index.html)  
🙂

---

<div class="post-metadata">

**Author:** ![TheKehlim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheKehlim](https://forums.unrealengine.com/u/TheKehlim)\
**Post date:** [January 30, 2020, 7:37pm UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/8 "2020-01-30T19:37:03Z")

</div>

i didn’t look and you are awesome!

EDIT: I should test before i comment. `Get Last Update Velocity` returns exactly the same value as `Get Velocity`. The doc sais:

> Returns the velocity at the **end** of the last tick.

so, this seems to be a problem. I would need to wait for the current velocity to update, but thats beyond the scope of my implementation.

---

<div class="post-metadata">

**Author:** ![khaixcore9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@khaixcore9](https://forums.unrealengine.com/u/khaixcore9)\
**Post date:** [April 27, 2021, 7:27am UTC](https://forums.unrealengine.com/t/how-to-get-current-acceleration-deceleration-of-actor-in-bp/461103/9 "2021-04-27T07:27:11Z")

</div>

You could give a margin say 20.0 when near to max velocity and set it as accelerating if the actual speed is within this margin

 ![337216-margined-acceleration.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/8/978d6c157edbe78a160b2dd3ba92f395f440b477.jpeg)
