# Measuring speed correctly

Hey all! I’m trying to measure speed, but this current blueprint setup does not work. I checked out my velocity, and it goes all over the place, so now i’m trying to figure out how to measure speed correctly. Any ideas?
Thanks

What about that Set Max Acceleration, doesn’t it have to be hooked up to something?

Probably. But neither it or the particle works. I need a way to measure speed that does not involve velocity, thats all.

Did you set the correct Max Speed for your character? I don’t know about all the templates, but in 1st Person it’s about 400, if I remember it right, and if it is, your speed will be <100 for about 0.1 seconds maybe.

Set Event Tick to display your velocity vector length for you every frame. You’ll see what it is in dynamics.

Erm, Max speed is around 4000. So thats annoying. But the main point of this is that if i walk south, my velocity goes negative and such. So how would i fix that?
Thanks

You can get the characters speed by using the

Get VelocityVector Length

If you are having issues with negative numbers you can run it through an absolute function

ABS

As you can see here, It just goes negative If i go south. Will absolute functions fix this?

The Absolute function should fix it.

Getting the characters speed is shown above. Once you get that float value you can do what ever you want with it.

Running it through the Absolute function guarantees it is always a positive number.

I hoped it would work, but I can’t tell. Nothing prints, No particle disabling or speed changes. Did i mess something up (again)

Hm, that would make more sense. I’ll try upping the value, then.

Velocity might be negative, but vector length will always be positive regardless. So that’s not an issue.

What I meant under Max Speed is this: how long is your speed less than 100 when you start moving? If you have, for instance, a spaceship or something similar that starts really slow and gradually gains speed to be really fast, maybe you should set the initial Max Speed to much lower values, like 20 or something, and gradually increase it after movement starts.

The same example with the 1st Person template: Max Walk Speed is 400, and the character gets to this speed in around 0.2 seconds, and in my case the character speed is under 100 for only 4 ticks; and if you want to be able to see your particles, that time should be longer.

Anyway, your speed measurement itself is correct. If you don’t get the result you want, something else must be wrong.

How is your Slow Startup invoked? Every tick or something like that?

What happens if you manually disable your particle system, with a key press or something?

I forgot to hook it up, but now it’s hooked up to event tick.

but now, erm… You can see the slow startup/particles are a little… Uh, ‘funky’

Okay, 1400 speed, it takes around 4 seconds to get there, yet particles arent disappearing and i cant notice any dramatic slowdown.

You would need to debug your code and find out why it is not printing. However for debugging purposes just create an event like this one and put it after the Event Tick. This will at least show you what variables you are going to receive.

Then you can debug your code and find out why it is never getting to the Print section

It works, but strangley velocity only gets higher then 0 when i jump. Walking around just makes it 0.10040~ ish

I don’t think so… I only measured it. I’m really confused.

Did you make any modifications to the Movement Controller or doing anything else with velocity. I wouldn’t know why that would be happening.

One possible fix is to have two conditions: Its higher then 0, but lower then 100. Maybe?

Still barley works, 1 < and 0.02 > works somewhat but its still pretty messed up. I could send you the project file if you want, so you can have a look at whats wrong