GE Lua Documentation

Press F to search!

getActiveCamNameByVehId

Definition


-- @/lua/ge/extensions/core/camera.lua:466

local function getActiveCamNameByVehId(vehId)
  if not vehId then return end
  local veh = scenetree.findObjectById(vehId)
  if not veh then return end -- no LUA camera is being used atm
  local camName
  local vid = veh:getId()
  if requestedCam[vid] then
    camName = requestedCam[vid].name
  else
    local vdata = getVehicleData()[vid]
    if vdata then
      camName = vdata.focusedCamName
    else
      log('W', '', 'Unable to find vdata for player '..tostring(player))
    end
  end
  return camName
end

Callers