Yuari
Documentation
Docs/Data types/CFrame.lookAt

CFrame.lookAt

Creates a CFrame at a position looking toward a target.

Syntax

CFrame.lookAt(from: any, to: any) -> CFrame

Parameters

ParameterTypeDescription
fromanyThe from value used by the call.
toanyThe to value used by the call.

Returns

TypeDescription
CFrameThe returned CFrame.

Description

CFrame.lookAt 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.

Example

local cf = CFrame.lookAt(Vector3.new(0, 5, 0), Vector3.new(10, 5, 0))
print(cf.LookVector)

Notes

  • Vector and CFrame operations return new value objects.