Yuari
Documentation
Docs/Data types/Vector3:Dot

Vector3:Dot

Dot product, cross product and linear interpolation between vectors.

Syntax

Vector3:Dot(other: Vector3) -> number

Parameters

ParameterTypeDescription
otherVector3The other value used by the call.

Returns

TypeDescription
numberThe dot product of the two vectors.

Description

Vector3:Dot is part of the Data types library. Vector and CFrame values are VM userdata with operator overloads; operations return new value objects.

The operation is performed immediately using the arguments supplied at the call site.

The aliases :Cross, :Lerp resolve to the same implementation.

Example

local a = Vector3.new(1, 0, 0)
local b = Vector3.new(0, 1, 0)
print(a:Dot(b), a:Cross(b), a:Lerp(b, 0.5))

Notes

  • Aliases: :Cross, :Lerp.
  • Vector and CFrame operations return new value objects.