Skip to main content

Client

Client

Client Only

This class is only available on client

Methods

string GetUserID()

integer GetID()

string UIItemUpdate(integer itemId, UIItem uiItem, any value)

nil OpenKeyboardShortcutInput(string keyActionID)

nil ToggleUICreatorWindow()

nil ToggleUIVisibility()

nil SetShowWindows(boolean show)

boolean GetShowWindows()

boolean GetUICapturesMouseOrKeyboard()

boolean GetUICapturesMouse()

boolean GetUICapturesKeyboard()

boolean GetUICapturesTextInput()

boolean GetUIIsInEditMode()

nil OpenUIWindow(string windowName)

nil CloseUIWindow(string windowName)

nil SetUIWindowOpen(string windowName, boolean open)

nil ToggleUIWindow(string windowName)

boolean IsWindowOpen(string windowName)

nil SetWindowPos(string windowName, Vec2 pos)

nil OpenUI()

nil CloseUI()

boolean IsUIOpen()

nil SetUIPose(Quat rot, Vec3 pose)

Quat rot, Vec3 pos GetUIPose()

Script GetScript(string scriptName)

nil OpenScriptFile(string fileName, integer? lineNumber)

nil SetUIScale(number scale)

number GetUIScale()

boolean GetUIScaleAuto()

nil SetUIScaleAuto(boolean auto)

string GetUILayout()

string GetMontageURL()

nil SetMontageURL(string url)

nil LoadMontageByURL()

nil CancelLoadMontageByURL()

string GetMontageURLBase()

table GetMontageURLParameters()

string GetMontageURLParametersRaw()

string GetMontageURLWithParameters(table params)

nil ConnectToMontage(string url)

string GetConnectionStatus()

Unknown, Connecting, FailedToConnect, StatusMessage, ReadyToAcknowledge, Connected, Disconnected

string GetConnectionStatusDetailed()

nil Disconnect(string? reason)

integer GetPing()

Time for a network message to travel from client to server and back

number GetLogValue(string name, number? defaultValue)

nil SetLogValue(string name, number value)

nil SetStrLogValue(string name, string value)

integer GetLogIValue(integer index)

string GetLogIValueName(integer index)

string GetLogIValueOutputName(integer index)

boolean GetLogIsValue(string name)

integer GetLogValuesCount()

table GetLogValueForPlot(string name)

string GetLogStrValue(string name)

string GetLogStrIValue(integer index)

string GetLogStrIValueName(integer index)

string GetLogStrIValueOutputName(integer index)

boolean GetLogStrIsValue(string name)

integer GetLogStrValuesCount()

table GetMainDispatcherStats()

table GetRenderStats()

boolean GetRenderStatsEnabled()

nil SetRenderStatsEnabled(boolean enable)

number GetFPS()

Config GetConfigInputActions()

nil ConnectToServer()

boolean opened OpenFolder(string path)

integer GetScriptsVersion()

integer GetLoadedScriptsVersion()

nil OnLuaLog()

nil ScrollToLastestLuaLog()

boolean IsContainerEnabledAndVisible(UIItem uiItem)

nil Log(string message)

Log a message to file. In most cases you wanna use print() for console output

boolean IsClient()

boolean IsServer()

boolean DevMode()

boolean GetNetworkThrottlingNow()

nil SelectItemInUICreator(UIItem uiItem)

UIItem GetUIItemByUIActionID(integer actionID)

string GetUIActionType(integer actionID)

string GetUIActionScript(integer actionID)

string GetCurrentUIActionID()

nil SetIntersectionTint(Color color)

nil SetIntersectionBox(Vec3 centerWC, Quat rot, Vec3 sizeWC)

nil SetIntersectionSphere(Vec3 posWC, number radius)

nil WriteToScreen(string text, Vec2 pos, Vec2 anchor, Color color, integer? size, Color? outlineColor, number? time)

nil CloseApp()

string GetEULA()

Vec2 GetWindowSize()

Vec2 GetViewportSize()

CommandLine GetCommandLine()

Returns CommandLine

Color GetBGColor()

nil SetBGColor(Color|Vec4 color)

boolean GetVREnabled()

nil SetVREnabled(boolean enable, string vrDevice)

