How to set max actor velocity?

I have simple box which i can pull and push. But how do I limit it’s speed so for ex. it never exceeds 400?

Make a

33711-clamp.png

What is your box? Is it a character using the character movement component?
Just a plain actor moving via “Set location”?

The way to limit it differs quite a lot.

Problem is I don’t know how to access the speed/velocity of actor itself.

It’s simple BP of actor class with mesh.
I’m using force on the box and i want it never to exceed certain velocity.
I tried something like this just right now:


I tried various values on the Min/Max but anything higher/lower than 0 makes the object even faster when force is applied on it ( ͡° ʖ̯ ͡°)

Oh add force is actually a little tough.

The first thing coming to mind would be setting a max velocity, dividing that by the current velocity to have a number between 0 and 1 swap it (because right now 0 means 0 velocity. So we subtract 1 and get the absolute).

Then multiply your force with that number so you apply less force the closer you are to your max velocity.

It’s less then ideal though and it feels like there should be a better solution… But I’m not sitting in front of an engine right now to test.

Sorry for that.

1 Like

I may be late, but I found a way that worked for me. The object I want to control the velocity of is a tomato that is spawned once I hit a block.

In the Tomato Event Graph I went to:

Event Tick-Branch(condition= GetVelocity-VectorLength-IntegerGreaterthanInteger)From the branch go True-setphysicslinearvelocity(target=Charactermovement-Updateprimitive)(newVelocity=GetVelocityself-ClampVectorsize)

my tomato has physics enabled.
I set the max velocity (on the clamp vector size) to 600

Hope this helps someone!

1 Like

Clamp Vector Size is exactly the node that is needed.

You can simply change your speed after you pick up your cube.

350945-003.png