# GetVelocity returning really small values

**URL:** <https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [April 15, 2021, 8:15pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650 "2021-04-15T20:15:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrisell/32/746203_2.png) [@chrisell](https://forums.unrealengine.com/u/chrisell)\
**Post date:** [April 15, 2021, 8:15pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/1 "2021-04-15T20:15:21Z")

</div>

Newbie question here. (I’ve been starting to learn UE4 for a little less than a week.)  
I’ve got a simple box, set up as a pawn, that I drive / move around my scene using basic keyboard input. Forward / backward, turn left and right. In the blueprint, I can grab and print the vector from GetActorForwardVector and it shows X,Y and Z values as I would expect. But if I do the same with GetVelocity, I get minute values that barely change. If I drive my box up and over something else in the scene and it begins to fall, then the GetVelocity Z value grows as I’d expect, but just driving around on a flat surface results in values I just don’t understand.

What I’m trying to do is just get the forward velocity of the thing I’m “pushing” around in the scene (ie I don’t have forces or motors - I’m just using AddActorLocalOffset to move the thing around and I want to grab it’s speed).

 ![getvelocity1](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/2/027696d236eecbb0f0503face3a2d7799be0b4f7.jpeg) ![getvelocity2](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/c/1c53a3957ce37907528d9f5be91986a9a5f73e26.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 15, 2021, 9:43pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/2 "2021-04-15T21:43:26Z")

</div>

> [@chrisell](#):
>
> it begins to fall, then the GetVelocity Z value grows as I’d expect

You’re simulating physics (the pawn is affected by gravity) but by _Adding Actor Local Offset_ you’re not _interacting_ with physics. It’s closer to teleporting every frame and it makes the velocity reading inaccurate. When the pawn finally starts falling, the physics simulation kicks in properly and the reading is correct.

In short, this is not the kind of movement you’d use in a setup like this. Adding Actor Offset and physical simulation will not produce velocity.

## You have options:

- for pure physical interaction:  
– ensure the simulated component is the root of the actor (a static mesh / collision)  
– ensure it simulates physics and is affected by gravity  
– _Add Force_ instead of _Add Actor Local Offset_ (this should be World Offset, as local makes little sense but it accidently works ok as we’re not attached to anything)

or

- take advantage of the _Floating Pawn Movement_ component  
– add the Floating Pawn Movement component to the actor (comes with extra features)  
– ensure the simulated component is the root of the actor (a static mesh / collision)  
– ensure the component at the root simulates physics and is affected by gravity  
– use the _Add Movement Input_ node to move it

You can then read velocity from the Floating Pawn Movement component or from the actor as you do. You will even get velocity from both _without_ simulating physics as the component will _fake_ it. But you need simulation for gravity.

As a bonus the abovementioned component comes with extras:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/4/e46b2404123970a0b456c05d66fdadc122dd3e1d.png)

And the way it handles collision is more reliable.

---

<div class="post-metadata">

**Author:** ![chrisell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrisell/32/746203_2.png) [@chrisell](https://forums.unrealengine.com/u/chrisell)\
**Post date:** [April 16, 2021, 3:30pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/3 "2021-04-16T15:30:05Z")

</div>

Thanks for the tips. I did wonder yesterday if it was the first problem you mentioned and I did try an AddForce method but no matter how much force I add in the X direction, it doesn’t move. Meaning either I have it hooked up wrong or the force value needs to be in millions of units?  
This is what I have for AddForce:

 ![velocity3](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/b/2b5104b7ce172c2e7f5ac2b82cb5604cc1b21139.jpeg)

I then stripped that out and added a FloatingPawnMovement instead. The AddMovement node did work (although in world space, not local to my model) but GetVelocity still returned basically zero.

I’m obviously missing one nugget of information here to complete my knowledge on this but I can’t quite figure it out. I’ve been circling the answer for over a day now - I know I’m close.

---

<div class="post-metadata">

**Author:** ![chrisell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrisell/32/746203_2.png) [@chrisell](https://forums.unrealengine.com/u/chrisell)\
**Post date:** [April 16, 2021, 3:37pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/4 "2021-04-16T15:37:12Z")

</div>

Also my test box has now become a tank model I built a while back. Hence the structure and sockets. The intention here is NOT to simulate a tank by the way. 🙂

 ![velocity4](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/5/3597fce49f4e351e300feeadc9d736208d478a75.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 16, 2021, 4:11pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/5 "2021-04-16T16:11:14Z")

</div>

> [@chrisell](#):
>
> Meaning either I have it hooked up wrong or the force value needs to be in millions of units?

Accel Change _False_ ignores mass. The tank is 3t, we need more oooomph. Tick Accel Change to test it out. If it works, disable it and crank up the applied force by a couple of orders of magnitude (at least!)

Moving a 3t box with physics:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/1/a15e74de814852267e29be04deb801f9232c2fb7.png)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/8/ef845d845391f1d2f8b46add264d79c35d3d44fd.gif)](https://gyazo.com/e8661888e4990d1d74f2b0e43341ce8d)

But that’s not how tanks usually move. Force is applied at the centre of the mesh hence the top-heavy behaviour. You can _Apply Force at Location_ but it’s fiddly.

If the collision of the root component is a boxy box (as above), it may be getting stuck - check here for things you could tweak:

> **[How should I create a Pawn which has gravity, simulates box collision...](https://forums.unrealengine.com/questions/1024868/how-should-i-create-a-pawn-which-has-gravity-simul.html)**
>
> I’m quite new to Unreal Engine, so sorry if I have made any obvious mistakes. TLDR: Pawn with FloatingPawnMovement which has box collision and physics is getting stuck on the ground. Character does not seem to be appropriate for what I am creating....

> [@chrisell](#):
>
> The AddMovement node did work (although in world space, not local to my model)

You can transform direction both ways with:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/e/0e6744a683f143079ee070ad341192ebe3d92b89.png)

* * *

> but GetVelocity still returned basically zero.

For a fake tank that moves _somewhat_ realistically:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/3/13f7264ddd7c38ec84ef195dc243f02d5614e264.jpeg)

- the mesh simulates physics and gravity
- the movement component does not care about mass but mass will affect other components the actor interacts with

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 16, 2021, 4:17pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/6 "2021-04-16T16:17:15Z")

</div>

Also, if you want your mind blown:

> [@\[OPEN-SOURCE\] Machinery Modelling Toolkit](https://forums.unrealengine.com/t/open-source-machinery-modelling-toolkit/54422):
>
> \*\*No C++ is needed, this works as Rama’s Victory plugin - it adds extra nodes and classed to BP. There is no need to write C++ code unless you really want to smiley \*\* Feature plans The long term plan is to extend plugin with more functions which a necessary for physics calculations and add more components that can be used as building blocks to model whatever you want. Components such as wheels, tracks, springs, suspension, airfoil, engine, gear box and many more. Small bui…

---

<div class="post-metadata">

**Author:** ![chrisell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrisell/32/746203_2.png) [@chrisell](https://forums.unrealengine.com/u/chrisell)\
**Post date:** [April 16, 2021, 4:32pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/7 "2021-04-16T16:32:29Z")

</div>

Ok, upping the force and ticking ‘Accel Change’ worked - and did exactly what you’d expect - it caught the edge of the tank collision volume and rolled it up on its side, but I did get a velocity 😃  
So I went with the Floating pawn movement instead and things are going the right way now. Excuse my ignorance (like I said - only in week 1 of UE) but the yellow node in your diagram that takes the floating pawn movement and pipes it to the vector length - what node is that?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 16, 2021, 4:37pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/8 "2021-04-16T16:37:36Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/5/a5fbd29d76ff1a6fd27402bd1c4c63bc63990474.png)

It’s vector \* float.

---

<div class="post-metadata">

**Author:** ![chrisell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrisell/32/746203_2.png) [@chrisell](https://forums.unrealengine.com/u/chrisell)\
**Post date:** [April 16, 2021, 4:44pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/9 "2021-04-16T16:44:01Z")

</div>

Ah - no - the other one. I figured it out - it’s getvelocity, dragged from the reference to the floating pawn movement.  
Brilliant - I have a “box tank” moving around now - this has been so helpful. I added a transform and now my boxtank is moving around as I would expect and I’m getting velocity feedback from it.  
Thanks so much !!

 ![velocity5](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/f/3f221c84211ba802cd39fda53a28c9cf2ed0cd18.jpeg)

---

<div class="post-metadata">

**Author:** ![chrisell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrisell/32/746203_2.png) [@chrisell](https://forums.unrealengine.com/u/chrisell)\
**Post date:** [April 16, 2021, 4:47pm UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/10 "2021-04-16T16:47:36Z")

</div>

In case you’re curious, I needed this so I can make the wheels on the tank spin as a result of the velocity. Rather than being a complex physics-driven object, it needs to be a ‘semi-dumb’ actor that spins wheels based on whatever is moving it (in this case player input). So no suspension, no motors etc, but a general-purpose blueprint that can be used to drive the wheels on any other ‘dumb’ vehicles I have in the scene.

---

<div class="post-metadata">

**Author:** ![Zarrar2802](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zarrar2802/32/710746_2.png) [@Zarrar2802](https://forums.unrealengine.com/u/Zarrar2802)\
**Post date:** [September 10, 2023, 3:26am UTC](https://forums.unrealengine.com/t/getvelocity-returning-really-small-values/213650/11 "2023-09-10T03:26:12Z")

</div>

Consider my mind BLOWN! Will definitely be looking through this. I have been looking for a way to simulate mechanical parts like this!
