Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Suggest a change
var velocity: Vector2;
Vector2 velocity;
velocity as Vector2

Description

Linear velocity of the rigidbody.

The velocity is specified as a vector with components in the X and Y directions (there is no Z direction in 2D physics). The value is not usually set directly but rather by using forces. The velocity can also gradually decay due to the effect of drag if this is enabled.

See Also: AddForce, drag, angularVelocity, Rigidbody.velocity.

Your name (optional):
Your email (optional):
Please write your suggestion here: