allows you to get the direction of the player's gaze in the seat and at the nearest player at a distance of 16 meters (64 blocks) from this block
it also allows you to get an absolute camera position in the world
each parameter has a flag, using which you will receive information from the nearest player (in sphere 16 meters) and not from the one who is sitting in the seat
if you use the "nearby" flag, you will not be able to receive values from the player who is sitting in the seat
if it was not possible to find a player who meets the specified requirements, the functions will return nil
if you want to get values both if the player is sitting in the seat and if he is not sitting,
then you need to first get the value from the seat and then do a search for nearby ones. in this way: (cameraControl.getDirection() or cameraControl.getDirection(true))
component name - cameraControl
methods:
local cameraControl = getComponent("cameraControl")
function onTick()
print("--------------- seated player")
print("dir: ", cameraControl.getDirection())
print("pos: ", cameraControl.getPosition())
print("--------------- nearby player")
print("dir: ", cameraControl.getDirection(true))
print("pos: ", cameraControl.getPosition(true))
end
_enableCallbacks = true