How do I get the speed at which the character is currently rotating?

I need to get the speed at which the character is currently rotating.

With that I mean the player moving the mouse left, right, up or down, how fast it is changing.

There is no Get Rotation Speed node, only a Rotation Rate node which doesn’t do what I want.

Hi,

you can easily calculate this by yourself (I’m not aware of any BP node doing this).

Speed = distance/time. Setup a BP that subtracts current position from the last stored position (=distance), get the delta time from your last calculation and you have your speed. Don’t forget to store the current position as last position in a variable…

I’m not in front of my computer right now, but on tick should do the trick.

For the char it’s almost the same. Just get the delta rotator (A current world rotation, B last rotation), break the rotator (if you need e.g. the yaw) get the delta seconds divide that stuff and you are good to go.

Hope this helps.

Cheers

Terry

1 Like

I am only using Blueprints, would it also be possible with that?

You can definitely do this with blueprints. Before the character turns, set the Beginning Rotation variable to that rotation, then at the end of the rotation, get the character’s world rotation, and subtract the beginning rotation variable from that, and divide that result from the world delta (which is the time in the world, basically.) Basically what Terry said. But a bit more of a compressed breakdown that you can reference in blueprints.

Yes this works in BP, I’m using it to calculate speed in my VR project. It’s only an example, but it should also work for rotation and other things:

I store the last position outside the function bit it should give you the idea how it works.

Just wanted to mention there’s also a node called “GetPhysicsAngularVelocity” which has both radians and degrees options.

GetAngularVelocity

If you’re trying to get the rotation value of an actor, you can use that node and then get the length and that will give you the rotational velocity of the actor. Not sure if it works for characters (I would guess it does) but it definitely works for a static mesh component inside a blueprint that isn’t actually simulating physics so don’t let the name fool you.

2 Likes

how are you setting last position though? (terry)