# Get how fast an actor is moving forward

**URL:** <https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4, Blueprint, CPP, question\
**Created:** [February 25, 2018, 5:03am UTC](https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275 "2018-02-25T05:03:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hemlock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hemlock](https://forums.unrealengine.com/u/Hemlock)\
**Post date:** [February 25, 2018, 5:03am UTC](https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275/1 "2018-02-25T05:03:19Z")

</div>

I’m trying to get the how fast my character is moving forwards but am have difficulty. Does anyone know of a way to do this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 25, 2018, 5:26am UTC](https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275/2 "2018-02-25T05:26:06Z")

</div>

You want to call GetVelocity (A) and GetActorForwardVector (B). Then feed A and B into a DotProduct node. From that output, call VectorLength and that will be the speed in the forward direction relative to the character.

---

<div class="post-metadata">

**Author:** ![eagletree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eagletree](https://forums.unrealengine.com/u/eagletree)\
**Post date:** [March 12, 2018, 10:18pm UTC](https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275/3 "2018-03-12T22:18:45Z")

</div>

I am trying to understand the answer you provided here. I looked in the Kismet library to find these nodes since I use C++ and am not very good with blueprints, but reverse engineer via the Kismet when a calculation is what I need.

The DotProduct node would take a Vector (.Velocity()) and Vector (.GetActorForwardVector()) as parameters and returns a float, the VectorLength takes in a Vector and returns a float. How do you take the VectorLength (.Size()) of the result of the DotProduct? Could you elaborate on what you meant because I need this calculation, but I’m not understanding how you meant the sequence to work?

I interpreted what you said to work out to:  
speedfloatvalue = DotProduct(ActorVelocity, ActorForwardVector).Size()  
which doesn’t seem possible. Thanks for any clarification.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [March 12, 2018, 10:40pm UTC](https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275/4 "2018-03-12T22:40:37Z")

</div>

In your character class:

```
float ForwardVelocity = FVector::DotProduct(GetVelocity(), GetActorForwardVector());
float RightVelocity = FVector::DotProduct(GetVelocity(), GetActorRightVector());    

```

Yeah I made an oopsie. DotProduct gives you the length, a float. Not a Vector.

---

<div class="post-metadata">

**Author:** ![eagletree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eagletree](https://forums.unrealengine.com/u/eagletree)\
**Post date:** [March 12, 2018, 10:48pm UTC](https://forums.unrealengine.com/t/get-how-fast-an-actor-is-moving-forward/418275/5 "2018-03-12T22:48:11Z")

</div>

Thanks for the clarification. I’m sure it will help others too.
