setSearchLightEndPosition
Client-side
Server-side
Shared
Pair: getSearchLightEndPosition
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function sets the end position of a searchlight element.
Syntax
setSearchLightEndPosition ( )Code Examples
client
This example creates a searchlight that originates in the camera position and targets to the front of it.
local searchLight = createSearchLight(0, 0, 0, 0, 0, 0, 0, 10)
if searchLight then local function updateSearchLight() -- Get camera position and look at point local sx, sy, sz, ex, ey, ez = getCameraMatrix() -- Set searchlight's start position to the camera position, and end position to the look at point setSearchLightStartPosition(searchLight, sx, sy, sz) setSearchLightEndPosition(searchLight, ex, ey, ez) end addEventHandler("onClientPreRender", root, updateSearchLight)end