---
title: "Velocity"
description: "Constructs an Velocity from the given relative x and y velocities."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun Velocity(x: Float, y: Float) = Velocity(packFloats(x, y))
```


Constructs an Velocity from the given relative x and y velocities.

#### Parameters

| | |
| --- | --- |
| x | Horizontal component of the velocity in pixels per second |
| y | Vertical component of the velocity in pixels per second |




