Transform.LookAt(Transform target, Vector3 worldUp = Vector3.up)
Rotates the transform so the forward vector points at /target/'s current position.
Parameters:
Name | Type | Description |
---|---|---|
target | Transform | Object to point towards. |
worldUp | Vector3 | Vector specifying the upward direction. |
Usage
---@type Transform
local transform;
---@type Transform
local target;
---@type Vector3
local worldUp;
transform.LookAt(target, worldUp)