randomize Velocity

Is there a way to randomize the velocity of an object?
My main problem is to put a var inside the setVelocity function.
I know how Math.random works.

1 Like

:wave:

A good way is

Phaser.Math.RandomXY(sprite.body.velocity, SPEED)
2 Likes