Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Modding Tools
  • Simpsons Hit & Run Multiplayer Server
  • Lua API Reference
  • Engine Functions
  • Engine.Vector3 Functions

Engine.Vector3.Normalize

Available since Version 1.0.

Returns a vector with the same direction as the input vector but with a magnitude of 1.

Syntax

Engine.Vector3.Normalize( vector )

Arguments

  • vector (Vector3): The vector to normalize.

Return Values

  • (Vector3): A vector with the same direction as the input vector but with a magnitude of 1.

Examples

local vector = Engine.Vector3(1, 2, 3)
local result = Engine.Vector3.Normalize(vector)