nil ToggleVREnabled()

Vec3 pos, Quat rot GetVREyeTransform(integer side, Space space)

Vec3 pos, Quat rot GetVRHeadsetTransform(Space space)

nil ApplyVRHapticFeedback(Side hand, number duration, number frequency, number amplitude)

boolean GetVREyeTrackingSupported()

number scale SetVRUserScale(number scale)

number GetVRUserScale()

number GetVRUserScaleMin()

number GetVRUserScaleMax()

nil StartVRPassthrough()

nil StopVRPassthrough()

boolean IsVRPassthroughEnabled()

boolean IsVRPassthroughSupported()

boolean SendFile(File file)

nil SendFiles(File[] files)

boolean IsUploadingFiles()

boolean IsDownloadingFiles()

nil Restart()

nil ChooseImage()

nil TriggerCrash()

nil TriggerException()

nil TriggerCriticalError()

nil ToggleChannelRendering()

integer GetRenderChannelsCount()

number GetRenderChannelOpacity(integer which)

nil SetRenderChannelOpacity(integer which, number value)

nil LoadEntityPath()

nil SaveEntityPath()

nil PlayEntityPath()

nil ClearEntityPath()

nil AddEntityPathWaypoint()

Vec4[]? GetEntityPath()

nil TakeScreenshot(string name, boolean attachTimestamp)

table GetVersion()

System GetSystem()

Device GetDevice()

integer GetMemoryUsage()

string GetCredits()

table GetErrors()

nil CopyToClipboard(string text)

string GetClipboardText()

may not work on all platforms

nil OpenBrowserWithURL(string url)

nil ReloadPage(boolean fromCache)

table EnumerateTestRenderObjects()

boolean IsTestRenderObjectEnabled(string objectName)

boolean SetTestRenderObjectEnabled(string objectName, boolean enabled)

boolean ToggleTestRenderObjectEnabled(string objectName)

nil ResetPlayerLODPriorityBubble()

nil AddPlayerLODPriorityBubbleShape(Vec3 capsulePointA, Vec3 capsulePointB, number capsuleRadius, Vec3 velocity, number size)

LODs in this bubble are prioritized, should be placed around the player or camera params: capsuleStart, capsuleEnd, capsuleRadius, velocity, size

nil SetScreenColor(Color color, boolean? permanent)

Tint the view for this frame or permanently

AudioSource PlaySound(string soundPath, Vec3? position, number? volume, boolean? loop)

Play sound with asset name, at position, with volume and loop. Only single channel audio. Returns AudioSource

AudioMusic PlayMusic(string musicFile, number? volume, boolean? loop)

Play sound with asset name, with volume and loop. This play stereo music without any position just like normal audio player. Returns AudioMusic

AudioMusic PrepareMusic(string musicFile, number? volume, boolean? loop)

boolean HasMusic(string musicFile)

nil GetMusicFromServer(string musicFile)

nil PauseAudio()

Pause all playing sounds and music

nil ResumeAudio()

Resume all paused sounds and music

nil StopAudio()

nil EnableRenderingWithFadeEffect(integer type, number duration)

nil DisableRenderingWithFadeEffect(integer type, number duration)

nil ToggleRenderingWithFadeEffect(integer type, number duration)

nil SetOutlineColor(Vec4 color)

nil SetHighlightColor(Vec4 color)

nil DrawPointSpriteSphere(Vec3 pos, number radius, Vec4 color, boolean shade)

nil DrawBillboardSphere(Vec3 pos, number radius, Vec4 color, boolean shade)

nil DrawBillboard(integer texture, Vec3 pos, number size, Vec4 color, number angleDeg)

nil DrawBillboards(table billboards)

boolean ToggleFullScreen()

Properties

integer clientID

string userID

ClientMode mode

boolean isMaker

string platform

string sysInfo

boolean editMode

boolean wannaShowLuaConsole

number masterVolume

number soundVolume

number musicVolume

boolean EditMode

boolean WannaShowLuaConsole

number MasterVolume

Audio volume in range 0 - 1.

number SoundVolume

Audio volume in range 0 - 1.

number MusicVolume

Audio volume in range 0 - 1.