Skip to main content

Client

Client

Client Only

This class is only available on client

Methods

boolean IsInitMode()

True while the client is in Init mode (the editor's edit mode), as opposed to live/play.

integer GetID()

nil OpenScriptFile(string fileName, integer? lineNumber)

nil OpenMontageScriptFile(string fileName, integer? lineNumber)

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

table GetMainDispatcherStats()

table GetRenderStats()

boolean GetRenderStatsEnabled()

nil SetRenderStatsEnabled(boolean enable)

nil ConnectToServer()

boolean opened OpenFolder(string path)

boolean DevMode()

boolean GetNetworkThrottlingNow()

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()

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 ToggleChannelRendering()

integer GetRenderChannelsCount()

number GetRenderChannelOpacity(integer which)

nil SetRenderChannelOpacity(integer which, number value)

boolean IsMobile()

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)

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)

Draw a sphere sprite at a world position, optionally shaded. Client-side, call every frame.

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

Draw a camera-facing textured quad in world space. Client-side, call every frame.

nil DrawBillboards(table billboards)

Batch-draw multiple billboards from a table of descriptors.

Properties

ClientPermission permission

string platform

string sysInfo

number masterVolume

Audio volume in range 0 - 1.

number soundVolume

Audio volume in range 0 - 1.

number musicVolume

Audio volume in range 0 - 1.