vector.normalize

vector.normalize(vec: vector) : vector

Computes the normalized version (unit vector) of a given vector.

Example

vector.normalize(vector(1,1,1))
{
  "def": "func",
  "name": "normalize",
  "energy": 0,
  "pure": true,
  "sleep": 0,
  "signatures": [
    {
      "result": [
        {
          "name": "",
          "def": "result",
          "desc": "",
          "variadic": false,
          "type": [
            "vector"
          ],
          "optional": false
        }
      ],
      "args": [
        {
          "def": "arg",
          "name": "vec",
          "desc": "",
          "type": [
            "vector"
          ],
          "variadic": false,
          "optional": false
        }
      ]
    }
  ],
  "desc": "Computes the normalized version (unit vector) of a given vector.",
  "link": "https://luau.org/library#bit32-library#:~:text=function%20bit32.normalize"
}

< Back to vector