\AppData\LocalLow\Sine Wave Entertainment Ltd\sinespace\Player.log. |
#### VR settings[β](#vr-settings "Direct link to VR settings")
danger
The settings available under this tab pertain to VR experiences in Breakroom. VR is only available on the Breakroom [desktop application](/opening-the-doors/desktop-viewers.md), and requires access to [advanced computer equipment](/help/system-requirements.md).
**In general, we do not recommend the use of VR equipment with Breakroom at this time.**
#### **Camera Controls settings**[β](#camera-controls-settings "Direct link to camera-controls-settings")

The Camera Controls tab allows you to customize the way your in-world camera behaves. You can also save your custom settings for future use and to share with others.
##### Profile settings vs. global settings[β](#profile-settings-vs-global-settings "Direct link to Profile settings vs. global settings")
Under the Camera Controls tab, you will see two groups of camera settingsβ**Profile Settings** and **Global Settings**.
It is important to note that the camera settings listed under **Profile Settings** (from here referred to collectively as a *camera profile*) can be [reset](/getting-started/settings.md#resetting-the-camera-profile-to-default) with a single click. Camera profiles can also be [saved](/getting-started/settings.md#saving-camera-profiles), exchanged with other users, and [loaded](/getting-started/settings.md#loading-camera-profiles) on demand.
On the other hand, the camera settings listed under **Global Settings** *will persist no matter what changes are made to your camera profile*. Global settings *cannot* be saved or exchanged, and will be applied in addition to any camera profile that you create or load. *They also cannot be reset to their default configuration with a single click*.
##### Saving camera profiles[β](#saving-camera-profiles "Direct link to Saving camera profiles")
To save your current camera profile, follow these steps:
1. **Log in** to your Breakroom World.
2. Open the Settings window by typing **Ctrl + /** on your keyboard.
3. Click on the **Camera Controls tab**.
4. Click the **Save Profile to New Inventory Item button**.
5. A pop-up will appear confirming that a new **Camera Settings Group object** has been added to your Inventory. Click the **Okay button** to proceed.
You can find the saved Camera Settings Group object in your Inventory under **Settings > Camera.** You can save multiple camera profiles and share them with others using [in-world email](/getting-started/communicating-with-other-users.md#receiving-email).

*Pictured: Camera Settings Group objects, located in the Inventory window.*
##### Loading camera profiles[β](#loading-camera-profiles "Direct link to Loading camera profiles")
To load a saved camera profile, follow the steps below.
1. **Log in** to your Breakroom World.
2. Click the **Inventory button** in the bottom toolbar.
3. In the Inventory window that appears, locate the **Camera Settings Group object** you want to use.
4. Click on the **Camera Settings Group object**, and an action menu will appear. Click the **Use button**.

*Pictured: Camera Settings Group objects located in the Inventory window, and the location of the Use button.*
##### Resetting the camera profile to default[β](#resetting-the-camera-profile-to-default "Direct link to Resetting the camera profile to default")
To reset your camera profile, follow these steps.
1. **Log in** to your Breakroom World.
2. Open the Settings window by typing **Ctrl + /** on your keyboard.
3. Click on the **Camera Controls tab**.
4. Click the **Reset Camera Profile to Default button**.
Please note that clicking this button will **not** change your [global camera settings](/getting-started/settings.md#profile-settings-vs.-global-settings).
#### Analytics and Marketing Preferences settings[β](#analytics-and-marketing-preferences-settings "Direct link to Analytics and Marketing Preferences settings")

The Analytics and Marketing Preferences tab allows you to change your privacy and marketing preferences whenever you like.
info
Note: World Owners and World Administrators can[ mandate](/opening-the-doors/privacy-policies-eulas-and-data-collection.md) that Analytics and Marketing data be collected from user logins. In such cases, end users will not be able to opt out of certain types of data collection via the Settings panel.
---
### UI tour
#### Overview[β](#overview "Direct link to Overview")
Breakroom's UI, or *user interface*, contains almost all of the information and tools you'll need to interact in virtual space. When enabled, the UI components will frame the screen.

*An example of the UI in action. You can press the **F9 key** or **Alt + U (β + U)** to toggle the UI on and off.*
The tables below are designed to serve as a quick reference guide for the basic UI components and their functions. You can learn more about using Breakroom's [conference and moderator tools](/getting-started/using-the-conference-system.md) and accessing the [Breakroom for Training system](/getting-started/using-breakroom-for-training.md) in our [Getting Started](/getting-started.md) section.
info
World Owners and World Administrators can [enable and disable parts of the UI](/creating-custom-experiences/ui-customization-options.md) via the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md). You may not have access to every component of the UI pictured above.
#### The bottom toolbar[β](#the-bottom-toolbar "Direct link to The bottom toolbar")

*Pictured: The bottom toolbar, with the Hot Bar drawer extended.*
From left to right, the bottom toolbar components include:
| UI Component | Function |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Show/Hide Chat | Toggles the [text chat](communicating-with-other-users#text-chat) window. |
| People | Opens the [People window](../exploring-breakroom/networking-with-other-users/people). |
| Explore | Opens the [Explore window](../exploring-breakroom/using-the-explore-window). |
| Meetings | Opens the [Meetings window](../exploring-breakroom/using-the-meetings-window). |
| Outfit | Opens the [Outfit window](customizing-your-avatar/editing-avatars-in-the-outfit-window). |
| Shop | Opens the [Sinewave Shop](customizing-your-avatar/using-the-sinewave-shop). |
| Inventory | Opens the [Inventory window](../creating-custom-experiences/using-the-region-editor/the-region-editor-advanced-window). |
| Hot Bar (drawer) | Allows you to [bookmark items](controlling-your-avatar#installing-gestures-in-the-hot-bar) from your Inventory (clothing, gestures, etc.) for one-click deployment. |
#### The top toolbar[β](#the-top-toolbar "Direct link to The top toolbar")

*Pictured: Top toolbar with the menu expanded.*
The top toolbar can be customized to suit your needs. All listed functions are available for one-click deployment under the expanded **hamburger menu**, and most options can be **pinned** for ease of access.

*Pictured: The top toolbar, with all button options pinned.*
When pinned, from left to right, the top toolbar components include:
| UI Component | Function |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Volume | Offers quick access to volume settings. |
| Music Stream | Enables or disables the audio stream. |
| Edit Region | Opens the [Region Editor](../creating-custom-experiences/using-the-region-editor/). Only visible to users with the appropriate [permissions](../opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions). |
| Minimap | Opens the [mini map](ui-tour#the-mini-map). |
| Create Bookmark | Allows you to [bookmark](../exploring-breakroom/bookmarks-and-teleport-invites) a Region. |
| Snapshot | Launches the [Snapshot feature](../exploring-breakroom/snapshots). |
| Mail | Opens the Breakroom [email window](communicating-with-other-users#in-world-email). |
| My Regions | Displays a list of [Regions](../building-new-worlds/creating-and-managing-regions) that you own, along with various management options. |
| Quests | Opens the Quests window, where you can track your progress on any quests you've started. |
| Profile | Opens your [user profile](../exploring-breakroom/networking-with-other-users/). |
| Notifications | Displays and allows you to manage notifications. |
| Menu | Expands the main function menu. |

*Pictured: Unpinned functions available under the main menu.*
Additional functions are available through the main menu. These functions cannot be pinned.
| UI Component | Function |
| ------------ | --------------------------------------------------------------- |
| Settings | Opens the [Settings window](settings). |
| Full Screen | Toggles full screen mode. |
| Help | Opens Breakroom's in-world Support Center. |
| Feedback | Opens the [bug report](reporting-issues#reporting-bugs) window. |
| About | Accesses app version information. |
| Logout | Logs out your current Breakroom session. |
#### The mini map[β](#the-mini-map "Direct link to The mini map")

*Pictured: The mini map.*
When open, the mini map components include:
| UI Component | Function |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| Mini map window | Provides a general overview of the immediate area. |
| Zoom buttons | Adjusts view of the local mini map. |
| Region Information | Accessed by clicking directly on the map. Opens the [Region Information](../building-new-worlds/region-settings) window. |
#### The search bar[β](#the-search-bar "Direct link to The search bar")

*Pictured: The search toolbar.*
The search bar located at the top of the screen has several tools associated with it. These include:
| UI Component | Function |
| --------------- | ---------------------------------------------------------------------- |
| Connection icon | Details your connection status when clicked. |
| Clock | Displays the current UTC time, as well as other time zones if clicked. |
| Search bar | Allows you to search for Regions, users, and Sinewave Shop items. |
#### Conference system components[β](#conference-system-components "Direct link to Conference system components")
You may not see the following tools or options in every Region. For more detailed information about using Breakroom's [conference and moderator tools](/getting-started/using-the-conference-system.md) and accessing the [Breakroom for Training system](/getting-started/using-breakroom-for-training.md), please consult our linked documentation.
##### Conference toolbar[β](#conference-toolbar "Direct link to Conference toolbar")

*Pictured: The conference toolbar.*
The conference toolbar allows you to access voice chat, share your screen, react with emojis, and more. Here's a brief overview of the UI.
| Button | Function |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Microphone | Toggles your[ microphone](ui-tour#voice-chat) within voice-enabled zones. |
| Presentation | Toggles your [webcam](ui-tour#webcam-streaming) or [screen sharing](ui-tour#screenshare) within video-enabled zones. |
| Screen Appearance | Allows you to [control](ui-tour#screen-appearance) where video streamed by other users appears on *your* screen. |
| Device Settings | Allows you to [change your device settings](using-the-conference-system/troubleshooting-audio-and-video-issues#the-change-devices-button) and [troubleshoot](using-the-conference-system/troubleshooting-audio-and-video-issues) common audio and video issues. |
| Emoji | Opens the [emoji menu](ui-tour#raise-hand-and-emoji-buttons), where you can choose from several animated emojis (such as clapping hands). These emojis will float over your avatar's head. |
| Animations | Allows you to emote via single-person [gestures](controlling-your-avatar#gestures) while seated in a conference area. |
| Camera | Adjusts your camera angle while seated in a conference area. |
| Raise Hand | Causes a hand icon to appear over your head until dismissed. Useful for impromptu polls, audience questions, and more. |
| Question | Allows you to submit a question for [Moderator review](../running-your-event/moderator-tools/). |
##### Start Here panel[β](#start-here-panel "Direct link to Start Here panel")

*Pictured: The Start Here panel.*
The Start Here panel comes pre-equipped in most Breakroom [Region templates](/building-new-worlds/region-template-descriptions.md). Depending on the setup of the Region, you may be able to:
* [Teleport](/getting-started/using-the-conference-system.md#navigating-an-event) to key areas of interest
* Take an animated [camera tour ](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-tour-cameras.md)of the Region
* Select an avatar from the [default avatar collection](/creating-custom-experiences/selecting-default-avatars/default-avatar-collections.md)
* Teleport to a specialized triage location for technical support
To view all available options, click the **expansion arrow** located at the bottom.
###### Areas of Interest[β](#areas-of-interest "Direct link to Areas of Interest")

*Pictured: An example Areas of Interest window.*
Clicking the **Signpost / Areas of Interest button** will open the Areas of Interest window. Here you'll find one-click teleport access to key event spaces. You can right-click on this window and drag it anywhere you like.
###### Camera Tour[β](#camera-tour "Direct link to Camera Tour")
Clicking the **Eye /** **Take Tour button** will launch a preprogrammed Region tour. To exit the tour, press the **Esc key**.
###### Avatar Selection[β](#avatar-selection "Direct link to Avatar Selection")

*Pictured: The avatar selection menu.*
Clicking the **Silhouette / Avatar Selection button** will open the avatar selection menu. To change your look, click the **Click to select button** corresponding to the [starter avatar](/getting-started/customizing-your-avatar/choosing-a-starter-avatar.md) you'd like to use. You can right-click on this window and drag it anywhere you like.
###### Triage[β](#triage "Direct link to Triage")
If available, clicking on the **Question mark / Triage button** will teleport your avatar directly to a designated tech support area.
##### Breakroom for Training widget and Moderator tools[β](#breakroom-for-training-widget-and-moderator-tools "Direct link to Breakroom for Training widget and Moderator tools")

*Pictured: The Breakroom for Training widget and the Moderator tools button.*
If the [Breakroom for Training system](/getting-started/using-breakroom-for-training.md) is enabled in a Region, you'll see the Breakroom for Training widget appear on your screen. You can right-click on this widget and drag it anywhere you like.
If you have access to the [Moderator tools](/running-your-event/moderator-tools.md), clicking the **Wrench / Moderator tools button** will open the associated menu.
---
### Using Breakroom for Training
[YouTube video player](https://www.youtube.com/embed/Opl3PJuSK4U)
#### Overview[β](#overview "Direct link to Overview")
The Breakroom for Training system is designed to support online learning through the streamlined management of educational content. [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and other stakeholders can create student- or Instructor-led courses consisting of structured learning modules, waivers, and quizzes, and integrate these touchpoints into live online instruction.
This section will show you how to access the Breakroom for Training tools as a student. For more information about [creating](/breakroom-for-training/creating-and-managing-courses.md) Breakroom for Training courses or administering courses as an [Instructor](/breakroom-for-training/instructor-orientation.md), please see our dedicated [Breakroom for Training section](/breakroom-for-training.md).
#### Logging in[β](#logging-in "Direct link to Logging in")

*Highlighted: The location of the Breakroom for Training widget.*
When you enter a [Region](/getting-started/helpful-terms.md#region) that contains the Breakroom for Training system, you'll see the Breakroom for Training widget appear automatically on your screen. This widget can be dragged around the screen by clicking and holding the **center button**.

*Pictured: A closeup of the Breakroom for Training widget.*
Depending upon the settings in place, you may be guided through a quick tour of the widget tools. For reference, here's an overview of the four buttons, starting in the upper right corner and moving clockwise.
| Button | Purpose |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Quiz Activity | Allows you to review your quiz activity and progress for all active courses. |
| [My Notes](https://www.youtube.com/watch?v=iVieOdbgiA4) | Opens your own personal in-world notepad, where you can take notes for each course. |
| Notifications | Contains notices, alerts, and messages about your course activity. |
| [Course Info](https://youtu.be/obxEln-O_5U?feature=shared) | Allows you to view descriptions of all offered courses. |
warning
It's important to note that Breakroom for Training notifications will not persist between user sessions. When you log off, this information will no longer be accessible to you.
#### Taking quizzes[β](#taking-quizzes "Direct link to Taking quizzes")
[YouTube video player](https://www.youtube.com/embed/PwkThuqN-jw)
Quizzes are pushed forward to students either by the Instructor or by execution of an automated [syllabus](/getting-started/using-breakroom-for-training.md#running-syllabuses). Quizzes may contain a mix of timed and untimed material review, multiple choice questions, free answer spaces, and matching games.

*Pictured: The Reference buttons.*
Question cards may contain **See Reference Links** or **See Reference Images buttons**. Clicking on these buttons will allow you to review material that may be necessary to answer a question, such as charts or writing excerpts.

*Pictured: An example multiple choice question.*
The top portion of each question card contains grading requirements. Here you can see:
* Whether the question is required or optional
* What the answer requirements are (for example, you may need to make two choices, or write a minimum number of words)
* Whether the answer requirements have been met (denoted by a red light or a green light)
* How many points the question is worth
* How many total questions are on the quiz
You can navigate between questions by using the **forward** and **back arrows** in the top right corner, or by clicking the **Previous** and **Next buttons** at the bottom of the quiz screen.

*Pictured: The submission confirmation screen.*
When you're done taking a quiz and click the final **Next button**, you'll be asked to confirm whether you want to submit your quiz for a final grade. Click the **Submit button** to do so, or click the **Review button** to continue working.
#### Completing waivers[β](#completing-waivers "Direct link to Completing waivers")

*Pictured: An example Breakroom for Training waiver.*
Waivers can consist of syllabus information, content warnings, disclaimers, or requests for feedback. Just like quizzes, Instructors and automated [syllabuses](/getting-started/using-breakroom-for-training.md#running-syllabuses) can both push waivers to students. When you receive one, review the included information and click the relevant **button** to register your response.
#### Running syllabuses[β](#running-syllabuses "Direct link to Running syllabuses")
A syllabus is a standardized educational content module that can include on-screen annotations and other messages, timers, quizzes, waivers, viewable media files, and more. Syllabuses can be Instructor- or student-led. If a syllabus is meant to be used as part of a virtual classroom environment, the Instructor will launch and control the associated interface. If a syllabus is set up to launch automatically for individual users, it will begin running when your student avatar enters the Region.

*Pictured: The Syllabus and Breakroom for Training widgets.*
Once a syllabus is launched, a **Syllabus widget** will appear on all Instructor and student screens (or the individual student's screen, if the syllabus is student-led). Here's an overview of the associated UI.
| Button | Purpose |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Drag handle | Allows you to move the widget around the screen by **clicking and dragging** on it. |
| Annotation button | Toggles the Annotation panel. |
| Step indicator | Displays the current syllabus step. Allows you to navigate to a specific step by typing a number into the step field and pressing the **Enter key**. |
| Total steps | Displays the total number of steps in the syllabus. |
| Arrow buttons | Allows whoever is controlling the syllabus to **rewind** and **advance** through the steps. |

*Pictured: An example of how a syllabus may appear on the user's screen.*
If you are participating in a student-led syllabus, you will use the **arrow buttons** on the Syllabus widget to execute the program of instruction. Click the **Annotation button** to toggle the Annotation panel, and interact with the media, [quizzes](/getting-started/using-breakroom-for-training.md#taking-quizzes), and [waivers](/getting-started/using-breakroom-for-training.md#completing-waivers) that appear on your screen as instructed.

*Pictured: The student-led syllabus confirmation box.*
When you progress to the end of a student-led syllabus, you'll be presented with a confirmation box. Once you click the **Yes button**, the syllabus will be marked as complete and closed.
warning
##### "Done This Before"[β](#done-this-before "Direct link to \"Done This Before\"")
When rewinding syllabus steps, it's important to note that the Breakroom for Training system remembers the highest step you have reached. Certain actions *will not be repeated* when you advance through that step again, even if they were triggered during the first use.
This also applies if you choose to manually jump over a step and then backtrack, rather than advancing through the content using the arrow buttons on the Syllabus widget.
For example:
1. You are on step 15 in a syllabus.
2. You advance to step 16. All actions for step 16 happen, as youβve never been this far in the syllabus before.
3. You then use the rewind arrow to backtrack to step 12. Steps 16-12 (working backwards) are considered "already done" and will not trigger the actions listed below. All other actions will be repeated.
4. Starting at step 12, you then use the arrow button to advance the syllabus until you are at step 17. Steps 13-16 are still considered to have been "already done." You've never been on step 17, however, so all actions on step 17 will be executed.
The βskipped if already doneβ actions currently include:
* Tours conducted through use of the Breakroom Tour Cameras
* Countdown timers
* Starting a quiz
* Starting a waiver
* Some custom functions
---
### Using the conference system
#### Overview[β](#overview "Direct link to Overview")
Breakroom's conference system consists of several collaborative and interactive tools, as well as in-world seating options and breakout areas. This quick-start guide is intended for new event attendees, and explains:
* [Where to find the conference system tools](/getting-started/using-the-conference-system.md#conference-system-tools)
* [How to use voice chat](/getting-started/using-the-conference-system.md#voice-chat)
* [How to turn on your webcam](/getting-started/using-the-conference-system.md#webcam-streaming)
* [How to share your screen](/getting-started/using-the-conference-system.md#screen-share)
* [How to change the location of your on-screen video feed](/getting-started/using-the-conference-system.md#screen-appearance)
* [How to use emoji reactions and raise your hand](/getting-started/using-the-conference-system.md#emoji-and-raise-hand-buttons)
* [How to submit a question to the Moderators](/getting-started/using-the-conference-system.md#submitting-questions)
* [How to sit down in an audience seat and use the built-in gestures and camera system](/getting-started/using-the-conference-system.md#seats-and-gestures)
* [How to use presenter seats](/getting-started/using-the-conference-system.md#presenter-seats)
* [How to use breakout areas](/getting-started/using-the-conference-system.md#breakout-areas)
* [How to get around an event Region](/getting-started/using-the-conference-system.md#navigating-an-event)
Users with Moderator permissions can find more information about the [moderator tools](/running-your-event/moderator-tools.md) in our [Running Your Event](/running-your-event.md) section. If you encounter any technical problems, you can also find more information on [troubleshooting common audio and video issues](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md).
info
World Owners and World Administrators can [enable and disable parts of the UI](/creating-custom-experiences/ui-customization-options.md) via the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md). You may not have access to every function described in this section.
#### Conference system tools[β](#conference-system-tools "Direct link to Conference system tools")

*Pictured: The conference system tools, located at the top of the screen.*
For most attendees, the conference system tools fall into two categoriesβ[communication](/getting-started/using-the-conference-system.md#communicating-at-an-event) and [navigation](/getting-started/using-the-conference-system.md#navigating-an-event). Upon entering a conference Region, you'll likely see the conference toolbar appear at the top of your screen. You may also see the Start Here panel appear in the upper left corner.
#### Communicating at an event[β](#communicating-at-an-event "Direct link to Communicating at an event")

*Pictured: The conference toolbar.*
The conference system communication panel allows you to access voice chat, share your screen, react with emojis, and more. Here's a brief overview of the UI.
| Button | Function |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Microphone | Toggles your[ microphone](./#voice-chat) within voice-enabled zones. |
| Presentation | Toggles your [webcam](./#webcam-streaming) or [screen sharing](./#screenshare) within video-enabled zones. |
| Screen Appearance | Allows you to [control](./#screen-appearance) where video streamed by other users appears on *your* screen. |
| Device Settings | Allows you to [change your device settings](troubleshooting-audio-and-video-issues#the-change-devices-button) and [troubleshoot](troubleshooting-audio-and-video-issues) common audio and video issues. |
| Emoji | Opens the [emoji menu](./#emoji-and-raise-hand-buttons), where you can choose from several animated emojis (such as clapping hands). These emojis will float over your avatar's head. |
| Animations | Allows you to emote via single-person [gestures](../controlling-your-avatar#gestures) while seated in a conference area. |
| Camera | Adjusts your camera angle while seated in a conference area. |
| Raise Hand | Causes a hand icon to appear over your head until dismissed. Useful for impromptu polls, audience questions, and more. |
| Question | Allows you to submit a question for [Moderator review](../../running-your-event/moderator-tools/). |
##### Voice chat[β](#voice-chat "Direct link to Voice chat")

*Pictured: The Microphone button, currently toggled *On*.*
If voice chat is available in your current location, you will see the **Microphone button** appear in the conference toolbar. To get started with voice chat, follow these steps.
1. Click the **Microphone button**. A pop-up will appear asking you to grant Breakroom permission to access your microphone. To continue, click the **Enable button**.
2. Once activated, the microphone icon will highlight (as pictured above). This indicates that your microphone is live, and that other users can hear you in voice chat.
3. To mute your microphone, click the **Microphone button** again. You'll see a slash appear through the icon, indicating that other users can no longer hear you.
Depending on the setup of your Breakroom World, you may have access to [additional communication options](/getting-started/communicating-with-other-users.md), such as text chat and in-world email.
##### Webcam streaming[β](#webcam-streaming "Direct link to Webcam streaming")

*Pictured: The Presentation button.*
If you move your avatar into an area where you have permission to share your webcam, you'll see the **Presentation button** appear in the conference toolbar. To start streaming video, follow these steps.
1. Click the **Presentation button**. In the menu that appears, click **Share Camera.**
2. A pop-up may appear asking you to grant Breakroom permission to access your camera. To continue, click the **Accept button**. You may also be asked to activate your [microphone](/getting-started/using-the-conference-system.md#voice-chat).
3. Once activated, the Presentation button will highlight. This indicates that your webcam is live, and that other users can see you.
4. To turn off your webcam, click the **Presentation button** again. In the menu, click **Stop Sharing.**
##### Screen share[β](#screen-share "Direct link to Screen share")
Likewise, if you move your avatar into an area where you have permission to share your computer screen, you'll see the **Share Screen** option appear in the conference toolbar. To get started, follow these steps.
1. Click the **Presentation button**. In the menu that appears, click **Share Screen.**
2. A pop-up may appear asking you to grant Breakroom permission to access your computer. To continue, click the **Accept button**.

*Pictured: The screen share control panel.*
1. The screen share control panel will appear on your screen. Here you can choose a **desktop** or **individual screen** to share. You can also choose whether or not to share your computer audio by toggling the **Share system audio option**.
2. When you are satisfied with your choices, click the **Share button**. If you've elected to leave voice chat off, you may be asked to confirm this decision.
3. Once activated, the Presentation button will highlight. This indicates that your screen is live, and that other users can see what is happening on your computer.
4. To stop sharing your screen, click the **Presentation button** again. In the menu, click **Stop Sharing.**
##### Screen appearance[β](#screen-appearance "Direct link to Screen appearance")

*Pictured: The Screen Appearance button, currently toggled to *See In World* mode.*
By default, when users share their webcam or computer screen the video will be displayed on an in-world screen. The **Screen Appearance button** allows you to "detach" streaming media from the in-world screen for better viewing.

*Pictured: A shared screen displayed through "See on Screen" mode.*
By toggling "See on Screen" mode, you can view streaming media in a separate window. You can expand this window by clicking the **full screen toggle** in the upper right corner.
If multiple presenters are streaming media at the same time, you will see multiple preview windows parked underneath the conference controls while in "See on Screen" mode. You can switch between webcam and screen share feeds by clicking on these windows.
##### Emoji and Raise Hand buttons[β](#emoji-and-raise-hand-buttons "Direct link to Emoji and Raise Hand buttons")

*Pictured: The Emoji button.*
Clicking the **Emoji button** reveals a menu of various emojis. When you then click on an emoji, it will be displayed in an animated burst above your avatar's head.

*Pictured: The Raise Hand button.*
Clicking the **Raise Hand button** animates your avatar, allowing them to raise their hand. A colorful hand icon will also appear over your avatar's head and remain there until you dismiss it by clicking the **Raise Hand button** again.
##### Submitting questions[β](#submitting-questions "Direct link to Submitting questions")

*Pictured: The Question button.*
You can submit a question to the Moderator queue by clicking the **Question button**. Enter your question in the dialogue box that appears, and then click the **Submit button**.
#### Seats and gestures[β](#seats-and-gestures "Direct link to Seats and gestures")

*Pictured: A virtual auditorium. Note the blue tags hovering over the available seats.*
When you enter an auditorium, breakout space, or any area that contains [furniture designed to work with the Breakroom conference system](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md), you will see blue tags hovering over the available seats. To sit down, click on a **blue seat tag**. To stand up again, click the **Stand Up button** that appears at the bottom of your screen.
Once you are seated, two new buttons will appear in the conference toolbar.
##### Animations button[β](#animations-button "Direct link to Animations button")

*Pictured: The Animations button.*
Clicking on the **Animations button** allows you to emote via single-person [gestures](/getting-started/controlling-your-avatar.md#gestures) while seated.
##### Camera button[β](#camera-button "Direct link to Camera button")

*Pictured: The Camera button.*
Clicking on the Camera button lets you adjust your current camera angle. The **Free Look button** releases your camera so that you can control it manually, using Breakroom's standard [camera controls](/getting-started/controlling-your-camera.md).
info
If the camera control buttons become unresponsive while you're seated in a chair, press the **Esc key** to exit fly camera mode.
##### Presenter seats[β](#presenter-seats "Direct link to Presenter seats")
If you have been invited to make a presentation or participate in a roundtable discussion, you may be asked to stand or sit on a *presenter seat*. By using a presenter seat, you'll gain access to voice chat and media sharing functions within a particular voice zone, even if these functions are restricted for most visitors.
To take up a presenter seat, click on the **blue seat tag** indicated to you. Presenter seats are normally located in an obvious place, like on a stage or at the front of a breakout area. To leave the presenter seat, click the **Stand Up button** that appears at the bottom of your screen.
#### Breakout areas[β](#breakout-areas "Direct link to Breakout areas")

*Pictured: An avatar on the threshold of a breakout area. Note the voice zone boundary indicator.*
Most Breakroom Regions contain multiple voice zones. Only users with avatars located *inside* a particular voice zone can use voice chat, webcam streaming, and screen share to communicate with other users in that zone. This design makes it possible for different meetings or events to be held concurrently in the same Region without technical interference or audio competition.
When you approach the edge of a voice zone, a transparent blue *boundary indicator* will appear. This serves as a reminder that you are leaving your current voice zone and entering a new one.
Keep in mind that you may not be able to hear or speak with avatars located on the other side of a boundary indictor, even if you can see them. To use a breakout area, you will need to move your avatar inside.
#### Navigating an event[β](#navigating-an-event "Direct link to Navigating an event")

*Pictured: An example Areas of Interest window.*
In addition to Breakroom's [Region navigation tools](/exploring-breakroom/region-navigation-tools.md), the Areas of Interest window offers one-click teleport access to key event spaces. If seats are available, you will be seated automatically upon arrival.
To open it, click **Signpost / Areas of Interest button** in the [Start Here panel](/getting-started/ui-tour.md#start-here-panel). Here's a brief overview of the UI.
| | |
| -------------- | --------------------------------------------------------------------------------------- |
| Button | Target location |
| Auditorium | Teleports your avatar to the auditorium. |
| Entrance | Teleports your avatar to the Region entrance or to a designated information booth. |
| Networking | Teleports your avatar to the designated lounge or networking area. |
| Floor | Teleports your avatar to the main "floor" of the event (e.g. vendor booths, game area). |
| Breakout areas | Teleports your avatar to the specified breakout room or booth. |
| Triage areas | Teleports your avatar directly to a designated tech support area. |
info
The General Navigation panel's appearance can vary. **Based on the contents of a particular Region, you may not see all of the teleport links pictured above.** You may also see different icons for each area type (e.g., a cocktail glass instead of a coffee cup).
---
### Troubleshooting audio and video issues
#### Overview[β](#overview "Direct link to Overview")
To access Breakroom's audio and video troubleshooting tools, click the **Device Options button** in the [conference toolbar](/getting-started/using-the-conference-system.md) at the top of your screen. This will reveal a drop-down menu containing two buttonsβ**Device Testing** and **Change Devices**.

*Highlighted: The location of the Device Options button.*
In the sections that follow, we'll explore these tools and explain how they can be used to resolve issues and customize your media setup.
#### The Device Testing button[β](#the-device-testing-button "Direct link to The Device Testing button")
Clicking the **Device Testing button** will open a dedicated media testing panel. The UI will vary depending on whether you are accessing Breakroom through the [desktop viewer](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#desktop-viewer-mic-and-cam-test-overview) or [World Stream](/opening-the-doors/world-stream.md).
##### Desktop viewer testing[β](#desktop-viewer-testing "Direct link to Desktop viewer testing")

*Pictured: The desktop viewer Audio Test panel.*
To access the media testing panel through the Breakroom desktop viewer, follow these steps.
1. Click the **Device Options button** in the conference toolbar.
2. Click the **Device Testing button**.
You will then see the panel pictured above. Here's an overview of the key UI components.
| UI component | Function |
| ------------------------------ | ------------------------------------------------------------------------------------ |
| Audio Test Feed drop-down menu | Allows you to select the audio input device (e.g. microphone) to be tested. |
| Audio Device check | Provides information on the selected audio input device. |
| Audio Networking check | Provides information on the audio network connection. |
| Audio Volume check | Provides information on audio volume. |
| Speaker drop-down menu | Allows you to select the audio output device (e.g. speaker or headset) to be tested. |
| "Click to test speaker" button | Plays a tone that allows you to test your speaker. |
| Next button | Launches the Video Test panel. |
| Skip All link | Closes the media testing panel. |

*Pictured: The desktop viewer Video Test panel.*
Once the Audio Test panel is open, you can access the Video Test panel by clicking the **Next button**. Here's an overview of the key UI components.
| UI component | Function |
| ------------------------------ | ----------------------------------------------------------------------- |
| Video Test Feed drop-down menu | Allows you to select the video input device (e.g. camera) to be tested. |
| Live video feed | Allows you to visually confirm that your camera is working. |
| Video Device check | Provides information on the selected video input device. |
| Video Networking check | Provides information on the video network connection. |
##### World Stream testing[β](#world-stream-testing "Direct link to World Stream testing")

*Pictured: The World Stream media test page.*
To access media testing through World Stream, follow these steps. The testing panel will open as a new tab in your browser.
1. Click the **Device Options button** in the conference toolbar.
2. Click the **Device Testing button**.
Functionally, the web-based testing panel contains all of the same UI elements described [above](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#desktop-viewer-mic-and-cam-test-overview).
#### Basic troubleshooting tips[β](#basic-troubleshooting-tips "Direct link to Basic troubleshooting tips")
If you're experiencing an issue related to voice chat or streaming media, please access the relevant media testing panel as described [above](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#the-mic-and-cam-test-button). You can then do a basic troubleshooting rundown.
1. As a first step, make sure that Breakroom can detect the input devices you want to use. All of the devices you've given Breakroom permission to access are listed in the relevant drop-down menus. If a device is working and detectable, its name will be listed under the **Audio** or **Video Device Check section** when you select it, and a green check mark will be displayed.
2. If your devices aren't working despite being selected, or you do not see them listed at all, you may need to troubleshoot your computer or input devices to learn more about the problem.
3. Next, make sure that the Audio and Video Networking checks are successful. If you do not see a green check mark confirming this, it means that your equipment is not currently connected to the Internet. This may indicate a device or networking problem.
4. You can also test your speaker by clicking the **test button** at the bottom of the Audio Test panel. This will play a tone, allowing you to test your speaker volume or identify which audio output device is currently active.
5. If everything looks good, but you're still having issues, please verify that Breakroom is set up to use your preferred equipment by [changing your device input and output settings](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#the-change-devices-button).
##### Audio feedback [](#audio-feedback)[β](#audio-feedback- "Direct link to audio-feedback-")
One common issue users encounter is audio feedback, or hearing themselves echo when they talk. This can happen if you're using a microphone to speak but listening to audio through your computer speakers.
To solve this problem, you will need to use earbuds or a headset. Plug a headset into your computer and then [switch your audio output to the headset](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#the-change-devices-button).
##### Important note concerning voice chat [](#important-note-concerning-voice-chat)[β](#important-note-concerning-voice-chat- "Direct link to important-note-concerning-voice-chat-")
Voice capabilities are currently restricted by login method. This means that if one user is logged in via the [desktop viewer](/opening-the-doors/desktop-viewers.md) and another is logged in via [World Stream](/opening-the-doors/world-stream.md), they will not be able to hear each other, even if they are standing in the same Region.
Users who log in via the same method can communicate freely over voice chat. Therefore, we strongly suggest that World Owners take this into consideration when planning events and require all guests to use the same login method.
We apologize for the inconvenience and hope to provide a solution soon.
#### The Change Devices button[β](#the-change-devices-button "Direct link to The Change Devices button")
Clicking on the **Change Devices button** allows you to select which audio and video devices you want Breakroom to access. The UI will vary depending on whether you are accessing Breakroom through the [desktop viewer](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#desktop-viewer-mic-and-cam-test-overview) or [World Stream](/opening-the-doors/world-stream.md).
##### Changing devices in the Breakroom desktop app[β](#changing-devices-in-the-breakroom-desktop-app "Direct link to Changing devices in the Breakroom desktop app")
Clicking the **Change Devices button** will open the Audio Settings panel. There you can use the **drop-down menus** to select the audio and video devices you want to use. You can also independently adjust the volume for different audio types.

*Pictured: The Breakroom Audio Settings window.*
| | |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------ |
| UI component | Function |
| Reset to Default button | Resets all volume and device settings to the default configuration. |
| Audio Test button | Launches the [Audio Test panel](troubleshooting-audio-and-video-issues#world-stream-mic-and-cam-test-ui-overview). |
| Video Test button | Launches the [Video Test panel](troubleshooting-audio-and-video-issues#world-stream-mic-and-cam-test-ui-overview). |
| Master Volume slider | Adjusts the overall volume of the Breakroom application. |
| Music Volume slider | Adjusts the volume of any music streamed on the Breakroom platform. |
| UI Volume slider | Adjusts the volume of the UI interactivity sounds. |
| SFX Volume slider | Adjusts the volume of any special effects sounds. |
| Voice Volume slider | Adjusts the voice streaming volume. |
| Mic Sensitivity slider | Adjusts your own microphone's sensitivity, impacting your voice volume. |
| Microphone Device menu | Allows you to select which microphone you want to use on Breakroom. |
| Playback Device menu | Allows you to select which speakers you want to use. |
| Webcam Device menu | Allows you to select which camera you want to use. |
##### Changing devices in World Stream[β](#changing-devices-in-world-stream "Direct link to Changing devices in World Stream")
Clicking the **Change Devices button** will launch the Device Management panel. There you can use the **drop-down menus** to select the audio and video devices you want to use. You can also refresh your connection and settings or submit a report about your issue.

*Pictured: The World Stream Device Management panel.*
| | |
| ------------------------ | --------------------------------------------------------------------------- |
| UI component | Function |
| Audio input source menu | Allows you to select which microphone you want to use on Breakroom. |
| Audio output source menu | Allows you to select which speakers you want to use. |
| Video input source menu | Allows you to select which camera you want to use. |
| Refresh button | Refreshes your media connection and pushes any changes forward. |
| Report button | Allows you to log a report indicating that you're having issues with media. |
---
## Help
### HELP
#### [ποΈWhere to find support](/help/where-to-find-support.md)
[If you need assistance with anything related to Breakroom, you can submit a ticket through the Support Tickets tab on Dashboard. Please note that whil](/help/where-to-find-support.md)
---
### Account management
#### Passwords [](#passwords)[β](#passwords- "Direct link to passwords-")
##### Resetting your password [](#resetting-your-password)[β](#resetting-your-password- "Direct link to resetting-your-password-")
To reset your password, visit the [Breakroom homepage](https://www.breakroom.tech/) and click the **Log In button** located at the top. Then click the **Forgot Password?** link. Enter the email address used to register your account, and we'll send you a verification code and login instructions.
##### Password choice [](#password-choice)[β](#password-choice- "Direct link to password-choice-")
We recommend that you create a highly secure, but *memorable* password for use in Breakroom, as you'll need to enter it a lot! You can also make things easy on yourself by using a reputable password manager.
#### Account creation [](#account-creation)[β](#account-creation- "Direct link to account-creation-")
##### Tying your subscription to a pre-existing Breakroom account [](#tying-your-subscription-to-a-pre-existing-breakroom-account)[β](#tying-your-subscription-to-a-pre-existing-breakroom-account- "Direct link to tying-your-subscription-to-a-pre-existing-breakroom-account-")
If you already have an account on Breakroom or Sinespace, you do not need to create a new one in order to subscribe to Breakroom. Just click the **Login link** when asked to register for a new account during the subscription signup process, and you will be prompted to enter your existing login credentials.
---
### System requirements
#### World Stream requirements [](#world-stream-requirements)[β](#world-stream-requirements- "Direct link to world-stream-requirements-")
Minimum:
* Operating System: 64-bit Windows 10 (update 20H2 or later if using Edge) or MacOS 10.92
* Memory (RAM): 4GB or more
* Internet speed: 10Mbps or above. Wired Internet connections offer superior performance.
* Browser:
* Chrome version 91.0.4472.77 or higher
* Firefox version 88.0 (standard) or higher
* Edge version 90.0.818.66 (standard) or higher
* *The ability to share audio while* [*screen sharing*](/getting-started/using-the-conference-system.md#screen-share) *is currently only supported on Chrome or Edge running on a Windows PC.*
* Additional:
* Microphone required for voice chat
* English language keyboard (local language keyboards are not supported at this time)
warning
IMPORTANT: Browsers other than Chrome, Firefox, and Edge are not supported at this time. Linux is not supported.
#### Desktop system requirements [](#desktop-system-requirements)[β](#desktop-system-requirements- "Direct link to desktop-system-requirements-")
##### Low spec: 0-50 avatars in a space, simple scenes [](#low-spec-0-50-avatars-in-a-space-simple-scenes)[β](#low-spec-0-50-avatars-in-a-space-simple-scenes- "Direct link to low-spec-0-50-avatars-in-a-space-simple-scenes-")
Minimum specifications:
* Operating System: 64-bit Windows 10 or MacOS 10.92 (Linux available but unsupported)
* Memory (RAM): 8GB or more
* Storage: 4GB available space (2GB installed size, 2GB cache)
* CPU/GPU:
* Intel: Intel i3 at 2Ghz+, with Intel UHD Graphics 620
* AMD: AMD Athlon 3050U with Radeon Graphics, or better
* DirectX: Version 10
* Network: Broadband internet connection. Wired Internet connections offer superior performance.
* Additional:
* Microphone required for voice chat
* English language keyboard (local language keyboards are not supported at this time)
warning
Please note that these specifications assume that [Breakroom's graphics settings](/getting-started/settings.md#graphics-settings) have been customized to the least demanding option ("Fastest," with the detail slider dragged to the far left). These recommendations also assume that the system is in good condition, with minimal background activity while using the application.
##### Medium spec: 50-100 avatars in a space, medium to complex scenes [](#medium-spec-50-100-avatars-in-a-space-medium-to-complex-scenes)[β](#medium-spec-50-100-avatars-in-a-space-medium-to-complex-scenes- "Direct link to medium-spec-50-100-avatars-in-a-space-medium-to-complex-scenes-")
Medium specifications:
* Operating System: 64-bit Windows 10 or MacOS 10.92 (Linux available but unsupported)
* Memory (RAM): 16GB or more
* Storage: 4GB available space (2GB installed size, 2GB cache)
* CPU/GPU:
* Quad core or better Intel i5, or AMD equivalent
* Discrete non-integrated GPU (may work with higher end integrated GPUs, such as AMD Radeon APUs)
* DirectX: Version 10
* Network: Broadband internet connection. Wired Internet connections offer superior performance.
* Additional:
* Microphone required for voice chat
* English language keyboard (local language keyboards are not supported at this time)
##### High spec: 200+ avatars in a space, complex scenes [](#high-spec-200-avatars-in-a-space-complex-scenes)[β](#high-spec-200-avatars-in-a-space-complex-scenes- "Direct link to high-spec-200-avatars-in-a-space-complex-scenes-")
High specifications:
* Operating System: 64-bit Windows 10 or MacOS 10.92 (Linux available but unsupported)
* Memory (RAM): 32GB or more
* Storage: 4GB available space (2GB installed size, 2GB cache)
* CPU/GPU:
* Quad core or better Intel i5, or AMD equivalent
* Discrete GPU, nVidia GeForce 1050M or better. (GeForce 1650 recommended)
* DirectX: Version 10
* Network: Broadband internet connection. Wired Internet connections offer superior performance.
* Additional:
* Microphone required for voice chat
* English language keyboard (local language keyboards are not supported at this time)
warning
Some features may not work in MacOS clients older than OSX 10.11. We recommend updating to 10.12 or 10.13 if possible.
#### Unity and Sinespace SDK requirements [](#unity-and-sinespace-sdk-requirements)[β](#unity-and-sinespace-sdk-requirements- "Direct link to unity-and-sinespace-sdk-requirements-")
**Minimum:**
* Unity version: 2018.4.x - through 2018.4.36. Later versions may not work as intended
* Sinespace SDK: [Available through Unity Asset Store](/advanced-tutorials/uploading-your-own-region/installing-unity-and-the-breakroom-sdk.md)
---
### Troubleshooting network ports and firewalls
info
This information is intended for System Administrators. If you are not listed as an Administrator on your network, the information covered on this page may not be useful for you. In these cases, we suggest that you consult our [World Stream](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-chrome.md) and [audio/video troubleshooting](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md) guides.
#### Basic World Stream functionality [](#basic-world-streaming-functionality)[β](#basic-world-stream-functionality- "Direct link to basic-world-stream-functionality-")
World Stream access is provided by AWS and Furioos, both of which use a variety of locations for delivery. In order for World Stream to be delivered, you will need to whitelist the following domains:
`*.breakroom.tech`
`*.amazonappstream.com`
`*.appstream2.eu-central-1.aws.amazon.com`
`*.appstream2.eu-west-1.aws.amazon.com`
`*.appstream2.eu-west-2.aws.amazon.com`
`*.appstream2.eu-east-1.aws.amazon.com`
`*.furioos.com`
Additionally, please enable outbound UDP and TCP traffic on ports 443, 8433, and 53.
AWS is our default World Stream provider. You can learn more about AWS allowed domains by visiting [this page](https://docs.aws.amazon.com/appstream2/latest/developerguide/allowed-domains.html).
If you encounter problems with WebRTC, you can perform a WebRTC test at .
Users attempting to connect to Breakroom from behind an aggressive firewall may run into issues, as they will have limited access to the internet. In these cases, a commercial TURN server may provide the necessary solution.
#### Breakroom services [](#breakroom-services)[β](#breakroom-services- "Direct link to breakroom-services-")
For efficient use of Breakroom and its associated websites, we recommend that you whitelist the following addresses:
`*.breakroom.tech`
`*.breakroom.net`
`*.sine.space`
#### Voice [](#voice)[β](#voice- "Direct link to voice-")
For World Stream voice services to work properly, you will need to whitelist the following addresses:
`*.swe-voice2.com`
`*.highfidelity.com`
`*.highfidelity.io`
Additionally, please enable incoming and outgoing UDP and TCP traffic on ports 443, 3478, and 5349, to and from `*.swe-voice2.com, *.sine.space.`
**Note for Google Chrome Enterprise users:** If your Group Policies include an enabled`DefaultMediaStreamSetting_BlockAccess`setting, voice and video services will not work, even for passive listening.
info
For Breakroom clients using the standalone [desktop application](/opening-the-doors/desktop-viewers.md) (*not* on [World Stream](/opening-the-doors/world-stream.md)), you will also need to whitelist \*.vivox.com.
##### An important note concerning voice chat [](#an-important-note-concerning-voice-chat)[β](#an-important-note-concerning-voice-chat- "Direct link to an-important-note-concerning-voice-chat-")
Voice capabilities are currently restricted by login method. This means that if one user is logged in via [World Stream](/opening-the-doors/world-stream.md) and another user is logged in via a Breakroom [desktop viewer](/opening-the-doors/desktop-viewers.md), they will not be able to hear each other over voice chat, even if they are standing in the same Region.
Users who log in via the same method can communicate freely. Therefore, we strongly suggest that you take this into consideration when planning your events, and require *all* guests to use either World Stream or the desktop app.
We apologize for the inconvenience, and hope to provide a solution soon.
#### Webcam and screen share [](#webcam-and-screen-sharing)[β](#webcam-and-screen-share- "Direct link to webcam-and-screen-share-")
Webcam and screen share functionality are delivered by Agora. For World Stream to work properly, you will need to whitelist the following domains:
`.agora.io`
`.edge.agora.io`
`.agoraio.cn`
`.edge.agoraio.cn`
And the following ports on those domains:
`TCP/80; 443; 3433; 5668; 5669; 4700 - 5000; 6080; 6443; 8667; 9667; 30011 - 30013 UDP/3478; 4700 - 5000`
Agora provides a basic testing service, which is [available here](https://webdemo.agora.io/agora_webrtc_troubleshooting/).
---
### Tutorial video playlists
#### Overview[β](#overview "Direct link to Overview")
While you'll find individual tutorial videos posted throughout our Breakroom documentation, the pages in this section host tutorial playlists in their entirety. Links are provided to additional context or supplementary material.
#### Available video playlists[β](#available-video-playlists "Direct link to Available video playlists")
[platform-basics.md](/help/tutorial-video-playlists/platform-basics.md)
[dashboard.md](/help/tutorial-video-playlists/dashboard.md)
[moderator-tools.md](/help/tutorial-video-playlists/moderator-tools.md)
[breakroom-games.md](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-games.md)
[creator-core.md](/help/tutorial-video-playlists/creator-core.md)
[breakroom-for-training-students.md](/help/tutorial-video-playlists/breakroom-for-training-students.md)
[breakroom-for-training-instructors.md](/help/tutorial-video-playlists/breakroom-for-training-instructors.md)
[breakroom-for-training-dashboard-and-backend.md](/help/tutorial-video-playlists/breakroom-for-training-dashboard-and-backend.md)
---
### Breakroom for Training - Dashboard and Backend
#### Overview[β](#overview "Direct link to Overview")
[Breakroom for Training](/breakroom-for-training/installing-breakroom-for-training.md) supports online learning through the streamlined management of educational content. [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and other stakeholders can create instructor-led courses consisting of waivers and quizzes, and enable access to course materials in any number of Breakroom Regions.
The videos in this playlist offer an overview of the in-world system components. For more information about [using the Region Editor](/creating-custom-experiences/using-the-region-editor.md) or [accessing the Dashboard](/building-new-worlds/breakroom-dashboard-tour.md), please see our [Creating Custom Experiences section](/creating-custom-experiences.md). Detailed instructions for building Breakroom for Training courses and managing student data are also [available](/breakroom-for-training/installing-breakroom-for-training.md).
#### Videos[β](#videos "Direct link to Videos")
##### Enabling Breakroom for Training in Your Region[β](#enabling-breakroom-for-training-in-your-region "Direct link to Enabling Breakroom for Training in Your Region")
[YouTube video player](https://www.youtube.com/embed/233YqC0v5dc?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Creating a New Course[β](#creating-a-new-course "Direct link to Creating a New Course")
[YouTube video player](https://www.youtube.com/embed/c7_de8P_w6E?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Adding and Reviewing Waivers[β](#adding-and-reviewing-waivers "Direct link to Adding and Reviewing Waivers")
[YouTube video player](https://www.youtube.com/embed/l8FdH6ApPpQ?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Adding and Grading Quizzes[β](#adding-and-grading-quizzes "Direct link to Adding and Grading Quizzes")
[YouTube video player](https://www.youtube.com/embed/n7o04WNFAPk?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Quiz Question Types[β](#quiz-question-types "Direct link to Quiz Question Types")
[YouTube video player](https://www.youtube.com/embed/vakoplYsGgo?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Archiving Quizzes and Waivers[β](#archiving-quizzes-and-waivers "Direct link to Archiving Quizzes and Waivers")
[YouTube video player](https://www.youtube.com/embed/Py0_4Ji8stI?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Reviewing Student Information[β](#reviewing-student-information "Direct link to Reviewing Student Information")
[YouTube video player](https://www.youtube.com/embed/yBE-h_var6E?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Confined Spaces Training Demo - Sneak Peek[β](#confined-spaces-training-demo---sneak-peek "Direct link to Confined Spaces Training Demo - Sneak Peek")
[YouTube video player](https://www.youtube.com/embed/9-f3ZgKLKr4?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
---
### Breakroom for Training - Instructors
#### Overview[β](#overview "Direct link to Overview")
[Breakroom for Training](/breakroom-for-training/installing-breakroom-for-training.md) supports online learning through the streamlined management of educational content. [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and other stakeholders can create instructor-led courses consisting of waivers and quizzes. Instructors can then integrate these touchpoints into their live online classes, fostering student engagement and gathering student feedback in real time.
The videos in this playlist offer an overview of the in-world system components. For more information about administering courses as an [Instructor](/getting-started/using-breakroom-for-training.md#instructor), please see our [Getting Started section](/getting-started.md). Additionally, Instructors with the [appropriate permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md) can review student data (including [submitted quizzes](/breakroom-for-training/installing-breakroom-for-training.md#grading-quizzes)) by visiting the [Dashboard](/breakroom-for-training/installing-breakroom-for-training.md).
#### Videos[β](#videos "Direct link to Videos")
##### Overview[β](#overview-1 "Direct link to Overview")
[YouTube video player](https://www.youtube.com/embed/Opl3PJuSK4U?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Instructor Mode[β](#instructor-mode "Direct link to Instructor Mode")
[YouTube video player](https://www.youtube.com/embed/_qQ-JtjSi94?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Posting and Reviewing Waivers[β](#posting-and-reviewing-waivers "Direct link to Posting and Reviewing Waivers")
[YouTube video player](https://www.youtube.com/embed/hNn1tH4Xs5Y?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Posting and Reviewing Quizzes[β](#posting-and-reviewing-quizzes "Direct link to Posting and Reviewing Quizzes")
[YouTube video player](https://www.youtube.com/embed/J9rrPP3i2As?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
---
### Breakroom for Training - Students
#### Overview[β](#overview "Direct link to Overview")
[Breakroom for Training](/breakroom-for-training/installing-breakroom-for-training.md) supports online learning through the streamlined management of educational content. Students can use the Breakroom for Training interface to access course information, take notes, and respond to touchpoints administered by a live instructor, all without navigating away from their Breakroom session.
The videos in this playlist offer an overview of the in-world system components. For more information about interacting with the Breakroom for Training system as a [student](/getting-started/using-breakroom-for-training.md#student), please see our [Getting Started section](/getting-started.md).
#### Videos[β](#videos "Direct link to Videos")
##### Overview[β](#overview-1 "Direct link to Overview")
[YouTube video player](https://www.youtube.com/embed/Opl3PJuSK4U?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Course Information[β](#course-information "Direct link to Course Information")
[YouTube video player](https://www.youtube.com/embed/obxEln-O_5U?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### My Notes[β](#my-notes "Direct link to My Notes")
[YouTube video player](https://www.youtube.com/embed/iVieOdbgiA4?list=PLMmBhuOTME3WNFgr4OWMAj7XNy8v92jzY)
##### Completing Quizzes and Waivers[β](#completing-quizzes-and-waivers "Direct link to Completing Quizzes and Waivers")
[YouTube video player](https://www.youtube.com/embed/PwkThuqN-jw?list=PLMmBhuOTME3WHS37-HDWNViydP96GfDOv)
---
### Breakroom Games
#### Overview[β](#overview "Direct link to Overview")
The Breakroom Games component objects can be installed any Region to create fun activities and foster user engagement. By combining the available components, you can set up scavenger hunts, exploration reward systems, trivia contests, and more. The videos in this playlist offer an overview of the components, while [detailed usage instructions](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-games.md) are available in our [Creating Custom Experiences section](/creating-custom-experiences.md).
#### Videos[β](#videos "Direct link to Videos")
##### Leaderboard[β](#leaderboard "Direct link to Leaderboard")
[YouTube video player](https://www.youtube.com/embed/VMiZLR2Imk4?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Taskboard[β](#taskboard "Direct link to Taskboard")
[YouTube video player](https://www.youtube.com/embed/MO9plkqvY8U?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Clickable[β](#clickable "Direct link to Clickable")
[YouTube video player](https://www.youtube.com/embed/OswLJBvXNfI?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Findable[β](#findable "Direct link to Findable")
[YouTube video player](https://www.youtube.com/embed/1ZzGWOqNQzI?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Sittable[β](#sittable "Direct link to Sittable")
[YouTube video player](https://www.youtube.com/embed/oPxZWnWK40Y?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Explorer[β](#explorer "Direct link to Explorer")
[YouTube video player](https://www.youtube.com/embed/898DJQJjGEM?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Sightseeing[β](#sightseeing "Direct link to Sightseeing")
[YouTube video player](https://www.youtube.com/embed/Ims9Fm37tJY?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Photobooth[β](#photobooth "Direct link to Photobooth")
[YouTube video player](https://www.youtube.com/embed/8-v8hKNfg80?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Tour Camera[β](#tour-camera "Direct link to Tour Camera")
[YouTube video player](https://www.youtube.com/embed/t8kicy3VHvw?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Trivia[β](#trivia "Direct link to Trivia")
[YouTube video player](https://www.youtube.com/embed/rQ18jWRMogk?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
##### Rewards[β](#rewards "Direct link to Rewards")
[YouTube video player](https://www.youtube.com/embed/6v-ojHLNxb4?list=PLMmBhuOTME3Ute_h2UwNcWILRmfDBhUX0)
---
### Creator Core
#### Overview[β](#overview "Direct link to Overview")
The Creator Core program is designed to teach users with [advanced permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md) how to access the [Region Editor](/creating-custom-experiences/using-the-region-editor.md), understand and manage the main parts of the [conference system](/running-your-event/understanding-the-conference-system.md), deploy items from the [Breakroom Toolkit](/creating-custom-experiences/exploring-the-breakroom-toolkit.md), and achieve custom effects through editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md). The videos in this playlist offer an overview of the system components, while more detailed information is available in our [Creating Custom Experiences section](/creating-custom-experiences.md). We also offer advanced tutorials for [creating custom voice zones](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md).
#### Videos[β](#videos "Direct link to Videos")
##### Opening the Region Editor[β](#opening-the-region-editor "Direct link to Opening the Region Editor")
[YouTube video player](https://www.youtube.com/embed/oeCQf71xpwM?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Object Windows[β](#object-windows "Direct link to Object Windows")
[YouTube video player](https://www.youtube.com/embed/Z3INDzrr_0w?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Inspector Windows[β](#inspector-windows "Direct link to Inspector Windows")
[YouTube video player](https://www.youtube.com/embed/Y1bT4j35mE8?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### The Inventory Window[β](#the-inventory-window "Direct link to The Inventory Window")
[YouTube video player](https://www.youtube.com/embed/MMeCPktVxa4?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### The Sky Window[β](#the-sky-window "Direct link to The Sky Window")
[YouTube video player](https://www.youtube.com/embed/elhSjnqCMGg?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Editing and Moving Objects[β](#editing-and-moving-objects "Direct link to Editing and Moving Objects")
[YouTube video player](https://www.youtube.com/embed/2JWmr95W3-c?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Region Editor Best Practices[β](#region-editor-best-practices "Direct link to Region Editor Best Practices")
[YouTube video player](https://www.youtube.com/embed/YUBB-Gwc-pM?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Opening Your Starter Bundle[β](#opening-your-starter-bundle "Direct link to Opening Your Starter Bundle")
[YouTube video player](https://www.youtube.com/embed/OiAP2OO4fxY?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Start Here UI[β](#breakroom-start-here-ui "Direct link to Breakroom Start Here UI")
[YouTube video player](https://www.youtube.com/embed/kDlE_2Jw0S8?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Video Player[β](#breakroom-video-player "Direct link to Breakroom Video Player")
[YouTube video player](https://www.youtube.com/embed/yBSL8K4a5gU?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Web Browser[β](#breakroom-web-browser "Direct link to Breakroom Web Browser")
[YouTube video player](https://www.youtube.com/embed/SHCteM7Nn1g?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Tour Cameras[β](#breakroom-tour-cameras "Direct link to Breakroom Tour Cameras")
[YouTube video player](https://www.youtube.com/embed/T2JuekPeSmo?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Note Board[β](#breakroom-note-board "Direct link to Breakroom Note Board")
[YouTube video player](https://www.youtube.com/embed/orE4hd3ptyA?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Image Viewer[β](#breakroom-image-viewer "Direct link to Breakroom Image Viewer")
[YouTube video player](https://www.youtube.com/embed/j2co0i7utqY?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Basic Emojis[β](#breakroom-basic-emojis "Direct link to Breakroom Basic Emojis")
[YouTube video player](https://www.youtube.com/embed/4ysyhaUvGXQ?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Addon Seats[β](#addon-seats "Direct link to Addon Seats")
[YouTube video player](https://www.youtube.com/embed/erI62mQVJTA?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakout Areas Showcase[β](#breakout-areas-showcase "Direct link to Breakout Areas Showcase")
[YouTube video player](https://www.youtube.com/embed/vH1tFz_3L5o?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Adding Breakout Areas to Your Region[β](#adding-breakout-areas-to-your-region "Direct link to Adding Breakout Areas to Your Region")
[YouTube video player](https://www.youtube.com/embed/PCyj05j1mPM?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Breakroom Voice Zone Objects[β](#breakroom-voice-zone-objects "Direct link to Breakroom Voice Zone Objects")
[YouTube video player](https://www.youtube.com/embed/DRun0PPbAJA?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### Voice Zone Components[β](#voice-zone-components "Direct link to Voice Zone Components")
[YouTube video player](https://www.youtube.com/embed/8yM7qDZTYHE?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
##### The RoomFurniture Component[β](#the-roomfurniture-component "Direct link to The RoomFurniture Component")
[YouTube video player](https://www.youtube.com/embed/hPiwHQUT7RE?list=PLMmBhuOTME3Vs_f1GRW5pJ9myXSkjxUip)
---
### Dashboard
#### Overview[β](#overview "Direct link to Overview")
The Breakroom Dashboard allows [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) to manage almost every aspect of their account, including billing details, support tickets, Region creation and management, user account generation, access settings, and setting up Breakroom for Training courses. The videos in this playlist offer an overview of the available features. Our [Dashboard tour page](/building-new-worlds/breakroom-dashboard-tour.md) is another useful resource, as it contains an FAQ specifically geared toward Dashboard questions.
info
Only World Owners and World Administrators can access the Dashboard. While World Owners can edit every feature described in this section, World Administrators have [limited permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md).
#### Videos[β](#videos "Direct link to Videos")
##### World Customization - Basic Information and Features[β](#world-customization---basic-information-and-features "Direct link to World Customization - Basic Information and Features")
[YouTube video player](https://www.youtube.com/embed/mXJ8cHAgNIQ?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### World Customization - Regions and Avatars[β](#world-customization---regions-and-avatars "Direct link to World Customization - Regions and Avatars")
[YouTube video player](https://www.youtube.com/embed/lopbVUHpt7o?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### World Customization - Color Theme and World Access[β](#world-customization---color-theme-and-world-access "Direct link to World Customization - Color Theme and World Access")
[YouTube video player](https://www.youtube.com/embed/rI09diYGED4?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### World Credits[β](#world-credits "Direct link to World Credits")
[YouTube video player](https://www.youtube.com/embed/kI_2kZsSSIU?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Manage Users[β](#manage-users "Direct link to Manage Users")
[YouTube video player](https://www.youtube.com/embed/yb99cXQ1Oyo?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### World Stream[β](#world-stream "Direct link to World Stream")
[YouTube video player](https://www.youtube.com/embed/UoGOcGFAu1Y?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Integration[β](#integration "Direct link to Integration")
[YouTube video player](https://www.youtube.com/embed/QUQ4cFpSw10?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Billing[β](#billing "Direct link to Billing")
[YouTube video player](https://www.youtube.com/embed/_CTh4CzE4zk?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Your Apps[β](#your-apps "Direct link to Your Apps")
[YouTube video player](https://www.youtube.com/embed/Kh2AyamoQKM?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Analytics[β](#analytics "Direct link to Analytics")
[YouTube video player](https://www.youtube.com/embed/2BPuWnU70Ro?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Support Tickets[β](#support-tickets "Direct link to Support Tickets")
[YouTube video player](https://www.youtube.com/embed/IMP6jeMlbYw?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Knowledge Base[β](#knowledge-base "Direct link to Knowledge Base")
[YouTube video player](https://www.youtube.com/embed/F3zAgpuwlb4?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Activity Log[β](#activity-log "Direct link to Activity Log")
[YouTube video player](https://www.youtube.com/embed/PTpHnTtNpDI?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
##### Settings[β](#settings "Direct link to Settings")
[YouTube video player](https://www.youtube.com/embed/gnNfsd5k5sk?list=PLMmBhuOTME3Vc4C2DhumOi01z5DW6hk6O)
---
### Moderator tools
#### Overview[β](#overview "Direct link to Overview")
Breakroom's built-in moderator tools allow event runners to direct virtual traffic, communicate with attendees, organize live presentations, and more. The videos in this playlist offer an overview of the available moderator tools, while [detailed usage instructions](/running-your-event/moderator-tools.md) are available in our [Running Your Event section](/running-your-event.md).
#### Videos[β](#videos "Direct link to Videos")
##### Crowd Control[β](#crowd-control "Direct link to Crowd Control")
[YouTube video player](https://www.youtube.com/embed/ODDfMepQNXU?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
##### Broadcast Messages[β](#broadcast-messages "Direct link to Broadcast Messages")
[YouTube video player](https://www.youtube.com/embed/RE-o6MegYT4?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
##### Slido Integration[β](#slido-integration "Direct link to Slido Integration")
[YouTube video player](https://www.youtube.com/embed/JEQg0oH570w?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
##### Audio Streams[β](#audio-streams "Direct link to Audio Streams")
[YouTube video player](https://www.youtube.com/embed/jdNHaK3qAKg?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
##### Audience Questions[β](#audience-questions "Direct link to Audience Questions")
[YouTube video player](https://www.youtube.com/embed/SwNBkdxkzKE?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
##### UI Toggle[β](#ui-toggle "Direct link to UI Toggle")
[YouTube video player](https://www.youtube.com/embed/RBKehGq2f84?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
##### Presentation Controls[β](#presentation-controls "Direct link to Presentation Controls")
[YouTube video player](https://www.youtube.com/embed/x4Ar5mgCuZ4?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
---
### Platform basics
#### Overview[β](#overview "Direct link to Overview")
The videos in this playlist are intended to help with new user orientation. Users will learn how to customize and control their avatars, adjust common settings, communicate in-world, and report platform issues. These topics are covered in more depth in our [Getting Started section](/getting-started.md).
#### Videos[β](#videos "Direct link to Videos")
##### Entering Your World[β](#entering-your-world "Direct link to Entering Your World")
[YouTube video player](https://www.youtube.com/embed/Jjq2pxuQA-g?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Controlling Your Avatar[β](#controlling-your-avatar "Direct link to Controlling Your Avatar")
[YouTube video player](https://www.youtube.com/embed/PtouvK9WcnA?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Camera Movement[β](#camera-movement "Direct link to Camera Movement")
[YouTube video player](https://www.youtube.com/embed/GzDo8HbOgqY?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Social Interaction[β](#social-interaction "Direct link to Social Interaction")
[YouTube video player](https://www.youtube.com/embed/mv-Ma37QNNs?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Avatar Customization[β](#avatar-customization "Direct link to Avatar Customization")
[YouTube video player](https://www.youtube.com/embed/ejjRVO6s_5s?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Exploration[β](#exploration "Direct link to Exploration")
[YouTube video player](https://www.youtube.com/embed/XmNQYZwWJJ0?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Collaboration[β](#collaboration "Direct link to Collaboration")
[YouTube video player](https://www.youtube.com/embed/vckdoReN9-o?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Settings[β](#settings "Direct link to Settings")
[YouTube video player](https://www.youtube.com/embed/0CP1NtX9aHE?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
##### Reporting Issues[β](#reporting-issues "Direct link to Reporting Issues")
[YouTube video player](https://www.youtube.com/embed/neIspZnbSnY?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy)
---
### Where to find support
#### Contacting the Customer Success Team [](#contacting-the-customer-success-team)[β](#contacting-the-customer-success-team- "Direct link to contacting-the-customer-success-team-")
If you need assistance with anything related to Breakroom, you can submit a ticket through the [Support Tickets tab](/building-new-worlds/breakroom-dashboard-tour.md#support-tickets) on [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md). Please note that while you can elect to mark your ticket as low, medium, or high priority, response times may vary based on your Support Plan. You can learn more by reviewing the [Breakroom Terms of Service](https://www.breakroom.net/terms-of-service).
#### Bug reports and development requests[β](#bug-reports-and-development-requests "Direct link to Bug reports and development requests")
If you run into problems in-world, you can submit a [bug report ](/getting-started/reporting-issues.md)or product feedback by pressing the **F5 key** on your keyboard (or by clicking the **FN button** at the top of the screen and then pressing the **F5 key**, if you're logged in via World Stream).
In addition to space for a written report, the report window includes the following options:
* **Include a log file**: Checking this option will submit a log file of your recent activity to our development team along with your written report. Log files can assist our team in diagnosing and troubleshooting your problem.
* **This is a bug report**: Checking this option will flag your submission as a bug report. Unchecking this option will flag your submission as feedback or a development request.
* **Include a screenshot**: Checking this option will submit a screenshot of your current screen to our development team along with your written report.
---
## Opening The Doors
### OPENING THE DOORS
#### [ποΈSeats and concurrency](/opening-the-doors/seats-and-concurrency.md)
[With Breakroom, it's easy to make room for everyone to join the conversation. Learn more about seats, user licenses, concurrency, and how to expand user capacity as needed.](/opening-the-doors/seats-and-concurrency.md)
---
### Analytics
[YouTube video player](https://www.youtube.com/embed/2BPuWnU70Ro)
#### Overview[β](#overview "Direct link to Overview")
Breakroom provides basic analytics reports in the form of an auto-generated CSV file, which [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can download from the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md) or email to themselves.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Interpreting basic analytics report data[β](#interpreting-basic-analytics-report-data "Direct link to Interpreting basic analytics report data")

*Pictured: An example of a basic analytics report.*
User visits are represented by rows, while key information is listed in each column.
| Column | Contents |
| ---------- | --------------------------------------------------------------------------------------------------------- |
| Grid | This number corresponds to the grid, or World, the user accessed. |
| UserID | The ID of the user who visited your World. |
| Username | The user's name. |
| Region | The Region ID the user visited. |
| RegionName | The name of the Region the user visited. |
| LoginTime | When the user logged in. |
| LogoutTime | When the user logged out. |
| SpendTime | How long the user spent in a particular Region. |
| LoginFrom | Whether the user logged in from a [desktop viewer](desktop-viewers) or via [World Stream](world-stream/). |
| Session | The user's session ID. |
| Email | The email associated with the user's account. |
warning
Users may decline to share certain data by personalizing the [Analytics and Marketing Preferences](/getting-started/settings.md#analytics-and-marketing-preferences-settings) available under the Settings panel. If users decline to share their data, you may see this data (such as usernames, user IDs, and email addresses) replaced by asterisks in your analytics report.
#### Accessing basic analytics reports[β](#accessing-basic-analytics-reports "Direct link to Accessing basic analytics reports")

*Pictured: The Dashboard > Analytics tab.*
To generate and download a basic analytics report, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Analytics tab**.
3. Use the calendars to select a start date and an end date for your report.
4. Click the **Generate Analysis Report button**.

5. A pop-up will appear confirming that your report has been created. Click the **Email Report button** to send a copy of the report file to your email address. Click the D**ownload Report button** to immediately download the report file to your computer.
info
The filename will automatically indicate the World ID, ISO date, and generation time of the report. Please note that the generation time is listed in 24-hour format GMT.
---
### Creating and managing user accounts
[YouTube video player](https://www.youtube.com/embed/yb99cXQ1Oyo)
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
There are a number of ways that you can invite users to join you in Breakroom. You can:
* Create multiple user accounts simultaneously by [uploading a CSV file](/opening-the-doors/creating-and-managing-user-accounts.md#importing-and-exporting-users-lists)
* Create user accounts one at a time by manually [editing your user records](/opening-the-doors/creating-and-managing-user-accounts.md#adding-individual-users)
* Allow users to [register their own account](/opening-the-doors/creating-and-managing-user-accounts.md#enabling-self-registration) the first time they visit your World
* Enable your existing [single sign-on (SSO)](/opening-the-doors/creating-and-managing-user-accounts/single-sign-on.md) service
Finally, if you're hosting a free or for-cost ticketed event in Breakroom, you'll want to take advantage of [Eventbrite integration](/opening-the-doors/creating-and-managing-user-accounts/eventbrite-integration.md) to make logistics a snap.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Importing and exporting user lists[β](#importing-and-exporting-user-lists "Direct link to Importing and exporting user lists")
CSV files, or *comma-separated values* files, are spreadsheets containing relevant user account information. Uploading a populated CSV file will create an account for each user listed on the spreadsheet, complete with password. You can also include important institutional information about each user, which may be displayed in their [user profile](/exploring-breakroom/networking-with-other-users.md) or in-world hovertext (the identifying text that appears above each avatar's head).
##### Downloading a blank CSV file[β](#downloading-a-blank-csv-file "Direct link to Downloading a blank CSV file")
You can download a fresh, unpopulated CSV file by clicking on the file link below.
[Download Breakroom CSV 2024.csv]()
You can also download an unpopulated CSV file directly from the Dashboard. Click on the **Manage Users tab**, and then click the **Import Users button**. The Import Users window will appear. Click on the link that says "Download CSV Model," and save the file to your computer.

*Highlighted: The location of the "Download CSV Model" link.*
##### Opening and editing a CSV file[β](#opening-and-editing-a-csv-file "Direct link to Opening and editing a CSV file")

*Pictured: A blank Breakroom CSV file open in Microsoft Excel.*
You can open and edit CSV files using any commonly available spreadsheet software, such as Microsoft Excel or Google Sheets. When you open a blank Breakroom CSV file, you will see a series of fields where you can enter required or optional information.
Required information includes:
* Display Name: This is the name that serves to identify the user while they are in-world. It will appear in the identification tag that hovers over the user's avatar, as well as in the user's [profile](/exploring-breakroom/networking-with-other-users.md). *Display names can be changed at any time by the World Owner or a World Administrator.*
* Username: This is a permanent username that serves to identify the account. It can also be used in place of the user's email address during the login process on the [desktop viewer](/opening-the-doors/desktop-viewers.md).
* Email address: This should be an email address to which the user has full access, in case they need to change their password.
* Password: This should be a complex, unique password of six or more characters.
* Type: This field should contain the user's [World-level permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md) type. (If you do not enter a value in this field, the user type will default to [*Guest*](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#guest)*.*)
info
Usernames can contain a maximum of 32 characters. Only alpha-numeric characters, spaces, underscores, periods, and dashes can be used. *If you do not enter a custom username, one will be auto-generated from the user's display name.*
Optional fields include:
* Title: This is optional information that will also appear in the hover tag displayed above the user's avatar, as well as in their profile. For instance, you might use this field to identify a "Senior Delegate," or make it something fun like "Metaverse Wanderer."
* Job Title: This refers to the user's actual job title. If you supply this information, it will be displayed in the user's hover tag and in their profile.
* Company: The company the user works for. If you supply this information, it will also be displayed as described above.

*Pictured: Using Google Sheets to export (download) an example file in CSV format.*
Once you've entered the minimum required user data, you will need to save or export the document in CSV (.csv) format. You can change the document name if you like.
##### Uploading a CSV file[β](#uploading-a-csv-file "Direct link to Uploading a CSV file")

*Highlighted: The location of the Import Users button.*
To upload a CSV file, navigate to the **Manage Users tab** of your Dashboard and click the **Import Users button**.

*Highlighted: The location of the "Upload file" field.*
In the Import Users window that appears, click the "**Upload file" field**. This will launch a standard file import window on your computer. Locate the CSV file you want to upload, click on it, and then click the **Open button**.

*Pictured: The CSV file verification message.*
If your CSV file contains any errors, the document will be rejected and those errors will be highlighted so you can make the necessary corrections. If no errors are detected, you will see the "CSV file verification succeeded" message displayed in the image above. Click the **Import CSV button** to continue.

*Pictured: The Manage Users panel.*
Once you've successfully imported your users, you will see them listed under the Manage Users panel. You can click the **pencil icon** located next to a user's name to manually edit their information, or click the **trash can icon** to remove them from your user list altogether.
If you need to locate a particular user or set of users, you can also make use of the following functions:
* The **search field** in the upper left corner allows you to search for a name, email address, or specific user ID.
* The **"Search by status" drop-down menu** allows you to display only those users who have a particular status (e.g. active, pending, etc.).
* The **"Select user type" drop-down menu** allows you to display only users of a certain type (e.g. World Administrators, World Developers, etc.).
##### Exporting existing users as a CSV file[β](#exporting-existing-users-as-a-csv-file "Direct link to Exporting existing users as a CSV file")

*Highlighted: The location of the Export Users button.*
To download a CSV file containing all of your current user information, click the **Export Users button**.
#### Adding individual users[β](#adding-individual-users "Direct link to Adding individual users")

*Highlighted: The location of the Add Users button.*
Adding a user to your roster manually is as simple as filling out a text form. To begin, navigate to the **Manage Users tab** on your Dashboard and click the **Add Users button.**

*Pictured: The Add Users window.*
The Add Users window will appear. To create a new user account, you will need to provide at least a **Display Name, Username**, **email address**, and **password**. You'll also need to choose a [user type](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md).
If you want to add more than one user during a single session, click the **plus icon** in the bottom left corner to generate an additional set of user information fields. When you are finished keying in your user data, click the **Add User button**.
#### Assigning user types[β](#assigning-user-types "Direct link to Assigning user types")

User types correspond to [World-level user permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md), and can be changed by clicking the **pencil icon** located to the right of a user's name and then selecting the type to be assigned. A detailed explanation of the different user types and [step-by-step instructions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#assigning-and-revoking-advanced-world-level-permissions) for assigning or revoking World-level user permissions are also available.
#### Managing user status[β](#managing-user-status "Direct link to Managing user status")

*Highlighted: The "Search by status" drop-down menu and the user status column.*
In addition to a user type, each user is also assigned a *status*. You can use the **"Search by status" drop-down menu** to display only the users assigned that particular status, and to narrow down your search for a specific user.
The status types are:
* Active: The user's account is active and accessible to the user. They can log in to your World. If you have assigned them advanced [World-level user permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md), they have access to the virtual tools they need (e.g. Curator).
* Inactive: The user's account information is preserved, but they cannot currently log in to your World. See the section that follows for more information about [activating and deactivating users](/opening-the-doors/creating-and-managing-user-accounts.md#activating-and-deactivating-users).
* Pending: The user's account is pending activation, and they have not yet logged in. This may be due to a lack of available [seats](/opening-the-doors/seats-and-concurrency.md).
warning
By default, inactive users will not be displayed in your user list. To see your Inactive users, please use the **"Search by status" drop-down menu** to select the *All* or *Inactive* option*.*
#### Activating and deactivating users[β](#activating-and-deactivating-users "Direct link to Activating and deactivating users")

*Pictured: The Manage Users tab on Dashboard, with the user management tools highlighted.*
Users can be deactivated individually or in bulk. When a user is deactivated, they will still appear under the Manage Users tab, with their user status changed to *Inactive*. They will no longer be able to log in, and will no longer take up one of your account's [seats](/opening-the-doors/seats-and-concurrency.md).

*Pictured: A deactivated member listing. Notice how the trash can icon has been changed to an "undo" icon.*
To deactivate an individual user, click on the **trash can icon** located to the right of their name. The trash icon will then change to an **undo icon**. To reactivate the user, click the **undo icon**.
To deactivate or activate multiple users at once, check off each relevant name in your user list and then click the **trash can icon** or **undo icon** located in the top right above the user list.

*Pictured: The undo icon and the trash can icon.*
If a user seems to disappear from your user list when you deactivate them, make sure that the **"Search by status" drop-down menu** is set to show *All* users or *Inactive* users. If it is set to any other option, you may not see your full user list.

*Pictured: The "Search by status" drop-down menu, showing the different filtering options.*
warning
When you reactivate an inactive user account, the account will default to *Pending* status and *Guest* type. You will need to update their [World-level user type](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md) manually.
#### Enabling self-registration[β](#enabling-self-registration "Direct link to Enabling self-registration")

*Highlighted: The location of the Self Registration toggle.*
When self-registration is enabled, users who access your World through [World Stream](/opening-the-doors/world-stream.md) or a dedicated [desktop app](/opening-the-doors/desktop-viewers.md) can sign up for their own account. Each user registration will take up one of your available [seats](/opening-the-doors/seats-and-concurrency.md), and users will be given the opportunity to pick a [starter avatar](/getting-started/customizing-your-avatar/choosing-a-starter-avatar.md) from your default avatar collection.
You can enable or disable self-registration from your Dashboard by following the steps below.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > World Access tab.**
3. Click the **Self Registration toggle** to enable or disable self-registration.
info
If self-registration is disabled, you will need to import or manually create user accounts using the steps outlined [above](/opening-the-doors/creating-and-managing-user-accounts.md#overview), or [enable SSO](/opening-the-doors/creating-and-managing-user-accounts/single-sign-on.md).
---
### Eventbrite integration
[YouTube video player](https://www.youtube.com/embed/QUQ4cFpSw10)
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
By integrating your Breakroom account with Eventbrite, you can sell or distribute tickets to a virtual event and trust the backend logistics to us. Breakroom will automatically create a user account for anyone who purchases a ticket, using their ticket number as the password. If an account already exists under a user's email address, Breakroom will reactivate that account and reset the password to the ticketholder's current ticket number.

*Pictured: An example event listing in Eventbrite.*
In order to integrate Breakroom and Eventbrite, you will need an active Eventbrite account. As a first step, log in to your Eventbrite account and **create the event** you plan to host in Breakroom. You can then follow the instructions outlined below to integrate your event with Breakroom's systems.
#### Getting your Eventbrite API key [](#getting-your-eventbrite-api-key)[β](#getting-your-eventbrite-api-key- "Direct link to getting-your-eventbrite-api-key-")
Once you've created your event on Eventbrite, you'll need to locate the API key associated with that event and enter it into the Breakroom Dashboard. To get started, navigate to your **Eventbrite account settings page**.

*Highlighted: The location of the Account settings page on Eventbrite.*
On the left side of the account settings page, you'll see a drop-down menu called **Developer Links**. Expand it, and click on the tab that says **API Keys**. Then click on the button that says **Create API Key**.

*Highlighted: The API Keys tab, as well as the location of the "Create API Key" button.*
Fill out the required information, and click the **Create Key button**.

*Pictured: The Eventbrite API key request page.*

*Pictured: An example of how your API key may appear once generated, with the private token key highlighted.*
Your API key should be generated automatically. Click the **> arrow** above the application name (in this case, **Breakroom**) to expand the key information menu. **Highlight and copy the private token key**.

*Pictured: The Dashboard > Integration tab.*
From here, you will need to enter the private token key into the Breakroom Dashboard. Follow the instructions below to do so.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Integration tab**.
3. Under the **Select an integration to configure** panel, click on the **Eventbrite button**.
4. Paste your Eventbrite private token API key into the **field**.
5. Click the **Create payload URL button**. Under the **Payload URL** panel, a special URL will be generated for you.
6. **Highlight and copy the payload URL**.
7. Return to the Eventbrite page to complete setup.
#### Setting up Webhook with payload URL[β](#setting-up-webhook-with-payload-url "Direct link to Setting up Webhook with payload URL")

*Pictured: The Webhooks tab on Eventbrite, with the Add Webhook button highlighted.*
After you receive your payload URL, click on the **Webhooks tab** under Developer Links on your Eventbrite account settings page. Then click the button that says **Add Webhook**.

*Pictured: The Eventbrite "Add Webhook" page.*
From here, you will need to enter the payload URL into Eventbrite. Follow the instructions below to do so.
1. Paste the **payload URL** into the top field.
2. Using the drop-down **Event menu**, select either a specific event or *All Events*, if you want to link more than one event to a single ticket purchase.
3. Check the box beside **order.placed**.
4. Click the button that says **Add Webhook**.
Once all of these steps are completed, you are ready to go.
#### **Onboarding Eventbrite ticketholders** [](#onboarding-eventbrite-ticketholders)[β](#onboarding-eventbrite-ticketholders- "Direct link to onboarding-eventbrite-ticketholders-")
When users purchase a virtual event ticket through Eventbrite, they will **not** receive a confirmation email from Breakroom. Therefore, we strongly encourage event organizers to use their Eventbrite listing, email, or other relevant tools to provide ticketholders with the information they will need to log in.
Key points to communicate to ticketholders include:
* Breakroom will automatically create a user account for anyone who purchases a virtual event ticket through Eventbrite. Their login will be the e-mail they provided to Eventbrite, and their password will be their ticket number.
* If a Breakroom account already exists under a user's email address, Breakroom will reactivate that account and reset the password to the ticketholder's **current** ticket number.
* Users will need to download the custom Breakroom desktop app or sign in through World Stream. Links to [download the app](/opening-the-doors/desktop-viewers.md) or access your dedicated [World Stream](/opening-the-doors/world-stream.md) can be found on the **Your Apps** tab on the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md#your-apps).
---
### Region-level user permissions
#### Overview[β](#overview "Direct link to Overview")
There are two categories of special user permissions that you can assign to teammates, event coordinators, or end usersβ[**World-level permissions**](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md), and **Region-level permissions**. It is important to note that these two categories are distinct, with their own separate spheres of influence and control. On this page, we will discuss Region-level user types.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Region-level user types[β](#region-level-user-types "Direct link to Region-level user types")
Users with advanced Region-level permissions have *powers that apply to individual Regions within your World*. These users can assist with setting up individual Regions and moderating events, but cannot access the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md) in order to manage user accounts, approve content submitted to [Curator](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md), or change your World-level settings unless you have *also* assigned them [advanced World-level permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md).
It may be helpful to think of advanced Region-level permissions as those you can assign and manage through the [Region Information window](/building-new-worlds/region-settings.md).
In brief, the current Region-level user types are:
* Owner
* Administrator
* Moderator
* Developer
* Member
* Guest
* VIP
Region Owners have absolute control over the Region and its settings.
Region Owners can:
* Access the Region [moderator tools](/running-your-event/moderator-tools.md).
* Access the [Region Editor](/creating-custom-experiences/using-the-region-editor.md).
* Access the [Region Information window](/building-new-worlds/region-settings.md) and edit the Region settings.
* Manage the [Region member list](/building-new-worlds/region-settings.md#controlling-region-access) and deal with [disruptive users](/building-new-worlds/region-settings.md#muting-and-banning-region-visitors).
* Assign other users advanced [Region-level permissions](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md#assigning-and-revoking-advanced-region-level-permissions).
Region Administrators can perform many of the same tasks as Region Owners. They cannot appoint additional Administrators.
Region Administrators can:
* Access the Region [moderator tools](/running-your-event/moderator-tools.md).
* Access the [Region Editor](/creating-custom-experiences/using-the-region-editor.md).
* Access the [Region Information window](/building-new-worlds/region-settings.md) and edit most Region settings.
* Manage the [Region member list](/building-new-worlds/region-settings.md#controlling-region-access) and deal with [disruptive users](/building-new-worlds/region-settings.md#muting-and-banning-region-visitors).
* Assign other users advanced [Region-level permissions](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md#assigning-and-revoking-advanced-region-level-permissions) below the Administrator level.
Region Moderators have access to the moderator controls and certain Region settings. They cannot appoint additional Moderators.
Moderators can:
* Access the Region [moderator tools](/running-your-event/moderator-tools.md).
* Access the [Region member list](/building-new-worlds/region-settings.md#controlling-region-access) and in order to deal with [disruptive users](/building-new-worlds/region-settings.md#muting-and-banning-region-visitors).
* Assign other users advanced [Region-level permissions](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md#assigning-and-revoking-advanced-region-level-permissions) below the Moderator level.
Region Developers have access to the Region Editor, and can decorate and modify the Region to which they are assigned. They do not occupy a [World Developer sea](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#developer)t, and cannot upload content to Curator.
Developers can:
* Access the [Region Editor](/creating-custom-experiences/using-the-region-editor.md).
Region Members have no special privileges, but will be permitted to enter the Region should [Contact Only](/building-new-worlds/region-settings.md#contact-only-1) or[ Approved Only](/building-new-worlds/region-settings.md#approved-only) access be enabled.
If an unassigned user enters your Region, they will appear in the member list as a *Guest*. Guests have no special privileges, and will not be permitted to enter the Region if access is [controlled](/building-new-worlds/region-settings.md#controlling-region-access).
Designating a user as a VIP gives them no special powers. Currently, this role is only useful for Lua script functionality and [presenter seats](/running-your-event/customizing-the-conference-system-components/setting-up-presenter-and-audience-zones.md).
#### Assigning and revoking advanced Region-level permissions[β](#assigning-and-revoking-advanced-region-level-permissions "Direct link to Assigning and revoking advanced Region-level permissions")

*Pictured: The Region Information window > Members tab.*
To assign advanced Region-level permissions to individual users, follow the steps below.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Click the **Region Information button** located above the [mini map](/getting-started/ui-tour.md#the-mini-map).
3. Click on the **Members tab** in the Region Information window.
4. Click the **Add Members button** to open the "Add new members" dialog box. Locate the user you want to whitelist by using the **search field**, and then click the **Add button** beside their name.
5. Once the user is added to the Region members list, check the **box** next to their name and then click on the **Set Role drop-down menu**. From this menu, select the permissions level you'd like to assign the user.
To revoke advanced Region-level permissions, repeat the steps above and select a new role (e.g. *Member* or *Guest*). You can learn more about [managing Region members](/building-new-worlds/region-settings.md#approving-region-members) in our [Building New Worlds section](/building-new-worlds.md).
##### Removing Region members[β](#removing-region-members "Direct link to Removing Region members")
To remove a user from the Region members list entirely, follow these steps.
1. Click the **Region Information button** located above the [mini map](/getting-started/ui-tour.md#the-mini-map).
2. Click on the **Members tab** in the Region Information window, and use the **search field** to search for the user's name.
3. Once you locate the user you want to remove, click the **Edit button** located to the right of their name. In the action menu that appears, click **Delete**.
#### Assigning Region control to a group [](#assigning-region-control-to-a-group)[β](#assigning-region-control-to-a-group- "Direct link to assigning-region-control-to-a-group-")
By enabling the ["Groups Only" Region access option](/building-new-worlds/region-settings.md#groups-only), you can assign control over a Region to one or more [groups](/exploring-breakroom/networking-with-other-users/groups.md). When a Region is set to "Groups Only," then the group member lists will override the Region's existing members list, *including any Region members with advanced permissions.*
This means that only *Group* Administrators, *Group* Moderators, *Group* Developers, etc. will be able to exercise their powers over the Region as a whole. Additionally, only group members will be permitted to visit the Region. Any users in the Region member list will be ignored.
To disable group control over the Region, [choose](/building-new-worlds/region-settings.md#controlling-region-access) a different Region access option. Doing so will restore access and advanced permissions to any users in the Region members list.
---
### Single sign-on
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
By enabling single sign-on (SSO) on Breakroom, you can provide your users with a secure and simplified login process. Integrating your current identity management system with Breakroom takes only a few minutes, but has the potential to save you a lot of hassle.
In order to enable SSO, you will need to contract for services with an Identity Provider (IdP). Some IdPs to consider include Okta and Microsoft Azure.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Enabling SSO [](#enabling-sso)[β](#enabling-sso- "Direct link to enabling-sso-")
To enable SSO within Breakroom, you will need to copy the parameters Breakroom provides and enter them into your IdP's SAML Signing Certificate generator. Your IdP will then provide you with a SAML Signing Certificate, which will include a metadata file containing additional information. You will need to enter this information into the Breakroom Dashboard in order to complete setup.

*Highlighted: The Dashboard > World Customization > World Access tab, and the location of the SSO Login toggle.*
You can enable SSO within Breakroom by following the steps below.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > World Access tab**.
3. Click the **SSO Login toggle** to enable SSO.

*Pictured: The SSO Settings > Identity Provider Setup panel.*
5. Once the SSO Login toggle is enabled, several additional sections will appear on your screen. Scroll down to the **Identity Provider Setup panel**.
6. Here you will see two parameters provided in the form of linksβthe **SSO URL** and the **SP Entity ID**. You can click the **copy icon** located next to either of these parameters in order to copy it.
7. Enter these parameters into the SAML Signing Certificate generator on your IdP's website. Once your IdP finishes creating your SAML Signing Certificate, they will provide you with a metadata file.

*Pictured: The IdP panel.*
8. Return to the Breakroom Dashboard and scroll to the **Details Provided by your Identity Provider section**. Enter the **Entity ID, X.509 Certificate, and Sign-in URL parameters** from the IdP metadata file into the relevant fields.
9. Click the **Save button**.
##### Important notes [](#important-notes)[β](#important-notes- "Direct link to important-notes-")
Upon enabling SSO, user accounts are *not* automatically generated in Breakroom, and you will not see any users appear under the [Manage Users tab](/opening-the-doors/creating-and-managing-user-accounts.md). Instead, Breakroom accounts will be generated as users log in. Each user account will occupy one of the available [seats](/opening-the-doors/seats-and-concurrency.md) under your Breakroom account.
##### Disabling SSO [](#disabling-sso)[β](#disabling-sso- "Direct link to disabling-sso-")
To disable SSO integration, follow steps 1-2 as [detailed above](/opening-the-doors/creating-and-managing-user-accounts/single-sign-on.md#enabling-sso) and click the **SSO Login toggle** again.
#### Customizing the Breakroom login screen[β](#customizing-the-breakroom-login-screen "Direct link to Customizing the Breakroom login screen")

*Pictured: Here the SSO buton has been customized, and the self registration and standard login features have been disabled. The end result is visible in the Login Screen Preview panel.*
The World Access tab features a login panel preview, so you can see how your changes will appear on the [World Stream](/opening-the-doors/world-stream.md) landing page and on the [desktop app](/opening-the-doors/desktop-viewers.md). You can also personalize your SSO button with a logo and custom text.
To customize the login panel, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > World Access tab**.
3. First, choose which login methods will be available for your users.
1. Enable or disable [self-registration](/opening-the-doors/creating-and-managing-user-accounts.md#enabling-self-registration).
2. Enable or disable [SSO](/opening-the-doors/creating-and-managing-user-accounts/single-sign-on.md#enabling-sso).
3. Enable or disable the standard login (Breakroom account email and password).
4. If you have chosen to enable SSO, you can then customize the SSO login button appearance.
1. In the **Button Text field**, enter the text you would like to appear on the button.
2. If you want to upload a custom logo for the SSO login button, click the **Browse link** in the Button Image field. This will launch a standard file import window on your computer. Locate the image file you want to use, click on it, and then click the **Open button**.
3. If you want to clear the current logo, click the **Delete button.**
5. When you are satisfied with your changes, click the **Save button**.
---
### World-level user permissions
#### Overview[β](#overview "Direct link to Overview")
There are two categories of user permissions that you can assign to teammates, event coordinators, or end usersβ**World-level permissions**, and [**Region-level permissions**](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md). It is important to note that these two categories are distinct, with their own separate spheres of influence and control. On this page, we will discuss World-level user types.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### World-level user types[β](#world-level-user-types "Direct link to World-level user types")
Users with advanced World-level permissions have *broad powers that apply to the entirety of your Breakroom World*, but *not necessarily powers that apply to individual Regions*. Users with advanced World-level permissions generally have powers that allow them to manage your Breakroom account, oversee events, and upload new content.

*Pictured: The user type selection menu, accessible through Dashboard > Manage Users > Edit user.*
It may be helpful to think of advanced World-level permissions as those you can assign and manage through the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
In brief, the current World-level user types are:
* Owner
* Administrator
* Moderator
* Developer
* Member
* Guest
World Owners are responsible for managing [billing details](/building-new-worlds/breakroom-dashboard-tour.md#billing) for their account, and can review their past invoices via the Dashboard.
In addition, World Owners can:
* Access the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
* Purchase additional [seats](/opening-the-doors/seats-and-concurrency.md), [Daily Passes](/opening-the-doors/seats-and-concurrency.md#daily-passes), and [World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md).
* Request [pre-allocation](/opening-the-doors/world-stream/pre-allocation-campaigns.md) for events.
* Create and edit [Regions](/building-new-worlds/creating-and-managing-regions.md), [filter Shop contents](/creating-custom-experiences/filtering-the-sinewave-shop.md), make use of World [customization options](/creating-custom-experiences.md).
* Edit all [meetings](/exploring-breakroom/using-the-meetings-window.md) hosted on the World.
* Access platform [analytics](/opening-the-doors/analytics.md) and make decisions about [user privacy and data collection](/opening-the-doors/privacy-policies-eulas-and-data-collection.md).
* Access all [moderator tools](/running-your-event/moderator-tools.md).
* Log in to their World while it is [offline](/opening-the-doors/toggling-world-availability.md).
* [Upload content](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md) to Curator and approve their own content.
* [Review](/advanced-tutorials/uploading-your-own-region/testing-items-on-the-preview-server.md) and [approve ](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md)content uploaded by other users.
* Modify or overwrite any content uploaded by other users.
* Appoint World Administrators and change user types through the [Dashboard](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#assigning-and-revoking-advanced-world-level-permissions) or [CSV](/opening-the-doors/creating-and-managing-user-accounts.md#importing-and-exporting-user-lists).
World Administrators can perform many of the same tasks as World Owners, except they will not have access to billing information. They also cannot appoint additional World Administrators.
World Administrators can:
* Access the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
* Purchase additional [Daily Passes](/opening-the-doors/seats-and-concurrency.md#daily-passes) and [World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md).
* Request [pre-allocation](/opening-the-doors/world-stream/pre-allocation-campaigns.md) for events.
* Create and edit [Regions](/building-new-worlds/creating-and-managing-regions.md), [filter Shop contents](/creating-custom-experiences/filtering-the-sinewave-shop.md), make use of World [customization options](/creating-custom-experiences.md).
* Edit all [meetings](/exploring-breakroom/using-the-meetings-window.md) hosted on the World.
* Access platform [analytics](/opening-the-doors/analytics.md) and make decisions about [user privacy and data collection](/opening-the-doors/privacy-policies-eulas-and-data-collection.md).
* Access all [moderator tools](/running-your-event/moderator-tools.md).
* Log in while the World is [offline](/opening-the-doors/toggling-world-availability.md).
* [Upload content](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md) to Curator and approve their own content.
* [Review](/advanced-tutorials/uploading-your-own-region/testing-items-on-the-preview-server.md) and [approve ](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md)content uploaded by other users.
* Modify or overwrite any content uploaded by other users.
* Change sub-Admin user types through the [Dashboard](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#assigning-and-revoking-advanced-world-level-permissions).
World Moderators have universal access to the moderator controls, so they can moderate events held in any Region. They do not have access to the Dashboard, and they cannot administrate or edit any Regions unless they own that Region or have been given advanced [Region-specific permissions](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md).
World Moderators can:
* Edit all [meetings](/exploring-breakroom/using-the-meetings-window.md) hosted on the World.
* Access all [moderator tools](/running-your-event/moderator-tools.md).
* Log in while the World is [offline](/opening-the-doors/toggling-world-availability.md).
* Access [Region settings](/building-new-worlds/region-settings.md) in order to mute and block abusive users.
World Developers can create and upload content to your World, as well as approve content uploaded by other users. They can also edit existing Regions using the in-world Region Editor.
World Developers can:
* [Upload content](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md) to Curator and approve their own content.
* [Review](/advanced-tutorials/uploading-your-own-region/testing-items-on-the-preview-server.md) and [approve ](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md)content uploaded by other users.
* Modify or overwrite any content uploaded by other users.
* List uploaded items for sale on the [Breakroom Shop](/getting-started/customizing-your-avatar/using-the-sinewave-shop.md).
* Access all [moderator tools](/running-your-event/moderator-tools.md).
* Log in while the World is [offline](/opening-the-doors/toggling-world-availability.md).
* Access the [Region Editor](/creating-custom-experiences/using-the-region-editor.md).
info
After you have granted a user World Developer permissions, they will need to [log in to Curator](/advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server.md) and accept the Terms and Conditions before they can access the [preview grid](/advanced-tutorials/uploading-your-own-region/testing-items-on-the-preview-server.md).
World Members occupy a seat and don't have any special privileges. You may choose to assign World Members [advanced Region-level permissions](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md).
World Guest accounts are created when:
* You create user accounts by [uploading a CSV](/opening-the-doors/creating-and-managing-user-accounts.md#importing-and-exporting-user-lists), and do not specify another user type in the **Type field**.
* While creating user accounts by uploading a CSV, you attempt to import more users than you have available [seats](/opening-the-doors/seats-and-concurrency.md). In this case, the extra user accounts will be created as Guests.
* User accounts are automatically generated by [Eventbrite](/opening-the-doors/creating-and-managing-user-accounts/eventbrite-integration.md), or any automated registration process you may choose to use.
When World Guest accounts log in for the first time, their account [status](/opening-the-doors/creating-and-managing-user-accounts.md#managing-user-status) will be updated to *Active*. Member-type accounts and higher are always given login priority over Guest accounts.
#### Assigning and revoking advanced World-level permissions[β](#assigning-and-revoking-advanced-world-level-permissions "Direct link to Assigning and revoking advanced World-level permissions")

*Pictured: The Dashboard > Manage Users tab.*
You can assign advanced World-level permissions to individual users by following the steps below.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Manage Users tab**.
3. Locate the name of the user whose permissions you want to edit. (Tip: You can use the **search field** to search by name or email address.) Click the **pencil icon** to the right of their name.
4. In the Edit User window that appears, click on the **permissions type** you would like to assign.
5. Click the **Update button** to save your changes.
To revoke advanced World-level permissions, repeat the steps above and select a new user type (e.g. *Member*). You can learn more about [creating and managing user accounts](/opening-the-doors/creating-and-managing-user-accounts.md) in our [Opening the Doors section](/opening-the-doors.md).
---
### Desktop viewers
[YouTube video player](https://www.youtube.com/embed/Jjq2pxuQA-g)
#### Overview[β](#overview "Direct link to Overview")
Breakroom provides desktop application installers for both Windows and macOS. When users log in through your dedicated Breakroom viewer, there are no additional access fees above the cost of their [seat](/opening-the-doors/seats-and-concurrency.md)βwhich means that you won't need to dip into your pool of [World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md). However, users will need to install the Breakroom app on a computer equipped with [hardware](/help/system-requirements.md) that can effectively render 3D Worlds.
#### An important note concerning voice chat [](#an-important-note-concerning-voice-chat)[β](#an-important-note-concerning-voice-chat- "Direct link to an-important-note-concerning-voice-chat-")
Voice capabilities are currently restricted by login method. This means that if one user is logged in via [World Stream](/opening-the-doors/world-stream.md) and another user is logged in via the desktop app, they will not be able to hear each other over voice chat, even if they are standing in the same Region.
Users who log in via the same method can communicate freely. Therefore, we strongly suggest that you take this into consideration when planning your events, and require *all* guests to use either World Stream or the desktop app.
We apologize for the inconvenience, and hope to provide a solution soon.
#### Downloading the application installers[β](#downloading-the-application-installers "Direct link to Downloading the application installers")

*Highlighted: The location of the Download App button.*
You can find your custom application installers on the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md). Once you're logged in, click the **Download App button** in the tab header, or navigate to the **Your Apps tab**.

*Pictured: The Dashboard > Your Apps tab.*
After you finalize your subscription purchase, it will take 48 hours for Breakroom to generate app installers for your world. Once your installers are ready, they will be added to the **Dashboard > Your Apps tab**, where you can download one or both installers by clicking the **Windows** or **macOS buttons**. We also provide download links that you can distribute to your users.
#### Installing the desktop application [](#installing-the-desktop-application)[β](#installing-the-desktop-application- "Direct link to installing-the-desktop-application-")
Breakroom's desktop viewer represents a major graphics and performance upgrade compared to [World Stream](/opening-the-doors/world-stream.md). For best performance, you will need a PC or laptop that is capable of running 3D worlds. For maximum performance, we recommend using a machine with a dedicated graphics card. Please review our [system requirements](/help/system-requirements.md) for more information.
To install the desktop viewer, follow the steps below.
1. Download the correct installer (Windows or macOS) for your computer.
2. Locate the installer on your hard drive, and double-click on it.
3. Follow the installer prompts.
#### Re-creating your installers [](#re-creating-your-desktop-application-installers)[β](#re-creating-your-installers- "Direct link to re-creating-your-installers-")
If you decide to update any custom [branding images](/creating-custom-experiences/branding-tools.md) associated with your World, or if you [rename](/building-new-worlds/breakroom-dashboard-tour.md#world-customization) your World as a whole, you will need to create and distribute fresh desktop app installers in order to push those changes to your users.
To update your desktop application installers, follow the steps below.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Your Apps tab**.
3. Click the **Re-create Installers** button.
Please note that it may take Breakroom up to 48 hours to re-create your app installers. If you need your app installers sooner, please reach out to our [Customer Success Team](/help/where-to-find-support.md).
---
### Privacy Policies, EULAs, and data collection
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
While few resources are more valuable, there are legal and ethical issues to consider when it comes to collecting and retaining user data. Breakroom offers a suite of tools designed to help [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) implement their existing Data Collection Policies, as well as comply with legislation such as the General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA). Users can also [customize](/getting-started/settings.md#analytics-and-marketing-preferences-settings) their data profile within these specified parameters.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Adding a custom Privacy Policy[β](#adding-a-custom-privacy-policy "Direct link to Adding a custom Privacy Policy")
If you plan to collect and retain [user analytics](/opening-the-doors/analytics.md), a custom Privacy Policy is strongly encouraged. Users will be presented with your organization's Privacy Policy the first time they access Breakroom, and will be required to accept the terms before they can log in.

*Pictured: An example Privacy Policy.*
To add a custom Privacy Policy to your World, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > Basic Information tab**.
3. Scroll to the **World Privacy Notice panel**, and paste your Privacy Policy text into the **field**.
4. Toggle the World Privacy Notice **on**.
5. When you are satisfied, click the **Save Changes button**.
To disable your custom Privacy Policy, follow steps 1-3 above and toggle the World Privacy Notice **off**.
#### Adding a custom EULA[β](#adding-a-custom-eula "Direct link to Adding a custom EULA")
If you are running an event that requires an additional End-User License Agreement (EULA), Breakroom makes it easy to seamlessly integrate review and acceptance of this document into the user login experience. Your EULA will appear after the Breakroom TOS, and users will need to accept both in order to access your World.

*Pictured: An example EULA.*
To add a custom EULA to your World, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > Basic Information tab**.
3. Scroll to the **Your World's EULA panel**, and paste your EULA text into the **field**.
4. Toggle the Your World's EULA **on**.
5. When you are satisfied, click the **Save Changes button**.
To disable your custom EULA, follow steps 1-3 above and toggle the Your World's EULA **off**.
#### Managing end user data collection[β](#managing-end-user-data-collection "Direct link to Managing end user data collection")

*Pictured: The World Customization > Basic Information > Data collection panel.*
World Owners and World Administrators can make the collection of [user analytics](/opening-the-doors/analytics.md), diagnostic data, and marketing data *optional*. By making the collection of such data optional, you give users the ability to[ opt in or opt out](/getting-started/settings.md#analytics-and-marketing-preferences-settings) of data collection at any time.
In certain circumstances, you may have a legitimate interest in tracking platform usage. In these cases, you may elect to make data collection *mandatory*. Please be aware that you have full liability for any misuse of this functionality, and it is strongly recommended that you consult a legal or privacy professional prior to doing so.
info
For the proper functioning of the platform and security purposes, Breakroom must collect essential data. Essential data are generated primarily in response to actions performed by users, which amount to requests for services. This includes such actions as setting privacy preferences, logging in, and managing content.
##### Turning data collection on or off[β](#turning-data-collection-on-or-off "Direct link to Turning data collection on or off")

To toggle data collection on or off as a whole, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > Basic Information tab**.
3. Scroll to the **Analytics User Consent Management panel**.
4. Choose either to **Collect Data** or **Do Not Collect Data**.
5. When you are satisfied, click the **Save Changes button**.
##### Customizing the user consent pop-up[β](#customizing-the-user-consent-pop-up "Direct link to Customizing the user consent pop-up")

If you opt to turn on data collection, you can review the different types of data collected and make the collection of each type *Optional* or *Mandatory* using the In-World User Consent Popup panel. Any data collection type marked as *Optional* can be accepted or rejected by users at any time through the in-world [Settings panel](/getting-started/settings.md#analytics-and-marketing-preferences-settings).
To customize your data collection policies and user consent pop-up, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Customization > Basic Information tab**.
3. Scroll to the **In-World User Consent Popup panel**.
4. Review the different data types, and toggle each one to be **Optional** or **Mandatory**.
5. Using the **consent toggle** in the upper right corner, confirm whether you want to display the consent pop-up to your end users.
6. When you are satisfied, click the **Save Changes button**.
---
### Seats and concurrency
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
**Seats** correspond to user licenses, and represent the number of active user accounts that your Breakroom World can accommodate. In addition to the *persistent seats* included with your Breakroom subscription, you can add *temporary seats* to your account through the use of [Daily Passes](/opening-the-doors/seats-and-concurrency.md#daily-passes).
**Concurrency** refers to the number of users who can log in simultaneously. Please note that your Breakroom account's concurrency cap may be different than your total seat count.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
info
If you need additional persistent seats, please contact our [Customer Success Team](/help/where-to-find-support.md).
#### Daily Passes[β](#daily-passes "Direct link to Daily Passes")
Daily Passes are temporary seats that permit individual users to access your World for 24 hours, giving you the ability to scale your seat count to meet increased user demand. You can use Daily Passes to invite delegates to a conference, sell tickets to a professional or artistic event, or allow contractors to access your virtual workspace. The possibilities are endless.
##### Usage details[β](#usage-details "Direct link to Usage details")
* Daily Passes are activated when your Breakroom account has no open [persistent seats](/opening-the-doors/seats-and-concurrency.md#overview) and a [Guest](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#guest) logs in.
* Once activated, a Daily Pass will lock to a single user account and will be deducted from your pool of available Daily Passes.
* Daily Passes expire 24 hours after activation.
* Unused Daily Passes will roll over month-to-month until your Breakroom subscription is cancelled or expires.
##### Purchasing Daily Passes[β](#purchasing-daily-passes "Direct link to Purchasing Daily Passes")

*Highlighted: The location of the Daily Pass button.*
[World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can purchase Daily Passes at any time through the Dashboard by following these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Manage Users tab**.
3. Click on the **Daily Pass button** located in the bottom right corner. This will open the Add Daily Passes window.

*Pictured: The Add Daily Passes window.*
4. Move the **slider** to indicate the number of Daily Passes you need, or enter the number manually in the field located above the slider.
5. Confirm your purchase by clicking the **Add Daily Pass button**.
---
### Toggling World availability
##### Overview [](#overview)[β](#overview- "Direct link to overview-")
Breakroom's World Status toggle allows you to restrict access to your World with the flip of a switch. When your World status is set to *Off*, only users with [advanced permissions](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md) will be able to log in. You can also schedule a day and time when your world will automatically become accessible to a larger audience, and post a customized message to keep everyone in the loop.
warning
When your world status is set to *Off*, only World Owners, World Administrators, World Moderators, and World Developers will be able to log in. Members and Guests will no longer have access.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Taking your World offline[β](#taking-your-world-offline "Direct link to Taking your World offline")

*Pictured: An example of the Take World Offline window.*
To take your World offline, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Settings tab**.
3. Toggle the **World switch** to *Off*, and the **Take World Offline window** will open. In this window you can:
1. Select a **World Online date and time** (required): This is the time that your Breakroom World will once again become accessible. This time will be displayed to users who try to log in while your World is offline.
2. Enter a **World Offline Notice** (optional): In addition to your chosen go-live time, this notice will be displayed to users who try to access your World while it is offline.
3. Enter a **User Ejection Notice** (optional): This notice will be displayed to online users before they are ejected from your World.
4. Select any **User Types to Be Ejected** (optional): All online users of the selected types will be forcibly logged out once your World goes offline.
4. Once you're satisfied, click the **Take World Offline button**. You will be asked to confirm your choice.

*Pictured: Example settings for an offline World.*
Once your World is offline, the Settings tab will change to display your chosen go-live time and offline message. You can change these at any time by clicking the relevant **Edit links**. A link is also provided so that you can change your World's [login screen](/creating-custom-experiences/branding-tools.md#uploading-a-custom-login-screen) to a temporary placeholder, as this can assist with messaging.
#### Bringing your World online[β](#bringing-your-world-online "Direct link to Bringing your World online")
To bring your World back online before your specified go-live time, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **Settings tab**.
3. Toggle the **World switch** to *On*, and confirm your choice by clicking the **Bring World Online button**.
---
### World Stream
[YouTube video player](https://www.youtube.com/embed/Jjq2pxuQA-g)
#### Overview[β](#overview "Direct link to Overview")
World Stream is an innovative cloud-based solution for enterprise and educational communities where members might not have access to advanced graphics processing hardware. World Stream renders your Breakroom World in a series of cloud servers, and then streams a dynamic, *interactive* live video of that World to each user's device.
This offers many benefits, including:
1. Users don't need to download or install anything. No plugins, no standalone apps.
2. Users don't need to have the latest and greatest computer hardware. As long as their device can run a supported browser and has access to the Internet, they're ready to stream.
World Stream is currently supported on [Chrome](https://www.google.com/chrome/), [Firefox](https://www.mozilla.org/en-US/firefox/new/), and [Microsoft Edge](https://www.microsoft.com/en-us/edge). ***For the best possible experience, we recommend using Chrome.*** You can review detailed [technical specifications](/help/system-requirements.md) in our [Help section](/help.md).
warning
Microsoft Edge usually comes bundled with Windows. In order to use World Stream, you must use the version of Edge which, like Google Chrome, is built on the Chromium engine. Prior to logging in to World Stream through Microsoft Edge, please make sure that Windows Update has been run recently and that you are using the most recent version of Edge.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Basic World Stream functionality [](#basic-world-streaming-functionality)[β](#basic-world-stream-functionality- "Direct link to basic-world-stream-functionality-")
World Stream access is provided by AWS, which uses a variety of locations for delivery. Upon logging in, World Stream users will automatically be assigned to an available, low-latency AWS instance close to their physical location. In order for World Stream to be delivered, system administrators will need to whitelist the following domains:
`*.breakroom.tech`
`*.amazonappstream.com`
`*.appstream2.eu-central-1.aws.amazon.com`
`*.appstream2.eu-west-1.aws.amazon.com`
`*.appstream2.eu-west-2.aws.amazon.com`
`*.appstream2.eu-east-1.aws.amazon.com`
`*.furioos.com`
Additionally, please enable outbound UDP and TCP traffic on ports 443, 8433, and 53.
You can learn more about AWS allowed domains by visiting [this page](https://docs.aws.amazon.com/appstream2/latest/developerguide/allowed-domains.html).
If you encounter problems with WebRTC, you can perform a WebRTC test at .
info
Users attempting to connect to Breakroom from behind an aggressive firewall may run into issues, as they will have limited access to the Internet. In these cases, a commercial TURN server may provide the necessary solution.
#### World Stream server types[β](#world-stream-server-types "Direct link to World Stream server types")
Breakroom offers two types of server accessβUltra Servers and Lite Servers. Ultra Servers are recommended for [high user concurrency](/opening-the-doors/seats-and-concurrency.md) cases, while Lite Servers are an economical choice for smaller events. Please see our information on [purchasing and managing World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md#choosing-your-world-stream-server-type) and [event pre-allocation](/opening-the-doors/world-stream/pre-allocation-campaigns.md) for more details.
#### World Credits[β](#world-credits "Direct link to World Credits")
When users log in through your dedicated Breakroom [desktop app](/opening-the-doors/desktop-viewers.md), there are no additional access fees above the cost of their [seat](/opening-the-doors/seats-and-concurrency.md). World Stream access, on the other hand, must be purchased on a per user/per time basis using a digital currency known as *World Credits.*
[World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can [purchase additional World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md) at any time. Unused World Credits never expire, even if your Breakroom subscription lapses.
##### Partial hours and World Credit consumption[β](#partial-hours-and-world-credit-consumption "Direct link to Partial hours and World Credit consumption")
Due to the way AWS structures its billing, World Stream usage is currently calculated in hourly increments (i.e., multiples of 60 minutes). This hourly calculation policy also extends to [pre-allocation campaigns](/opening-the-doors/world-stream/pre-allocation-campaigns.md) and [user session time limits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md#setting-usage-limits).
This means that users cannot consume partial hours while logged in to World Stream. For example, if a user logs in for 20 minutes, the cost of one hour of access (60 minutes) will be deducted from the World Credits available on the account.
#### Launching World Stream[β](#launching-world-stream "Direct link to Launching World Stream")
World Stream can be accessed just like any other website. When you purchase a Breakroom subscription, you will be provided with a dedicated World Stream URL. You can copy this URL in order to share it with your users.

*Highlighted: The Breakroom access buttons in the site and secondary tab headers.*
When you log in to the Breakroom [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md), you will see a permanent *site header* (in the example image above, this header is dark purple). You will also see a secondary *tab header* on each Dashboard tab you visit.
Several of the buttons in these headers can be used to launch World Stream or access the World Stream URL. Here's a brief overview of the UI.
| Header button | Function |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Add Credits | Allows you to purchase World Credits instantly from any page on the Dashboard. |
| Enter Your World | Opens your dedicated World Stream URL in a new tab. |
| Advanced | Allows World Owners, Administrators, and Developers to log in to [Curator](../../advanced-tutorials/uploading-your-own-region/pushing-items-to-the-live-server). |
| Power icon | Logs you out of the Dashboard. |
| Copy World URL | Copies your World Stream URL to your computer's clipboard. |
| Download App | Directs you to the [Your Apps tab](../../building-new-worlds/breakroom-dashboard-tour#your-apps). |
##### Media access permissions[β](#media-access-permissions "Direct link to Media access permissions")
When you click on a World Stream URL, your browser may request permission to use your microphone or camera. If a pop-up like this appears, click **Allow** or **Okay.** If you accidentally refuse permission or close the pop-up without making a choice, see our [troubleshooting documentation](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-chrome.md) for assistance.
#### Logging in to World Stream[β](#logging-in-to-world-stream "Direct link to Logging in to World Stream")

Once you've opened the World Stream URL in your web browser, you'll see an **Account Login panel**. Here you can either enter your credentials and click the **Login button** to connect to World Stream, or sign up for a new account if [self-registration](/opening-the-doors/creating-and-managing-user-accounts.md#enabling-self-registration) is enabled.
Once you've successfully logged in, that's it! Basic information about using Breakroom can be found in our [Getting Started section](/getting-started.md).
##### Switching World Stream user accounts[β](#switching-world-stream-user-accounts "Direct link to Switching World Stream user accounts")

If you close World Stream and attempt to start it again a short time later, you may see an account confirmation dialog box appear during the login process. If you want to log in under the account you previously used, click **Continue**\*\*\*.\*\*\* If you want to log in with another user account, click **Switch Account**\*\*\*.\*\*\*
#### Important notes[β](#important-notes "Direct link to Important notes")
##### Cross-platform voice capabilities[β](#cross-platform-voice-capabilities "Direct link to Cross-platform voice capabilities")
Voice capabilities are currently restricted by login method. This means that if one user is logged in via [World Stream](/opening-the-doors/world-stream.md) and another user is logged in via a Breakroom [desktop viewer](/opening-the-doors/desktop-viewers.md), they will not be able to hear each other over voice chat, even if they are standing in the same Region.
Users who log in via the same method can communicate freely. Therefore, we strongly suggest that you take this into consideration when planning your events, and require *all* guests to use either World Stream or the desktop app.
We apologize for the inconvenience, and hope to provide a solution soon.
##### Browser auto-play[β](#browser-auto-play "Direct link to Browser auto-play")
Some browsers come equipped with "auto-play policies" that automatically block websites from playing audio and video until you interact with the content. In addition to [granting media permissions](/opening-the-doors/world-stream.md#launching-world-stream) to World Stream, you may also need to click on the page or otherwise interact with the streaming content in order to enable audio. You will need to repeat this action if you refresh the page.
---
### Pre-allocation campaigns
#### Overview[β](#overview "Direct link to Overview")
Breakroom's World Stream service uses "virtual machines" to process and stream your content. The number of on-demand World Stream machines is limited to a maximum of 100 per World. This means that at any given time, you can host up to 100 concurrent World Stream users without any special accommodations.
For events where you anticipate hosting more than 100 concurrent World Stream users, you must request pre-allocation. This will reserve the number of virtual machines required for your special event, ensuring that everything goes off without a hitch.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Important notes [](#important-notes)[β](#important-notes- "Direct link to important-notes-")
* When pre-allocating virtual machines for your event, the baseline maximum of 100 users *should not* be taken into account while planning. ***Instead, please be careful to*** ***specify the exact number of users who will be attending your event**.* For example, if 101 people RSVP to your event, you would request pre-allocation for 101 users.
* The maximum number of users World Stream can accommodate at this time is 1000. The system will not permit you to book an event for more than 1000 users.
* Please note that each reservation must be made for a minimum of one hour.
* When a live event consumes all pre-allocated [World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md) due to longer than expected event duration or higher than expected user count, a notification will be sent to the [World Owner](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator). World Credits will then be automatically deducted from the account to cover login time, provided the Breakroom account has World Credits available.
* Please keep in mind that World Stream use is calculated in [60-minute increments](/opening-the-doors/world-stream.md#partial-hours-and-world-credit-consumption). If a user is logged in for 20 minutes, they will still consume one 60-minute block of World Stream time.
* When making your reservation, please book for the maximum number of users for the longest duration required.
* All reservations must be submitted a minimum of 48 hours prior to the event.
* Please contact our [Customer Success Team](/help/where-to-find-support.md#contacting-the-customer-success-team) if you have any questions about requesting a reservation.
info
Pre-allocation campaigns require advance payment in the form of World Credits. The required amount of World Credits will be deducted from your account when you submit your pre-allocation campaign request. World Credits can be purchased during the pre-allocation process if needed.
#### Cancellation and refund policies[β](#cancellation-and-refund-policies "Direct link to Cancellation and refund policies")
Whether a pre-allocation campaign can be cancelled or advance payment refunded depends on several factors, including when cancellation is requested and whether the submitted event has been approved by staff.
| Time to event? | Event approved? | Can be cancelled? | Refund amount? |
| -------------- | --------------- | ----------------- | -------------- |
| N/A | NO | YES | 100% |
| >24 hours | YES | YES | 80% |
| <24 hours\* | YES | NO\* | 80%\* |
warning
The automated pre-allocation system built into the Dashboard will not allow you to cancel less than 24 hours before your approved event start time. In these cases, we may be able to manually cancel your event. Please contact our [Customer Success Team](/help/where-to-find-support.md#contacting-the-customer-success-team) by submitting a support ticket through the [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md#support-tickets).
If we are unable to cancel your event prior to five minutes before start time, your advance payment will not be refundable. We apologize for the inconvenience.
#### Requesting pre-allocation[β](#requesting-pre-allocation "Direct link to Requesting pre-allocation")

*Pictured: The Pre-allocation request panel.*
To submit a pre-allocation request, please follow the steps below.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Stream tab.**
3. Scroll down to the **Pre-allocation panel** and click the **Book Pre-Allocation button**. This will expand the panel.
4. First, select your preferred [World Stream server type](/opening-the-doors/world-stream.md#world-stream-server-types) by clicking the relevant **Select button**.
5. Then, select either a **One-time Reservation** or a **Recurring Reservation**.
1. For a one-time reservation, select your **event date** using the calendar.
2. For a recurring reservation, select both your **Start Date** and **End Date**. Once you specify these dates, the weekday buttons will become active. **Click on the days** for which you are requesting pre-allocation. (E.g. Every Saturday over the specified time period.)
6. After you have selected your event day(s), use the **Start time** and **End time drop-down menus** to specify the time duration for your event. (Note: Reservations must be a minimum of one hour in length.)
7. Enter the number of users who will be attending your event in the **Number of users field.**
8. Review the pricing breakdown. Remember: Pre-allocation campaigns require advance payment in the form of World Credits. The specified number of World Credits will be deducted from your balance after you confirm the booking.
9. When you are satisfied with your choices, click the **Request Pre-Allocation button**.
After you submit your request, our Customer Success Team will review the details and get in touch to let you know whether your event has been approved or declined.
[
](https://docs.breakroom.tech/open-the-doors/world-stream/purchasing-and-managing-world-credits)
---
### Purchasing and managing World Credits
[YouTube video player](https://www.youtube.com/embed/kI_2kZsSSIU)
#### Overview[β](#overview "Direct link to Overview")
When users log in through your dedicated Breakroom [desktop app](/opening-the-doors/desktop-viewers.md), there are no additional access fees above the cost of their [seat](/opening-the-doors/seats-and-concurrency.md). World Stream access, on the other hand, must be purchased on a per user/per time basis using a digital currency known as *World Credits.*
[World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can purchase, track, and manage World Credits using the Dashboard. Unused World Credits never expire, even if your Breakroom subscription lapses.
info
Only [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can access the Dashboard.
#### Purchasing World Credits[β](#purchasing-world-credits "Direct link to Purchasing World Credits")

*Pictured: The Add Credits panel.*
To purchase World Credits, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click the **Add Credits button** located in the site header.
3. In the pop-up that appears, enter the number of World Credits you would like to purchase. Please note that World Credits must be purchased in increments of 1000 Credits.
4. Click the **Next button**, and complete your payment information.
5. When you are satisfied, click the **Confirm button** to finalize your purchase.
#### Tracking your World Credits[β](#tracking-your-world-credits "Direct link to Tracking your World Credits")
##### World Credit Balance widget[β](#world-credit-balance-widget "Direct link to World Credit Balance widget")

The World Credit Balance widget on the [Dashboard landing page](/building-new-worlds/breakroom-dashboard-tour.md) allows you to quickly check your World Credit balance and most recent account activity. If you need[ additional World Credits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md#purchasing-world-credits) fast, the **Add Credits link** is also available.
##### World Credits tab[β](#world-credits-tab "Direct link to World Credits tab")
Alternatively, you can access a detailed breakdown of your World Credit purchases, refunds, and analytics by clicking the **World Credits tab** on your Dashboard.

*Pictured: An example of how the World Credits tab may appear.*
In addition to information about your World Credit transactions, the World Credits tab contains a number of important tools. Here's a brief guide to key parts of the UI.
| Button or link | Function |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| World Credit Balance panel | Displays your current World Credit balance, as well as your current-month purchases and expenditures. |
| Add Credits link / button | Allows you to purchase additional World Credits. |
| World Credit Analytics panel | Generates a quick World Credit purchase, expenditure, and availability breakdown based on your selected timeframe. |
| Transaction History panel | Provides a detailed, itemized list of your World Credit transactions and usage. |
| Transaction History search field | Allows you to search for a particular transaction. |
| Transaction History date pickers | Allows you to narrow the transaction history down to a specific date range. |
| Download CSV | Downloads a CSV file containing all transactions for the date period selected. |
##### Generating World Credit transaction and usage reports[β](#generating-world-credit-transaction-and-usage-reports "Direct link to Generating World Credit transaction and usage reports")

*Pictured: An example combined World Credit transaction history and usage report.*
**Transaction reports**
You can download your World Credit transaction history at any time by following these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Credits tab**.
3. Scroll down to the **Transaction History panel**.
4. Use the **search field** or the **date pickers** to filter the transactions list, if necessary.
5. Click the **Download CSV link** located above the **date pickers** to download a spreadsheet containing your selected transaction data.
**Usage reports**
World Stream access and activity can also be tracked using the Transaction History panel on the World Credits tab.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Credits tab**.
3. Scroll down to the **Transaction History panel**.
4. Enter the term "usage" into the **search field**, and press the **Enter key** on your keyboard. Usernames are identified in the **Items column**.
5. Click the **Download CSV link** located above the **date pickers** to download a spreadsheet containing your selected transaction data.
info
If you're looking for more detailed information concerning user session times and Region access, we suggest generating an [analytics report](/opening-the-doors/analytics.md).
#### Managing World Credit usage[β](#managing-world-credit-usage "Direct link to Managing World Credit usage")
##### Partial hours and World Credit consumption[β](#partial-hours-and-world-credit-consumption "Direct link to Partial hours and World Credit consumption")
Due to the way AWS structures its billing, World Stream usage is currently calculated in hourly increments (i.e., multiples of 60 minutes). This hourly calculation policy also extends to [pre-allocation campaigns](/opening-the-doors/world-stream/pre-allocation-campaigns.md) and [user session time limits](/opening-the-doors/world-stream/purchasing-and-managing-world-credits.md#setting-usage-limits).
This means that users cannot consume partial hours while logged in to World Stream. For example, if a user logs in for 20 minutes, the cost of one hour of access (60 minutes) will be deducted from the World Credits available on the account.
For this reason, Breakroom gives [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) tools to limit World Stream user session times and World Credit consumption. World Owners can also place a cap on the number of World Credits that can be purchased each month by the administrative team.
##### Setting World Stream usage limits[β](#setting-world-stream-usage-limits "Direct link to Setting World Stream usage limits")

*Pictured: The Manage World Stream Usage panel.*
To help you get the most out of your World Credits, there are three types of usage limits you can impose:
1. **Maximum session time per user**, which sets a cap on how much time an individual user can spend in a *single* World Stream session.
2. **Monthly usage quota per user**, which sets a cap on how much time an individual user can spend in World Stream per month.
3. **Monthly usage quota for World**, which limits how many minutes *all* of your users can collectively spend in World Stream each month.
To enable any of these usage limits, follow the steps below.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Stream tab**.
3. Scroll down to the **Manage World Stream Usage panel**.
4. Locate the usage cap you want to enable. Click the **Edit button** located to the right of the usage cap name.
5. Enter your preferred **number of minutes** or click the **Unlimited button**.
6. Click the **Save button** when you are finished.
warning
Important notes about monthly usage quotas:
* The **Monthly usage quota per World** cap does not discriminate between individual users. This means that a single user could potentially consume the entirety of your monthly usage quota.
* The World Credit [partial hours](/opening-the-doors/world-stream.md#partial-hours-and-world-credit-consumption) calculation policy also applies to monthly usage quotas. Users who log in for less than 60 minutes will still consume one 60-minute block of time from your monthly usage quota.
##### Choosing your World Stream server type[β](#choosing-your-world-stream-server-type "Direct link to Choosing your World Stream server type")
![]()
Another way that [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and [World Administrators](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#administrator) can manage costs is to select an appropriate World Stream server type. An updated list of server type features, prices, and regional availability can be found on the Dashboard, but in general, our Lite Servers offer acceptable performance for smaller events at a reduced cost.
To change your World Stream server type for all users, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Stream tab**.
3. Scroll to the **Your World Stream server type panel**.
![]()
*Highlighted: The "Change my World Stream server type" link.*
4. On the left side of the panel, you will see your current World Stream server type listed. To change it, click the **"Change my World Stream server type" link** located on the right side.
5. A pop-up will appear. Click on the server type you prefer.
##### Setting World Credit purchase limits[β](#setting-world-credit-purchase-limits "Direct link to Setting World Credit purchase limits")

*Highlighted: The Monthly Purchase Limit section of the World Credits tab.*
To limit the amount of World Credits that can be purchased on your Breakroom account each month, follow these steps.
1. Navigate to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
2. Click on the **World Credits tab**.
3. Scroll to the **My Balance panel**. You will see your current **Monthly Purchase Limit** listed there.
4. To change the monthly limit, click the **Pencil icon** located to the right. A pop-up will appear. Enter the new purchase limit in the field, and click the **Save button**.
---
### Troubleshooting World Stream issues on Chrome
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
In order to help troubleshoot audio and video connectivity issues, Breakroom provides users with a dedicated AV diagnostics panel. You can learn more about how to access this service on our [general troubleshooting page](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md), as well as how to [change devices](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#changing-devices-in-world-stream) from within the World Stream platform itself.
However, some connectivity issues may require adjusting your browser settings. The instructions on this page are written specifically to assist users who may encounter issues while running World Stream on the Chrome browser.
#### Permission denied error / No device error[β](#permission-denied-error--no-device-error "Direct link to Permission denied error / No device error")

*Pictured: A completely non-functioning system, as seen in a general AV troubleshooting test.*
If you run a [general AV troubleshooting test](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md) and the video or audio section reads "Permission Denied," and the video or audio device is listed as "No Device / Unauthorized," you may have accidentally blocked access to your camera and microphone, or your System Administrator may have blocked access within your browser.

*Pictured: The Chrome settings > Privacy and security tab, with the location of the Camera and Microphone permissions for breakroom.tech highlighted.*
To fix this problem, you may be able to manually grant permissions by following these steps.
1. Click the **vertical ellipses button** in the upper right corner of your Chrome browser, and select **Settings**.
2. Search for **"site settings"** using the search field, and click on the **Site settings button**.
3. Click on the Breakroom.tech link to adjust settings for this site.
4. In the Permissions panel that appears, use the **drop-down menu**s to select **"Allow"** for the Camera and/or Microphone.
5. Refresh your browser tab by pressing the **F5 key** or by clicking the browser **refresh button**.
If you are running Chrome on macOS, you may also need to [grant media permissions](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-macos.md) on the OS level.
#### Unrecognized device errors[β](#unrecognized-device-errors "Direct link to Unrecognized device errors")
If you run a [general AV troubleshooting test](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md) and the listed video or audio device is incorrect (meaning that the device selected is missing, or wrong), you may need to change the default devices that your browser is set up to recognize. This can be done from [within the Breakroom platform](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#changing-devices-in-world-stream), but you can also accomplish this through your browser.

*Pictured: The Chrome settings > Privacy and security > Site settings tab, with the location of the Camera and Microphone permissions highlighted.*
To change the default devices in Chrome, follow these steps.
1. Click the **vertical ellipses button** in the upper right corner of your Chrome browser, and select **Settings**.
2. Search for **"site settings"** using the search field, and click on the **Site settings button**.
3. Scroll down to the Permissions section. Click on either the **Camera** or **Microphone settings**, depending on what you would like to change.
4. In the Permissions panel that appears, use the **device selection drop-down menu** located near the top to choose your preferred input device.
5. After you've selected your new default devices, refresh the **World Stream tab** and your changes will take effect.
#### Important notes[β](#important-notes "Direct link to Important notes")
##### Cross-platform voice capabilities[β](#cross-platform-voice-capabilities "Direct link to Cross-platform voice capabilities")
Voice capabilities are currently restricted by login method. This means that if one user is logged in via [World Stream](/opening-the-doors/world-stream.md) and another user is logged in via a Breakroom [desktop viewer](/opening-the-doors/desktop-viewers.md), they will not be able to hear each other over voice chat, even if they are standing in the same Region.
We apologize for the inconvenience, and hope to provide a solution soon.
##### Browser auto-play[β](#browser-auto-play "Direct link to Browser auto-play")
Some browsers come equipped with "auto-play policies" that automatically block websites from playing audio and video until you interact with the content. In addition to [granting media permissions](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-chrome.md#launching-world-stream) to World Stream, you may also need to click on the page or otherwise interact with the streaming content in order to enable audio. You will need to repeat this action if you refresh the page.
---
### Troubleshooting World Stream issues on macOS
#### Overview[β](#overview "Direct link to Overview")
Due to increased security restrictions on macOS, you will need to take extra steps to permit camera and microphone access when using World Stream. These permissions are necessary for the proper functioning of Breakroom's[ conference system](/getting-started/using-the-conference-system.md).
If you do not grant Breakroom permission to use the microphone and camera when initially asked, you will need to manually approve their usage by editing the Privacy & Security settings on macOS.
#### Allowing camera and microphone access[β](#allowing-camera-and-microphone-access "Direct link to Allowing camera and microphone access")

*Pictured: An example macOS permission pop-up.*
If you are running World Stream in Chrome on macOS, you will see *four* camera and microphone access dialog boxes appear the first time you log in. Two dialog boxes will ask you to confirm access for the Chrome browser, and two will ask you to confirm access for macOS.
To permit Breakroom to access your media devices, click the **Allow button** each time when prompted.
##### Correcting access errors[β](#correcting-access-errors "Direct link to Correcting access errors")
If you click the **Don't Allow button** for either camera or microphone access during initial setup and then want to correct this, you'll need to[ grant Chrome permission ](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-chrome.md)to access the device(s). You must then grant macOS the same permissions.

*Pictured: The Privacy & Security > Microphone settings in macOS.*
To grant Breakroom access to your microphone and camera on macOS, follow these steps.
1. Click the **System Settings icon** in the Dock, or navigate to **Apple menu > System Settings**.
2. Click on **Privacy & Security**, and then **Camera** and/or **Microphone**.
3. You will see a list of installed applications. **Toggle access on** for **Breakroom**, **Sinespace**, or the **custom name** of the Breakroom World desktop app in question.
##### Revoking access[β](#revoking-access "Direct link to Revoking access")
To revoke Breakroom's access to your camera and microphone on macOS, follow steps 1-3 above and **toggle access off**.
#### Sound input and output[β](#sound-input-and-output "Direct link to Sound input and output")
MacOS gives you access to sound input and output volume controls. Making adjustments to your microphone and speaker volume can be very helpful when you run into audio issues in-world.
##### Input options[β](#input-options "Direct link to Input options")

*Pictured: The Sound > Input settings in macOS.*
To locate the sound input options, follow these steps.
1. Click the **System Settings icon** in the Dock, or navigate to **Apple menu > System Settings**.
2. Click on **Sound**, and scroll down to the **Output & Input section**. Then click the **Input tab**.
The **device identification window** allows you to select your input device if you have multiple devices connected, or to identify your current device if you are uncertain which you may be using. The **input volume slider** allows you to control the volume of your input device. Lowering the volume on your microphone can assist with problems such as pitchiness or peaking, but may make it harder for others to hear you.
##### Output options[β](#output-options "Direct link to Output options")

*Pictured: The Sound > Output settings in macOS.*
To locate the sound output options, follow these steps.
1. Click the **System Settings icon** in the Dock, or navigate to **Apple menu > System Settings**.
2. Click on **Sound**, and scroll down to the **Output & Input section**. Then click the **Output tab**.
The **device identification window** allows you to select your output device if you have multiple devices connected, or to identify your current device if you are uncertain which you may be using. The **output volume control** allows you to adjust your headphone volume independent of your speaker or master volume. You can also mute your headphones directly from this window.
---
### World Stream keyboard shortcuts
#### Overview[β](#overview "Direct link to Overview")
Since World Stream runs in your browser, keyboard shortcuts may differ compared to those used in the [desktop Breakroom application](/opening-the-doors/desktop-viewers.md). You can find specific keyboard shortcuts listed below.
#### Shortcuts[β](#shortcuts "Direct link to Shortcuts")
| | | |
| ------------------------ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Windows Command | MacOS Command | Result |
| F1 | F1 | Calls up the help menu. |
| F12 | F12 | Calls up your own user profile. |
| Ctrl + Shift + F8 | FN + Ctrl + Shift + F8 | Enables [camera](../../getting-started/controlling-your-camera) and [object ](../../creating-custom-experiences/using-the-region-editor/)drag mode when connected via AWS World Stream. |
| Ctrl + M | Ctrl + M | Toggles the Breakroom email window. |
| Ctrl + F | Ctrl + F | Toggles the People window. |
| Ctrl + E | Ctrl + E | Toggles the Explore window. |
| Ctrl + Q | Ctrl + Q | Toggles the Quest window. |
| Ctrl + I | Ctrl + I | Toggles the Inventory window. |
| Ctrl + O | Ctrl + O | Toggles the Outfit window. |
| Ctrl + S | Ctrl + S | Toggles the Shop. |
| Ctrl + H | Ctrl + H | Toggles the Rooms window. |
| Ctrl + `Ctrl +` | Launches the Snapshot feature. | |
| Ctrl + / | Ctrl + / | Calls up the Settings panel. |
| Ctrl + Shift + P | Ctrl + Shift + P | Calls up the bug report/feedback window. |
---
### World Stream viewer toolbars
#### Overview [](#overview)[β](#overview- "Direct link to overview-")

*Highlighted: The location of the World Stream toolbar.*
World Stream features a specialized toolbar designed to help users address common streaming issues. This toolbar is located at the top of the browser window, and can be collapsed or expanded by hovering your cursor over it and clicking the **arrow** that appears.
On this page, we'll review the available functions and how to use them.
#### Copying and pasting [](#copying-and-pasting)[β](#copying-and-pasting- "Direct link to copying-and-pasting-")
[AWS](https://docs.breakroom.tech/open-the-doors/world-stream#world-stream-providers) runs Breakroom on a remote machine with its own clipboard, so copying and pasting text is a slightly more complex process. The World Stream toolbar gives you the ability to copy and paste text between the Breakroom stream and your own computer.
##### Copying text from World Stream [](#copying-text-from-world-stream)[β](#copying-text-from-world-stream- "Direct link to copying-text-from-world-stream-")
To copy text from a World Stream session to your local computer, follow these steps.

*Pictured: An example of text highlighted within a Breakroom World Stream session.*
1. **Highlight the text** you want to copy within your Breakroom World Stream Session, and press **Ctrl + C** on your keyboard.

*Highlighted: The location of the Clipboard button.*
2. Click the **Clipboard button** in the World Stream toolbar. A pop-up window will appear containing your highlighted text.
3. **Highlight the text** again, and press **Ctrl + C** a second time to copy the text to your local computer clipboard. You can then paste it wherever you like.
##### Pasting text into World Stream [](#pasting-text-into-world-stream)[β](#pasting-text-into-world-stream- "Direct link to pasting-text-into-world-stream-")
To paste text into a Breakroom World Stream session, follow these steps.
1. Highlight the text on your local computer and press **Ctrl + C** to copy it.
2. Click the **Clipboard button** in the World Stream toolbar. A pop-up window will appear containing a text field. Press **Ctrl + V** to paste the text to the remote machine clipboard.
3. Once the text is entered, you can press **Ctrl + V** to paste the text anywhere you like in-world, including in text chat fields.
#### Preferences[β](#preferences "Direct link to Preferences")

*Highlighted: The location of the Preferences button.*
Clicking the **Preferences button** will reveal a panel containing several tabs. Many key stream settings are available here, including streaming mode and screen resolution, streaming metrics, and regional and keyboard settings.
##### General[β](#general "Direct link to General")
As pictured above, the General settings panel allows you to customize:
* Your streaming mode (responsiveness vs. image quality)
* Your resolution
* Your tab appearance
All of these settings will become active the moment you select them, and you can change your settings at any time.
##### Regional settings[β](#regional-settings "Direct link to Regional settings")

*Pictured: The World Stream Preferences > Regional settings tab.*
Clicking on the **Preferences > Regional settings tab** allows you to customize your time zone and geographical location.
If you are using a Chinese, Japanese, or Korean keyboard, you can also specify your keyboard language in this panel. To do so, follow the steps below.
1. Click the **Preferences button**, and then click the **Regional settings tab**.
2. Using the **Input method drop-down menu**, select the keyboard language you would like to use.
3. Click the **Save button**.
##### Performance[β](#performance "Direct link to Performance")

*Pictured: The World Stream Preferences > Performance tab.*
Clicking on the **Preferences > Performance tab** allows you to track streaming metrics in real time.
#### Function keys[β](#function-keys "Direct link to Function keys")

Clicking the **Fn Keys button** in the World Stream toolbar will open a virtual on-screen keyboard that you can click with your mouse cursor or finger. This can assist with data entry or [keyboard shortcuts](/opening-the-doors/world-stream/world-stream-keyboard-shortcuts.md).
---
## Release Notes
### RELEASE NOTES
#### [ποΈBreakroom SDK](/release-notes/breakroom-sdk.md)
[Release notes for Breakroom SDK v2021.7.7.13756.](/release-notes/breakroom-sdk.md)
---
### Breakroom Dashboard
#### Dashboard version: v24282[β](#dashboard-version-v24282 "Direct link to Dashboard version: v24282")
##### New Features[β](#new-features "Direct link to New Features")
* **New Feature: Syllabus**
* Build up to **150 steps** per syllabus; drag-and-drop, multi-select, duplicate, insert, and bookmark steps from a timeline view.
* Each step supports **up to 10 Actions**:
* Change Camera (switch preset view)
* Custom Function (call Lua script with rich metadata)
* Draw Attention (highlight Mic, Webcam, etc.)
* Participation Level (toggle Quiet / Voice-only / Full)
* Send Broadcast (conference chat message)
* Show Toast (on-screen popup to user/everyone)
* Start / Stop Quiz (full or selected questions)
* Start Timer (count-down with label)
* Start Waiver (present waiver form)
* Take Tour (trigger region tour)
* Teleport (move user/everyone to location / multi-zone)
* View Image, Visit Website, Watch Video (to screen, presentation, placed, or external)
* Per-step **Annotations**: student-visible guidance and private instructor notes (text, image, link).
* **βDone-this-beforeβ logic**: repeats of Timer, Tour, Quiz, Waiver, etc. are skipped when rewinding or revisiting steps unless force-run.
* **New Feature:** The Learning Management Dashboard now includes a "Quick View" feature to display quizzes with selected due dates on the calendar.
* **Improvement:** Updated the LMS Dashboard to display course-specific participant lists for easier access and management.
* **Improvement:** Enhanced the Dashboard's image/video library to ensure tag functionality allows clickable tags and seamless integration with the search feature.
##### Improvements[β](#improvements "Direct link to Improvements")
* Enhanced the media library to display newly uploaded images or videos at the top of the list for easier access.
* The Learning Management Dashboard now includes a "last edited" timestamp for easier visibility of recent updates.
* The Dashboard now automatically distinguishes file formats, optimizing the image/video upload process.
* Enhanced the process to activate archived courses directly from the Learning Management Dashboard for a more consistent user experience.
* Enhanced the Dashboard filter functionality by adding a search bar to facilitate easier quiz and lesson searches.
* The Dashboard's left sidebar is now collapsible to enhance workspace efficiency.
##### Bug Fixes[β](#bug-fixes "Direct link to Bug Fixes")
* Corrected typographical errors throughout the Dashboard.
* Resolved several user-interface inconsistencies.
* Applied minor bug fixes for improved stability.
---
### Breakroom SDK
#### SDK version: 2021.7.7.13756[β](#sdk-version-20217713756 "Direct link to SDK version: 2021.7.7.13756")
##### Features[β](#features "Direct link to Features")
* Added new Lua functions with options for Audio Reactive Light/Animation/Material/Transform/Particle components.
* Server scripts now have support for Script libraries (requires processing server change to be deployed)
* Added support for changing uploaded UI element colours to match the application via Lua script.
* Added support to disable crouching/flying/jumping/running via script.
* Added Space.TypeName(obj) to scripting.
* Added SScript.Session to scripting. Returns a unique ID each time the viewer is started which remains consistent throughout the viewer during that time.
* Added SShared.SetSuperGlobal / GetSuperGlobal - similar to SetGlobal/GetGlobal except these values will persist between scenes when teleporting.
* Added OnApplicationQuit event for Lua.
* Added SAvatar.SynchroniseState() which forces a network synchronization of the player state: It is useful in cases when you have blocked avatar movement or similar events which may block the avatar from transmitting a script-driven update. Only works once per 5 seconds.
* Added SScript.TrackingAllowed(string key) & SScript.TrackingRequest(string key, string reason, Action\\\ callback); only usable on white label grids. Handles GPDR & similar prompts.
* Added Space.Input.CursorInUI
* Added onComplete Closure to SWebservice.GetImage. Added a way to get the Width and Height of Texture2D
* Added SAvatar.TeleportToNextEvent, so the creator can Teleport user to the next event which will start in a defined time.
* Added StartRecording ,StopRecording and StringToHash. Added a function transfer message based on SignalR, for sharing messages between different regions/shards.
* Added Space.Grid to Lua SDK for accessing grid information on white labels.
* Added AttachmentHelper to Lua API.
* Added Space.Chat.JoinGridVoice
* Added SAvatar.JobTitle and SAvatar.Company. AnalyticsEvent and SAnalyticsEvent. Added Space.Version which returns the revision number of a release.
* Added OpenDevicePicker in SUI and Furioos.
* Added SGameObject.OnParticleCollision.
* Added SVideos for allowing videos to be uploaded to Sinespace.
* Added SUIInputField.ActivateInputField() SUIInputField.DeactivateInputField() SUIInputField.Select()
* Added a method and Lua interface to link playerID and VirtualGoodID.
* Added Space.Scene.OnEditModeAdd and Space.Scene.OnEditMoveRemove. BlockMovement status would memorise the placement of the SAvatar object.
* Added the Lua interface for GetCurrentAnimatorStateInfo
* Added a new class for AnimatorStateInfo. Fixed null reference to make STween usable.
* Added Cancel() function to stop a running tween in STween.
* Added SGameObject.AddAnimator(). Fixed an issue where OnStateChange event in EmbeddedVideo does not pass the correct new state when transitioning from Stopped to Play
* Added SGraphicRaycaster and SUIRaycastResult for raycasting UI elements.
* Added StartFly and EndFly for player avatar control.
* Added SAvatar.Gender which returns "Male" or "Female".
* Added Scripting Resources component for attaching resources to objects without a runtime.
* Added MouseX and MouseY in SInput.Enable to read the right stick value with these properties.
* Added SGameObject.Networking to Lua SDK to access new SimpleNetworking component.
* Added Boolean as option to ScriptDataVariableType and PublicScriptVariableType
* Added an Avatar property to Clothing Item Settings for replacing the built-in animation skeleton layout in built-in-human avatars.
* Added SContentSizeFitter. Added EnableInput API for block or enable browser's input.
* Added WASM support for scripting.
* Added C headers for scripting API which can be used with emscripten to compile WASM which can be loaded by the script engine.
* ToolTipHint component added to allow tooltips to be added to any UI element automatically. Includes Lua scripting support.
* Added an option in the scene save settings feature where users can select whether the fog will affect the skybox. The default will be false.
* Added more animation Override slots for cloth items.
* Added a new component "Attachment Control" - this component is designed to be used on Attached clothing items, it will show or hide the item, depending on whether it is attached to the player. This can be used, for example, to hide canvases that should only be seen by the player who owns the item.
* Quest Designer: Added an option in quest designer which can show other avatars in quest conversation
* Browser Surface: Added mute/unmute function for BrowserSurface, and a Lua function for the same.
* Added an option for ultra skin for avatars and the option to activate it.
* Creator Settings: Added a warning if you delete the Editor Default Resources folder in the editor pack
* Added FrameCount and IsPlaying in SEmbeddedVideo.
* Added Space.Grid.PlayerIsAdmin for grid admin, different from region admin. White Label Only.
* Added support for SGameObject.UILayout to modify layout groups from Lua. Added ShowSearch, ShowMailButton, and ShowClock in SUI. Add Loop and ClearRenderTexture for MediaPlayer.
* Enabled OnParticleTrigger() in Lua SDK.
* Added SParticle to control each particle.
* Added Set/GetTriggerParticles in SParticleSystem.
##### Improvements[β](#improvements "Direct link to Improvements")
* ObjectRef public variables / data variables return as SGameObject in Lua now.
* Added the SimpleStateMachine component for creating interactive content without Lua scripts. Also accessible from scripts via Object.StateMachine.
* Added the ScriptingEvents component for attaching Unity events to objects without a scripting runtime. Also accessible from scripts via Object.Events.
* SChat.JoinVoice can now create spatialized zones.
* SDialogues.OpenURL takes optional newTab parameter.
* Added Script support for VoiceZone Components
* Added OnUploadStart event in SPhotos and modified some code to fit SVideo.
* Added Audio Source Lua API. (PlayClipAtPoint)
* Added a Lua function to call the enabled region list.
* Tweaked LUA API for LineRenderer using a 0-based index. If ScriptingRuntime's index is Lua Standard, the index will be 1-based.
* White label scripting APIs can now be toggled on/off on a per-grid basis for those not wanting to enable them.
* The Editor Pack will now propose to set up lightmaps for export if baked lighting is detected in the scene; prior to uploading the scene.
* Hardened script runtime against accidental non-play mode execution
* Changed the annotation of SaveClothingBaseInternal in order to make the ClothingItemSetting component support the multi-object editing feature.
* When previewing the scene in Unity, it can now generate the users' avatar.
##### Fixes[β](#fixes "Direct link to Fixes")
* Fixed scripts showing the wrong name in the System chatbox when calling Space.Log during startup.
* Fixed an issue where Space.Input.MouseLook = true is not working
* SWebService.GetImage source security hole is now fixed
* SNetwork.Chat.JoinChat should now properly open a chat tab.
* Fixed an issue where SSeat.InUse could incorrectly return 'false'.
* SGameObject.StateMachine and SGameObject.Events should now work in Lua scripting.
* Fixed an issue where avatars can move while playing animations by Lua.
* Fixed an issue where images remained grey while loading on SWebService.GetImage
* Fixed an issue with SharedPlayback being broken when using UMP to play videos.
* Space.Scene.Find / FindID should no longer cause an exception that terminates the script if the object is not found. SUI.ShowActivityPanel should work now.
* Chat channel joined via SChat can now exit normally when the user changes region.
* Space.LoginTime will now return the total seconds since the user logged in.
* ResetOutfitToTemplate will now refresh the inventory correctly.
* Space.Log will no longer write to the player log on the live server, only the preview server. This is to minimize lag caused by synchronous log writes.
* Space.Camera.MainCamera should now return null if the main camera is not initialized, instead of causing a fatal exception.
* Fixed a Lua script crash when reading the custom tag. User-defined tags are unsupported.
* Fixed a bug in SBrowserSurface, where the zoom function was not working in the BrowserSurface component. Also fixed an issue with SUISlider.Direction.
* Fixed an issue with packaging custom .asset mesh files.
* Fixed an issue with mesh preservation failing on temporary assets
* Fixed an issue where emission materials on uploaded contents would have their shaders replaced.
* Removed SNetwork.ReconnectGlobalNetwork and SNetwork.OnGlobalNetworkDisconnect
* Fixed an issue with SChat generating invalid chat channel names.
* SGameObject.AddClickable will now return an existing Clickable if it already exists.
* Fixed an issue where an item cannot be uploaded if a particle is added to a virtual good.
* Fixed an issue where two blank spaces appeared in the auto-generated Virtual Good name.
* Fixed Steps in BranchedQuestWindow being dragged out of view, this will no longer be possible.
* Fixed an issue in Branched Quest Window, where "Next Step" set to "End" won't automatically link to the newly created step.
* Fixed Parts of Conversation in Quest Window not being visible on the screen.
* Attachments can no longer be uploaded as Rigged Clothing if they have been previously attached to a bone.
* Materials will no longer disappear when using Convert to Reweighting.
* Fixed an issue where attachment ClothingItem doesn't work with the clothing previewer component.
---
### Breakroom Viewer
#### Viewer version: 2025.5f20496[β](#viewer-version-20255f20496 "Direct link to Viewer version: 2025.5f20496")
##### New Features & Improvements[β](#new-features--improvements "Direct link to New Features & Improvements")
**Chat Text Size**
* Chat text size can now be adjusted independently from the overall UI scale.
* Improves readability and accessibility without changing the size of other interface elements.
**Notifications**
* New and improved unified notifications menu that combines all messages, friend requests, and system updates.
* Includes quick/bulk actions like **Mark all as read** (mail) and **Accept all / Decline all** (invites).
**Menu & Pins**
* A new main menu provides a single place to access key controls, tools, and viewer options such as Settings, Help, and About.
* Items within the menu can be pinned to the toolbar, allowing each user to choose which tools remain visible on-screen for quicker access.
* The menu header now displays the current region and, when applicable, the active zone.
* The Minimap can now also be pinned or hidden.
**Toolbar & Interface Updates**
* The new toolbar at the top-right of the interface brings together commonly used controls such as microphone, volume, music, and other quick-access tools, along with any items the user pins from the main menu.
* The overall interface has been refined for clearer layout, improved spacing, and better visual consistency across panels and menus.
* The loading indicator now appears in a less obtrusive position, and a confirmation popup was added to the Log Out option for clarity.
* Numerous small visual and functional adjustments improve alignment, readability, and interaction throughout the interface.
**Connection Indicators**
* The connection status UI now provides clearer, context-aware feedback across **voice**, **chat**, and **server** connections.
* Different indicators and status messages appear as conditions change, helping you pinpoint where an issue is occurring (voice, chat, or server).
* Visibility and behavior of these states have been refined for consistency and faster troubleshooting.
**Settings Improvements**
* The Graphics Settings window now includes clearer labels for presets and improved text to make configuration easier to understand.
* Several settings have been reorganized into more intuitive categories.
##### Bug Fixes[β](#bug-fixes "Direct link to Bug Fixes")
* **User Interface**
* Fixed an issue where text or hyperlinks in the Microphone & Camera Audio Test panel could spill or overflow when resized; text now wraps correctly and the layout adjusts to maintain alignment.
* Fixed an issue where the displayed used region size could show incorrect values under certain conditions in the Edit Region and Explore panels, or when switching between floors; the used size now counts all floors correctly and displays consistently across panels.
* Fixed an issue where the connection icon could display βConnection Status: No issues.β while the chat panel still showed it was connecting to the XMPP server; the connection status now displays correctly.
* Fixed an issue where dragging chat tabs out and back could leave a white duplicate of the chat panel; toggling Hide/Show Chat now correctly updates the chat display and hides/shows all chat channels.
* Fixed an issue where the region name could be invisible in the Edit Region Profile panel; the region name now displays correctly.
* Fixed a crash that occurred when using the Moderator toolsβ βReveal hidden UI featuresβ option; hidden UI buttons now display correctly without crashing.
* Fixed an issue where screen sharing or camera would unexpectedly stop when turning the microphone on or off; the displayed share/camera state now stays in sync with the actual stream.
* Fixed an issue that prevented users from resizing the Gestures window in the Inventory.
* When composing mail, clicking βSelect Moreβ now brings the Select Recipient window to the front so it is no longer hidden behind the Mail window.
* Fixed an issue where emojis could appear at the wrong size when editing messages or changing the chat text size; emojis and regular text now display consistently.
* Bug fix - When a region has no active text chat channels, the chat button is now hidden so users will no longer see or open a blank chat window.
* Fixed an issue where the Regions and Shop buttons only became visible after clicking the Outfit button; they now appear correctly without that extra step.
* Fixed an issue where disabling the Hot Bar in the Dashboard and then re-enabling it via Viewerβs Moderator Tools made previously added Hot Bar items disappear.
* Fixed an issue where the βChat Connection Lostβ panel could not be closed by clicking its X button; the panel can now be dismissed using the close button.
* **Avatar & Content**
* Fixed an issue that could prevent avatars from loading.
* Fixed an issue where, after logging out, the avatar briefly appeared pink or visually broken before the login screen; logging out now advances directly to the login screen without showing the broken avatar.
* Fixed an issue where bundle item appearance chances didnβt match the configured probabilities; bundle drops now follow the configured settings.
* Fixed an issue where some accessories would not appear in an outfit preview when worn with a full humanoid avatar, which could prevent the Save button from becoming active.
* Fixed a bug where certain attachments could become excessively large and float when worn on full-body avatars; attachments now retain their correct scale when attached.
* **App (General)**
* Embedded videos now respect object audio sources so spatial audio works correctly again; the viewer now prioritizes the built-in video player and falls back to an alternate player only when necessary.
* Fixed an issue where the video player opened the full browser page instead of playing embedded videos; embedded YouTube videos now play in the player (some YouTube content may still require signing in).
* Fixed an issue where some long-standing regions could fail to load after updating the client; affected regions should now load correctly.
* Fixed an issue that could prevent users from joining some regions (the app could freeze or disconnect during finalizing); joining those regions now works normally.
* Fixed an issue where in-world video playback could ignore the Master and Voice volume sliders, so changing the sliders did not affect the videoβs sound.
* Fixed multiple crashes that could cause the app to exit unexpectedly β including when entering or teleporting between regions, viewing a worldβs Privacy Notice/EULA, logging in, changing audio/microphone settings, editing room names, or browsing shop items.
* Fixed an issue that caused content that uses Flickr (such as the board in Welcome Center) to sometimes appear blank or lose images.
* **App (Mac)**
* Fixed an issue on Mac where choosing outfits other than the default could display a black silhouette instead of the selected outfit.
* Fixed a crash on Mac that could cause the viewer to close unexpectedly when others join a region, after teleporting, or after being open for a period of time; the issue related to in-world script interaction has been addressed.
* Fixed an issue where the eject-user countdown timer could overlap the search bar on Mac; the timer and search bar are now properly aligned.
---
## Running Your Event
### RUNNING YOUR EVENT
#### [πUnderstanding the conference system](/running-your-event/understanding-the-conference-system.md)
[2 items](/running-your-event/understanding-the-conference-system.md)
---
### Customizing the conference system components
#### Overview[β](#overview "Direct link to Overview")

When you're building your Breakroom World, you can customize it as little or as much as you like. Plug-and-play breakout areas allow you to deploy conference Regions with just a few clicks, while our custom voice zones allow you to shape the aural landscape to control media sharing and audience interaction.
#### Important links in this section[β](#important-links-in-this-section "Direct link to Important links in this section")
[adding-breakout-areas.md](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md)
[creating-custom-voice-zones.md](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md)
[setting-up-presenter-and-audience-zones.md](/running-your-event/customizing-the-conference-system-components/setting-up-presenter-and-audience-zones.md)
---
### Adding breakout areas
[YouTube video player](https://www.youtube.com/embed/PCyj05j1mPM)
#### Overview[β](#overview "Direct link to Overview")

*Pictured: A breakout area being added to a Region.*
Breakroom's prefab [breakout areas](/creating-custom-experiences/exploring-the-breakroom-toolkit/conference-rooms-and-booths.md) come with voice zones and conference tools pre-installed. Each breakout area object you install in your Region will automatically receive its own custom [Zone ID](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-id), [Zone Color](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-color), and a unique [Zone Name](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-name) that will be added to the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel). These options can all be changed to suit the needs of your event.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
After using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) to add or edit a voice zone, always remember to click the **Reset Zones button** to reset the conferencing system. If this doesn't seem to push your changes forward, try saving your work, leaving the Region, and entering it again.
#### Locating the breakout area objects [](#locating-the-breakout-area-objects)[β](#locating-the-breakout-area-objects- "Direct link to locating-the-breakout-area-objects-")
A selection of prefab breakout rooms, booths, offices, and workshops can be found in the [Breakroom Toolkit](/creating-custom-experiences/exploring-the-breakroom-toolkit.md). Detailed descriptions of each breakout area object are also [available](/creating-custom-experiences/exploring-the-breakroom-toolkit/conference-rooms-and-booths.md).
#### Adding breakout areas using the Region Editor[β](#adding-breakout-areas-using-the-region-editor "Direct link to Adding breakout areas using the Region Editor")
You can add any of the [breakout area objects](/creating-custom-experiences/exploring-the-breakroom-toolkit/conference-rooms-and-booths.md) to your Region using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md). The quick-start instructions below are provided for your convenience.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Inventory Button** to launch your [Inventory window](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
4. Locate the **Breakroom Breakout Area object** you want to use. Add it to your Region using your [preferred method](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
1. The breakout area will automatically receive its own Zone ID, Zone Color, and a unique Zone Name. If you want to edit any of these properties, please refer to the [section](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md#editing-breakout-area-details) that follows.
5. Using the Region Editor tools, [position](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) the breakout area to meet your specifications.
6. Click the **Reset Zones button** to reset the conferencing system.
7. When you are satisfied, click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
#### Understanding breakout area Display Names[β](#understanding-breakout-area-display-names "Direct link to Understanding breakout area Display Names")

*Pictured: The Objects and Inspector windows. Notice how the highlighted Breakroom Breakout Area A object is tagged with both its Zone ID and Zone Name.*
If you add multiple copies of any object to your Region, you will notice that every copy is identified by the same name in the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window). The same is true of breakout area and voice zone objects. However, to facilitate Region setup and management, these objects will acquire two additional information tags after installation:
* [Zone ID](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-id): This number will be displayed using \[brackets]
* [Zone Name](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-name): This information will be displayed in (parenthesis)
These information tags can help you identify your breakout areas and resolve [duplicate zone errors](/running-your-event/customizing-the-conference-system-components/troubleshooting-duplicate-zone-errors.md).
#### Editing breakout area details[β](#editing-breakout-area-details "Direct link to Editing breakout area details")
Breakout areas are designed to automatically set themselves up. However, you may run into situations where you need to change some breakout area details. To do this, you will need to locate and edit the object's [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).

*Pictured: The RoomFurniture component, expanded to display all 15 fields.*
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Breakroom Breakout Area object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Click on the object name to launch the **Inspector window**.
5. In the Inspector window, locate the **RoomFurniture component**. Expand this component by clicking the **> arrow** located to the left of its name.
info
The RoomFurniture component properties are covered in more detail in our [RoomFurniture component documentation](https://docs.breakroom.tech/run-your-world/the-conferencing-system/voice-zones-and-conference-permissions/the-roomfurniture-component). There you can learn how to enable or disable chat in voice zones, adjust the screen aspect ratio and size, change a breakout area's zone type, and other advanced tricks.
For the purposes of quick Region setup, this page will focus on the following properties:
* **Zone ID**: The ID number of the audio zone associated with the breakout area
* **Zone Name**: The name/room number associated with the audio zone
* **Zone Color**: The color of the breakout area and its corresponding teleport button
There are certain situations where you may want to manually change the values in these property fields.
##### Zone ID[β](#zone-id "Direct link to Zone ID")

If two breakout areas or voice zones are assigned the same Zone ID, users in those areas will be considered to be within the same audio zone, even if they are separated by the entire length of a Region. Such a setup may result in cross-talk and general confusion.
If you encounter a situation like this and want to resolve it, or if you want to renumber your breakout areas and voice zones for more efficient Region management, you can do so by following these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Make sure the[ Objects window ](/creating-custom-experiences/using-the-region-editor.md#the-objects-window)is open by clicking the **Objects button** located on the bottom right.
4. Locate the **Breakroom Breakout Area object** you want to edit in the Objects window, and click on it. This will open the **Inspector window** for that object.
5. Expand the RoomFurniture component in the Inspector window by clicking the **> icon** located to the left.
6. Locate the **Zone ID property**. In the associated field, enter the ID number you wish to use for that breakout area.
7. Click the **Reset Zones button** to reset the conference system.
8. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
info
If you need additional help resolving duplicate zone errors in your Region, please visit our dedicated [troubleshooting page](/running-your-event/customizing-the-conference-system-components/troubleshooting-duplicate-zone-errors.md).
##### Zone Name[β](#zone-name "Direct link to Zone Name")

Each breakout area has a Zone Name in the format of "Breakout N," where *N* is a unique number. This name relays several important pieces of information to the Breakroom conference system. Most importantly, it indicates:
* That the breakout area should be included in the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel)
* How many breakout areas there are, and which number identifies this particular breakout area

*Pictured: An example Breakout Rooms panel.*
There may come times when you need to edit the teleport button lineupβfor instance, if the first breakout area you set down (which automatically became "Breakout 1" and was assigned to the "1" button) has been moved to a far-off area, and you'd rather make it "Breakout 5." Alternatively, you may wish to create a [custom voice zone](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md) and add it to the Breakout Rooms panel.
You can edit the Zone Name by following the steps below.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Make sure the[ Objects window ](/creating-custom-experiences/using-the-region-editor.md#the-objects-window)is open by clicking the **Objects button** located on the bottom right.
4. Locate the **Breakroom Breakout Area object** you want to edit in the Objects window, and click on it. This will open the **Inspector window** for that object.
5. Expand the RoomFurniture component in the Inspector window by clicking the **> icon** located to the left.
6. Locate the **Zone Name property**. In the associated field, enter a new name for the breakout area. This name must be input as "Breakout N," where *N* is the new number.
7. Click the **Reset Zones button** to reset the conference system.
8. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
##### Zone Color[β](#zone-color "Direct link to Zone Color")

When you add a new prefab breakout area to your Region, it will automatically assign itself a unique Zone Color. This color will be applied to the actual breakout area object, and will also be used as the teleport button background color in the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakout-rooms-panel).
If you want to change a breakout area's color, you can do so by following these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Make sure the [Objects window](https://docs.breakroom.tech/customization/using-the-region-editor#the-objects-window) is open by clicking the **Objects button** located on the bottom right.
4. Locate the **Breakroom Breakout Area object** you want to edit in the Objects window, and click on it. This will open the **Inspector window** for that object.
5. Expand the RoomFurniture component in the Inspector window by clicking the **> icon** located to the left.
6. Locate the **Zone Color property**. In the associated field, enter any of the following colors:
1. Blue
2. Orange
3. White
4. Grey
5. Magenta
6. Teal
7. Black
8. Cyan
9. Red
10. Purple
11. Pink
12. Green
13. Yellow
7. Click the **Reset Zones button** to reset the conferencing system.
8. Click the **Save button** to store your changes.
If you want to change the hexadecimal code associated with any of these color keywords, you can find instructions by reviewing our [RoomFurniture component documentation](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-color).
#### Editing breakout area cameras[β](#editing-breakout-area-cameras "Direct link to Editing breakout area cameras")
All of Breakroom's voice zones, including those built into the prefab breakout areas, come equipped with cameras. These cameras integrate with the conference system [gesture and camera controls](/getting-started/using-the-conference-system.md#seats-and-gestures), allowing users to switch between a variety of camera angles while seated.

*Pictured: An avatar seated in an audience seat. Note the Gestures and Camera View panels on the left side of the screen.*
The Behind Camera and Forward Camera are fixed relative to the user. However, the angle and location of the **Speaker Camera**, **Screen Camera**, or **Audience Camera** can be customized to support your individual needs.

In the image above, you can see the location of these cameras highlighted in the [Region Editor](/creating-custom-experiences/using-the-region-editor.md). There are three cameras, each represented by a **3D camera icon** bounded by a translucent box. The box color corresponds to the camera type, and these colors are consistent between all voice zones and breakout areas.
| Box Color | Camera Name | Camera Focus |
| --------- | ----------- | -------------------------------- |
| Orange | Audience | The audience as a whole. |
| Blue | Screen | The presentation screen. |
| Green | Speaker | The presenting speaker's avatar. |

*Highlighted: The static audience camera selected in Region Editor. Notice how the Workshop object has been expanded in the Objects window.*
If you want to change the angle of any of these cameras, you can do so by following the instructions below.
info
Note: In this section, we will refer to the built-in camera that you want to move as the *static camera*, and your own user camera as the *working camera*.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Make sure the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window) is open by clicking the **Objects button** located on the bottom right.
4. Locate the **Breakroom Breakout Area object** you want to edit in the Objects window. Click the **> icon** to the left of the object name to expand it.
5. Locate the **Breakroom Voice Zone object**, and click the **> icon** to the left of the object name to expand it.
6. Locate the **Cameras object**, and click the **> icon** to the left of the object name to expand it.
7. Click on the **static camera** you want to move (either the Screen Camera, Audience Camera, or Speaker Camera). This static camera will be highlighted on your screen, and the [movement gizmo ](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#movement)will center on it.
8. Leaving the static camera object selected, move your working camera into position. *This angle and position will replace the current angle of the selected static camera.*

*Highlighted: The location of the Move Object to Camera button.*
9. Click the **"Move Object to Camera" button** located in the bottom toolbar. The static camera will snap into its new position.
10. Click the **Reset Zones button** to reset the conference system, and click the **Save button** to store your changes.
11. Click the **Close button** to exit the Region Editor. To make sure your UI is refreshed, exit the breakout area or voice zone. When you return to that zone, your new camera angle will now be accessible.
---
### Creating custom voice zones
[YouTube video player](https://www.youtube.com/embed/8yM7qDZTYHE)
#### Overview[β](#overview "Direct link to Overview")
[Voice zones](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md) give users the ability to connect through voice chat, webcam streaming, and screen sharing. Breakroom allows you to nest voice zones within one another, opening up a world of Region design possibilities. Through the use of customized voice zones, you can create a virtual space full of offices, cozy coffee corners, and bustling auditoriumsβall in the same Region, with no audio cross-chatter or audio interference.
Elsewhere, we covered how you can [set up the prefab breakout areas](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md) included in the [Breakroom Toolkit](/creating-custom-experiences/exploring-the-breakroom-toolkit.md). In this section, we'll explore how you can set up custom voice zones.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
After using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) to add or edit a voice zone, always remember to click the **Reset Zones button** to reset the conferencing system. If this doesn't seem to push your changes forward, try saving your work, leaving the Region, and entering it again.
#### Introduction to the voice zone objects[β](#introduction-to-the-voice-zone-objects "Direct link to Introduction to the voice zone objects")
Voice zones take the form of boundary objects that encompass the virtual areas where audio and video sharing will take place. These boundary objects are normally invisible to you and your users. There are different [types of voice zones](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md), each designed to offer a unique media experience.

*Pictured: A Breakroom Conference Region viewed in the Region Editor. Notice how transparent green boundary objects surround the three breakout areas in back.*
When you launch the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) in an area that contains breakout areas or other voice zones, you'll see these boundary objects highlighted in transparent green, as in the image above.

In the Region Editor, there are two specialized tools you'll use while editing voice zones. Clicking the **Reset Zones button** will refresh all of the voice zones within the Region, pushing forward any changes you've made. Clicking the **Visibility button** will toggle the transparent green boundary object highlighting on and off, which is useful when you need to maneuver your working camera inside a voice zone.

*Highlighted: The Breakroom Voice Zone objects in a user's Inventory.*
In addition to the prefab breakout areas included in the [Breakroom Toolkit](/creating-custom-experiences/exploring-the-breakroom-toolkit.md), you will receive two customizable voice zones with no additional building or seat components attached to them. These items are called **Breakroom Voice Zone** and **Breakroom Voice Zone Round**. You can find them in the **Furniture > Collaboration section** of your [Inventory](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
##### Voice zone shapes[β](#voice-zone-shapes "Direct link to Voice zone shapes")
###### Breakroom Voice Zone[β](#breakroom-voice-zone "Direct link to Breakroom Voice Zone")

Here in the [Region Editor](/creating-custom-experiences/using-the-region-editor.md), you can see that we've set out a copy of the **Breakroom Voice Zone object**. This voice zone is shaped like a cube, and the transparent green walls indicate its size and boundaries. It contains other components, such as a screen, cameras, and a landing pad.
###### Breakroom Voice Zone Round[β](#breakroom-voice-zone-round "Direct link to Breakroom Voice Zone Round")

Here we've set out the **Breakroom Voice Zone Round object**, which is shaped like a sphere. Again, the transparent green walls indicate its size and boundaries, and it contains additional components.
##### Voice zone components[β](#voice-zone-components "Direct link to Voice zone components")

In order to fully customize a Breakroom Voice Zone object, you will need to edit its individual components. After you have added a Breakroom Voice Zone object to your Region, follow the steps below to locate these components.
1. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
2. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
3. In the Objects window, locate the **Breakroom Voice Zone object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for "voice zone" if you like.)
4. Click the **> icon** located to the left of the object name to expand it. If necessary, you can expand some individual components by clicking the relevant **> icons**.
In the illustrated tutorial below, we will discuss how these components work together to create a cohesive voice zone and how you can edit them to achieve the level of function you desire. Before we leap into our tutorial example, however, let's start with a brief overview of each voice zone component.
***

*Pictured: The zone collider highlighted in the Objects window. Notice how the movement gizmo is centered within the boundary object.*
1. **The ZoneCollider component**: The zone collider represents the size and boundaries of the voice zone itself. Its [size, location, and rotation](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) can be edited independently of the other components that make up the voice zone object.

*Pictured: The screen component highlighted within the Objects window.*
2. **The screen**: The screen component indicates where the video feed will appear when users opt to share their webcams or screens, as well as the size and location of the screen. Like the zone collider, the screen component can be edited independently of the other voice zone objects.

*Pictured: The landing pad highlighted within the Objects window.*
3. **The landing pad**: This object indicates where avatars will "land" when they teleport directly into the voice zone. It can be edited independently of the other voice zone components, allowing you to place it wherever you like.

*Pictured: All cameras highlighted within the Objects window. Notice how you can expand the Cameras object to select individual cameras.*
4. **The cameras**: Colored boxes indicate the default locations for the screen, audience, and speaker cameras. This information is critical for the correct functioning of the conference system [gesture and camera controls](/getting-started/using-the-conference-system.md#seats-and-gestures), and the [location](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md#editing-breakout-area-cameras) of each camera can be customized.
##### Voice zone furniture items[β](#voice-zone-furniture-items "Direct link to Voice zone furniture items")
In order to take full advantage of the tools built into Breakroom's conference system, you will need to use furniture items that are designed to work with voice zones. There are several sets of [conference-ready furniture](/creating-custom-experiences/exploring-the-breakroom-toolkit/add-on-seats.md) included in the Breakroom Toolkit.
Voice zones do *not* need to contain seating or other furniture in order to function, and if you do not include seating in a custom voice zone, users will still be able to voice chat, turn on their webcams, and share their screens. However, seats let users access additional tools like [gestures](/getting-started/using-the-conference-system.md#seats-and-gestures) and [camera options](/getting-started/using-the-conference-system.md#seats-and-gestures).
#### Setting up a voice zone[β](#setting-up-a-voice-zone "Direct link to Setting up a voice zone")
The following tutorial offers step-by-step instructions for setting up a custom voice zone in your Region. For this example, we will be using a **Breakroom Voice Zone round object** and a set of **Breakroom Add-on Stools** to create a networking area where users can "grab a cup of coffee" and chat.
This section is written for administrative clients who are already familiar with customizing the Breakroom platform. If you need help accessing the [Region Editor,](/creating-custom-experiences/using-the-region-editor.md) [moving objects](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md), or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md#the-roomfurniture-component), please consult the linked documentation before proceeding.
##### Editing voice zone furniture items[β](#editing-voice-zone-furniture-items "Direct link to Editing voice zone furniture items")

*Pictured: The future site of much coffee and networking.*
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Inventory Button** to launch your [Inventory window](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
4. We want our voice zone to contain seating, so as a first step we will set out a conference-ready furniture item and edit it. For this tutorial, we will use the **Breakroom Add-on Stools object**. To find it, use the **search field** at the top of the Inventory window to look for "stools."
5. When you locate the Breakroom Add-on Stools object, set it down in your Region using your [preferred method](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window). Click the **Save button**.

*Pictured: The Breakroom Add-on Stools object, as viewed through the Region Editor.*
Here we encounter our first challenge. There are too many stools in this seating arrangement, and every user who sits down will be facing the same direction. For our next step, we will remove all but six stools from the Breakroom Add-on Stools object, leaving three matched pairs.
6. In the Objects window, click the **> icon** located beside the Breakroom Add-on Stools object to expand it.
7. Click the **> icon** located beside the Seating Arrangements Stools object to expand it.
8. Here you will find the individual stools that make up the linked stools object. To make a stool invisible, click the **eye icon** located to the right of its name. Click the **Save button**.

In the image above, you can see that we have reduced 14 stools to six. However, there's still a major issue.

All six stools are still facing the same way. We need to rotate three of the stools 180Β° so that two users sitting at the same table will face each other.

*Pictured: An individual stool object and its Inspector window.*
9. Locate the first stool you want to edit under **Breakroom Add-on Stools > Seating Arrangements Stools** in the Objects window. Click on the **stool name** to launch the **Inspector window** for that object.
10. In the Inspector window, locate the **Transform component**. Click the **> icon** located to the left to expand it.
11. You will see three properties listed under the Transform component, each with three associated fields. Locate the **Local Euler Angles property**, and **enter "180" into the Y-axis field**.
12. Repeat this set of tasks for every stool you want to "turn around." When you are done, click the **Save button**.

The stools now face each other, so let's place them into position and dress the scene a little.

*Highlighted: The set of six visible stools.*
13. For the sake of convenience, we will move all six stools as a whole. Click on the **Breakroom Add-on Stools object** in the Objects window, and then use the [movement](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#movement) and [rotation tools](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#rotation) to position it in your Region.
14. Our networking area needs some tables and accessories. Click the **Inventory button** to open your Inventory window. When you find an item you like, feel free to add it to your scene. Use the movement, rotation and [scaling tools](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#scaling) to edit each item as you see fit. (Remember: You can use the [Sine Wave Shop](/getting-started/customizing-your-avatar/using-the-sinewave-shop.md) to purchase additional furniture and decor items.)
15. When you are done, click the **Save button**.

Success! We've created a lovely networking area overlooking the water. Now, let's make it a voice zone.
##### Editing voice zone objects[β](#editing-voice-zone-objects "Direct link to Editing voice zone objects")

*Pictured: A Breakroom Voice Zone Round object in the Region Editor.*
In order to accommodate users at different points in their Breakroom tech journey, we will begin this part of the tutorial fresh. If you are interested in learning more about conference-ready voice zone furniture items, please review the [preceding section](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md#editing-voice-zone-furniture-items). If you need a refresher on the different voice zone object components, you can find that information at the [start](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md#voice-zone-components) of this page.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Inventory Button** to launch your [Inventory window](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
4. Locate the Breakroom Voice Zone object you want to use. (For this tutorial, we are using the **Breakroom Voice Zone Round object**.) Add it to your Region using your [preferred method](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
5. The Breakroom Voice Zone Round object will default to its standard size. In the example image above, you can see that there are several issues:
1. The zone collider is too large.
2. The screen is placed in an inconvenient location.
3. The landing pad is right on top of the seating area.

*Pictured: The voice zone, rotated so that the screen component is in a more convenient location.*
6. To begin tackling these issues, select the **top-level Breakroom Voice Zone Round object** in the Objects window. Then, using the Region Editor tools, [move](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#movement) and [rotate](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#rotation) the **entire voice zone** until the **screen component** appears where you want it to be. By moving the entire voice zone as a linked set, you will preserve the existing camera angles.

*Highlighted: The landing component.*
7. Next, we will reposition the landing pad. In the Objects window, click the **> icon** to the left of the Breakroom Voice Zone Round object name to expand it. Then click on the **Landing component** to highlight it.
8. Using the Region Editor tools, move, rotate, and resize the landing pad to meet your specifications.
info
The size of the landing pad indicates the area into which your users will teleport. You can make the landing pad bigger or smaller by highlighting it in the **Objects window** and then changing the local scale values listed under its [Transform component](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#editing-the-transform-component), or by using the [scale tool](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#scaling) in the Region Editor.
9. Finally, we'll customize the size of the voice zone boundary object itself. In the Objects window, click the **> arrow** to the left of the Breakroom Voice Zone Round object name to expand it. Then click on the **ZoneCollider component** to highlight it.
10. Using the Region Editor tools, move, rotate, and resize the zone collider to meet your specifications.
11. Click the **Reset Zones button** to reset the conference system.
12. When you are satisfied, click the **Save button** to store your changes.

*Pictured: The zone collider resized to create a smaller, more contained space for voice chatting.*
#### Special instructions for screens[β](#special-instructions-for-screens "Direct link to Special instructions for screens")

After resizing the voice zone collider, you may find that the default screen size is too large or small for your intended purpose. By editing the ScriptingData component attached to the screen object, you can customize how the screen appears.

*Pictured: The screen highlighted in the Objects window, and its associated ScriptingData component expanded in the Inspector window.*
To locate the ScriptingData component and edit it, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects button** to launch the Objects window. Locate the **Breakroom Voice Zone object**, and click the **> icon** to the left of the object name to expand it. Then click on the **Screen component** to highlight it.
4. In the **Inspector** window that opens, click on the **> icon** to the left of the **ScriptingData component** to expand it. You will see three properties, each with an associated field.
5. *If you want to change the aspect ratio of the screen*, you can enter independent values into the **Width** and **Height fields**. For instance, you may wish to create a narrow, long screen to accommodate the webcams of several different speakers.
6. *If you want to change the size of the screen while preserving the current aspect ratio*, you can enter a value in the **Scale** field, which is normally set at 1. Because this is a multiplier field, you can enter *0.5* to reduce the screen size by half, *2* to double the screen size, etc.
7. Click the **Reset Zones button** to reset the conferencing system.
8. When you are satisfied, click the **Save button** to store your changes.

For this tutorial, we entered a *.75* value into the Scale field. This made the screen smaller overall, while preserving the default aspect ratio. Once we save our work and take a look at the voice zone, you can see that the screen appears at a much more manageable size.
#### Special instructions for cameras[β](#special-instructions-for-cameras "Direct link to Special instructions for cameras")

*Highlighted: The voice zone cameras, as well as the conference system camera panel.*
If you create a custom voice zone that contains [furniture items](/creating-custom-experiences/exploring-the-breakroom-toolkit/add-on-seats.md) designed to work with Breakroom's [conference system cameras](/getting-started/using-the-conference-system.md#seats-and-gestures), you may find that you want to change the camera focus points. (For example, if you move the screen out of range of the Screen Camera.) You can edit the voice zone cameras by using the "Move Object to Camera" button in the Region Editor. Detailed instructions are [available](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md#editing-breakout-area-cameras) in our [Running Your Event section](/running-your-event.md).
#### Special instructions for landing pads[β](#special-instructions-for-landing-pads "Direct link to Special instructions for landing pads")
When installing a Breakroom Voice Zone object, you can choose between *default landing* and *clustered landing* effects for users who teleport straight into the voice zone. You can also randomize the direction your users will face upon arrival.
##### Default landing[β](#default-landing "Direct link to Default landing")
The default landing pattern is automatically enabled upon voice zone installation. Under the default landing pattern, users will arrive at random points within the boundary designated by the landing pad object.
info
To avoid a teleportation bottleneck, make your landing pad object as large as possible.
##### Clustered landing[β](#clustered-landing "Direct link to Clustered landing")
By enabling the *clustered landing* option, you can arrange for users to arrive in *groups* within the zone designated by the landing pad object. This can help foster an atmosphere of socialization and camaraderie.
To enable and manage clustered landing, follow the steps below.

*Highlighted: The location of the landing pad object in the Objects window, as well as the relevant landing pad components in the Inspector window.*
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects button** to launch the Objects window. Locate the **Breakroom Voice Zone object** you want to edit, and click the **> icon** to the left of the object name to expand it. Then click on the **Landing component** to highlight it.
4. In the **Inspector** window that opens, click on the **> icon** to the left of both the **Transform** and **ScriptingData components** to expand them.
At this point, it is useful to explain what a few of these component properties do, as well as some of the math involved in creating clustered landing areas. The key properties to consider are:
* *Transform component > Local Scale.* This property controls the size of the landing pad object. In the example image above, you can see that the object is 6x1x12 meters, or 6x12 along the axes that "count."
* *ScriptingData component > Clustered Landing.* This property controls whether clustered landing is enabled or disabled. If clustered landing is turned off, users will arrive in the [default](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md#default-landing)/randomized landing style.
* *ScriptingData component > Cluster Size.* This property controls the size of the clustered landing areas *within* the landing pad object.
* *ScriptingData component > Random Orientation.* This property controls whether users will arrive in a group facing each other (i.e. oriented toward the center of the cluster), or facing in random directions.
The most important property to consider is the *Cluster Size.* This value must be entered as a number. If you enter the numeral *N*, we might summarize the instructions relayed to the system as "*create as many clustered landing areas of NxN meters as will fit within the scale values of the landing pad object."*
In the example image above, you can see that the landing pad object is 6x12 meters in size. Under the ScriptingData component, you can see that the Cluster Size property has been set to 6. This will result in the creation of two 6x6 meter clustered landing areas within the boundary designated by the landing pad object.
With this explained, let's return to the instructions.
5. Make sure the **landing pad object** is the size you need by changing the [local scale values](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#editing-the-transform-component) listed under its Transform component, or by using the [scale tool](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#scaling) in the Region Editor.
6. Under the **ScriptingData component**, enable or customize the following properties:
1. Random Orientation:
1. If you want users to arrive in a cluster facing each other, enter *no* into the field.
2. If you want users to arrive in a cluster facing in random directions, enter *yes*.
2. Clustered Landing: Enter *yes* into the field.
3. Cluster Size: Enter the size of your clustered landing points into the field (e.g. *3* to create 3x3 clustered landing points).
7. Click the **Reset Zones button** to reset the conferencing system.
8. When you are satisfied, click the **Save button** to store your changes.
##### Random Orientation[β](#random-orientation "Direct link to Random Orientation")
Whether you choose to implement [default landing](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md#default-landing) or [clustered landing](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md#clustered-landing) for your teleport points, you can randomize the direction that your users will face when they arrive. To do so, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects button** to launch the Objects window. Locate the **Breakroom Voice Zone object** you want to edit, and click the **> icon** to the left of the object name to expand it. Then click on the **Landing component** to highlight it.
4. In the **Inspector** window that opens, click on the **> icon** to the left of the **ScriptingData component** to expand it.
5. In the **Random Orientation field**, enter *yes*.
6. Click the **Reset Zones button** to reset the conferencing system.
7. When you are satisfied, click the **Save button** to store your changes.
To return a landing pad to standard orientation, repeat steps 1-4 above and enter *no* into the Random Orientation field. Click the **Reset Zones button**, followed by the **Save button**.
#### Assigning a Zone ID[β](#assigning-a-zone-id "Direct link to Assigning a Zone ID")
In order to identify your custom voice zone as a standalone media point, your custom voice zone needs a unique Zone ID. This number should be automatically assigned when you place the voice zone object down. To change a voice zone's Zone ID, follow these steps.
1. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
2. Make sure the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window) is open by clicking the **Objects button** located on the bottom right.
3. Locate the **Breakroom Voice Zone object** you want to edit in the Objects window, and click on it. This will open the **Inspector window** for that object.
4. Expand the RoomFurniture component in the Inspector window by clicking the **> icon** located to the left.
5. Locate the **Zone ID property**. In the associated field, enter a new ID number for the voice zone.
6. Click the **Reset Zones button** to reset the conferencing system.
7. Click the **Save button** to store your changes.
If you need help resolving duplicate zone errors, please visit our dedicated [troubleshooting page](/running-your-event/customizing-the-conference-system-components/troubleshooting-duplicate-zone-errors.md).
#### Assigning a Zone Name[β](#assigning-a-zone-name "Direct link to Assigning a Zone Name")
It is best practice to assign your custom voice zone a unique Zone Name. To do so, follow these steps.
1. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
2. Make sure the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window) is open by clicking the **Objects button** located on the bottom right.
3. Locate the **Breakroom Voice Zone object** you want to edit in the Objects window, and click on it. This will open the **Inspector window** for that object.
4. Expand the RoomFurniture component in the Inspector window by clicking the **> icon** located to the left.
5. Locate the **Zone Name property**. In the associated field, enter a new name for the voice zone. (Tip: If you want to add the voice zone to the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakout-rooms-panel), you can input the name as "Breakout N," where *N* is a unique number.)
6. Click the **Reset Zones button** to reset the conferencing system.
7. Click the **Save button** to store your changes.
If you need help resolving duplicate zone errors, please visit our dedicated [troubleshooting page](/running-your-event/customizing-the-conference-system-components/troubleshooting-duplicate-zone-errors.md).
#### Adding voice zones to navigation tools[β](#adding-voice-zones-to-navigation-tools "Direct link to Adding voice zones to navigation tools")

*Pictured: The Areas of Interest panel.*
When you add a custom voice zone to your Region, you may see it appear in the Areas of Interest panel. This panel is visible on the right side of the screen when activated, and can be set up to offer direct teleport links to any voice zone that has the "Zone Visible" option enabled in its [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-visible).
*Zones already linked in the General Navigation or Breakout Rooms panel will be ignored by the Areas of Interest panel.* This makes it a flexible solution for offering additional teleport options to your users.
You can [enable, disable, or rename individual links](/advanced-tutorials/uploading-your-own-region/installing-the-conference-system-components.md#the-areas-of-interest-panel) within the Areas of Interest panel. If you disable all of your custom voice zones from appearing within the Areas of Interest panel, the panel will not be displayed on your screen. You can also add a custom voice zone to the [Breakout Rooms panel](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md).
##### Enabling auto-sit on teleport[β](#enabling-auto-sit-on-teleport "Direct link to Enabling auto-sit on teleport")
If you set up your custom voice zone using furniture designed to work with the Breakroom conference system, you can enable the auto-sit feature. This means that when users teleport into the voice zone, they will be automatically seated in an available chair.
To enable the auto-sit feature, please follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window). Locate the **furniture item** you want to edit. Click on the object name to launch the **Inspector window**.
4. In the Inspector window, click on the **> icon** to the left of the **RoomFurniture component** to expand it.
5. You will see a single property titled **Zone Name**. In this field, *enter the same exact Zone Name you used for the associated Breakroom Voice Zone object.* (For example, if your voice zone is named "Coffee Bar," then the Zone Name for the stools should also be "Coffee Bar.")
6. Click the **Reset Zones button** to reset the conferencing system.
7. Click the **Save button** to store your changes.
#### The RoomFurniture component[β](#the-roomfurniture-component "Direct link to The RoomFurniture component")
The **RoomFurniture component** attached to the Breakroom Voice Zone objects contains several fields that can be manually edited. By doing so, you can:
* Change the voice zone type
* Disable or enable voice and text chat
* Adjust the voice zone's spatial settings
* Edit voice zone priority and "nest" voice zones
* Enable or disable audience cameras, and more
These are advanced settings that Region designers can use to create wholly customized points of interactivity. Please see our [RoomFurniture component documentation](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md) for more information.
---
### Designating triage zones
#### Overview[β](#overview "Direct link to Overview")

*Pictured: The Start Here UI.*
Breakroom offers World Owners and their users a variety of support resources, including:
* [Built-in device and networking testing](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md)
* [Device](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md#basic-troubleshooting-tips), [World Stream](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-chrome.md) and [network](/help/troubleshooting-network-ports-and-firewalls.md) troubleshooting guides
* [New user guides](/getting-started.md)
However, for large events you may want to designate a *triage zone* where attendees can access immediate technical assistance. By specifying a triage zone in the Start Here UI, you will add a button that attendees can click to teleport directly to your support area. Moderators can also send attendees to the triage area using the teleportation options built into the [moderator tools](/running-your-event/moderator-tools/crowd-management.md).
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
After using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) to add or edit a voice zone, always remember to click the **Reset Zones button** to reset the conferencing system. If this doesn't seem to push your changes forward, try saving your work, leaving the Region, and entering it again.
#### Assistance options [](#assistance-options)[β](#assistance-options- "Direct link to assistance-options-")
It is important to note that triage zones are quick-teleport destinations available through the Start Here UI. They have no special functionality. Instead, you will need to make key decisions about the way you use your triage area based on the needs of your audience.
If you have a large team, you may want to train several "triage leaders" who will actively staff the triage zone for the duration of your event. Triage leaders could be trained to:
* Identify struggling users and [reach out to them](/running-your-event/moderator-tools/broadcast-messages.md) using the moderator tools
* Use the moderator tools to [move users](/running-your-event/moderator-tools/crowd-management.md) to the triage zone
* Communicate with users via [text](/getting-started/communicating-with-other-users.md#text-chat) and [voice chat](/getting-started/communicating-with-other-users.md#voice-chat)
* Troubleshoot any issues that are preventing users from participating in the event
If you have a small team, you may opt to offer passive assistance with or without a limited triage leader presence. This might look like:
* Graphic guides posted on [Breakroom Image Viewers](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-image-viewer.md), with or without built-in links
* Tutorial or troubleshooting videos accessible through [Breakroom Video Players](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-video-player.md), with or without built-in links
* Interactive website assistance offered through [Breakroom Web Browsers](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-web-browser.md)
#### Designating your triage zone[β](#designating-your-triage-zone "Direct link to Designating your triage zone")

After setting up a [breakout area](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md) or [custom voice zone](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md), you can specify it as a triage zone by following the steps below.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Start Here UI object**. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Click on the object name to launch the **Inspector window**.
5. In the Inspector window, locate the **RoomFurniture component** (highlighted above). Expand it by clicking the **> arrow**.
6. Locate the **Triage Zone field**. Into this field, enter the **name** of the zone you want to designate as the triage zone. (In the example above, we have named a custom voice zone *Triage Zone*, as highlighted in the Objects window.)
7. Click the **Save button** to store your changes. Click the **Reset Zones button** to reset the conferencing system.
8. Click the **Close button** to exit the Region Editor. Leave the Region and return to activate the Get Help button in the Start Here UI.
---
### Setting up Presenter and Audience zones
#### Overview [](#overview)[β](#overview- "Direct link to overview-")

*Pictured: Here a keynote speaker is standing in one of the presenter seats in a Presenter zone, and is able to share her screen.*
Breakroom allows you to customize your Regions with a variety of [*voice zone types*](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md), each with its own set of rules governing what kinds of media can be shared and by whom. Among these, Presenter and Audience zone types are unique, as both make use of special *presenter seats*.
By positioning their avatars in these seats, presenters can gain access to voice chat and media sharing functions within a particular voice zone, even if these functions are otherwise restricted. Users with access to the Breakroom [moderator tools](/running-your-event/moderator-tools.md) (hereafter referred to collectively as *Moderators*) can also grant access to voice chat or media sharing functions as needed.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
After using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) to add or edit a voice zone, always remember to click the **Reset Zones button** to reset the conferencing system. If this doesn't seem to push your changes forward, try saving your work, leaving the Region, and entering it again.
#### Using Presenter and Audience zones[β](#using-presenter-and-audience-zones "Direct link to Using Presenter and Audience zones")

*Pictured: An example of how a Presenter or Audience zone might appear, with five presenter seats set up on a stage.*
Presenter seats are represented by the usual blue seat tag. Depending on which [Region template](/building-new-worlds/region-template-descriptions.md) or [breakout area](/creating-custom-experiences/exploring-the-breakroom-toolkit/conference-rooms-and-booths.md) is being utilized, you may see these tags arranged on a stage, set in front of a main screen, or otherwise located in the logical spot for a presenter to occupy.
To take up a presenter spot, simply click on a blue **presenter seat tag**. This will position your avatar and give you access to voice chat and media streaming options. To leave the presenter seat, click the **Stand Up button** at the bottom of the screen.
##### Presenter and Audience zone functionality [](#presenter-and-audience-zone-functionality)[β](#presenter-and-audience-zone-functionality- "Direct link to presenter-and-audience-zone-functionality-")
Presenter and Audience voice zones are similar, in that both restrict media access to certain users. For reference, here is a comparison of the default settings for Presenter and Audience zones.
| Zone type | Voice chat | Media share (webcam, etc.) |
| --------- | --------------- | -------------------------- |
| Presenter | All users | Presenters only |
| Audience | Presenters only | Presenters only |
In the following sections, we will explain how presenters can access the media sharing functions they need, and how Moderators can enable or disable media streaming. Instructions are also provided so that [World Owners](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner) and other users with access to the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) can customize the number of available presenter seats in a given voice zone, or place limitations on who can use those presenter seats.
#### Setting up Presenter and Audience zones [](#setting-up-presenter-and-audience-zones)[β](#setting-up-presenter-and-audience-zones- "Direct link to setting-up-presenter-and-audience-zones-")
You can customize Presenter and Audience zones by adding or removing presenter seats. You can also set limitations on who can use those seats. The following tutorials offer step-by-step instructions for specific use cases, but the same general principles can be used to create many different presenter configurations.
##### Adding presenter seats[β](#adding-presenter-seats "Direct link to Adding presenter seats")

*Pictured: An example of the default Breakroom Helpdesk setup.*
For our first tutorial example, we'll add some additional presenter seats to a [Breakroom Helpdesk](/creating-custom-experiences/exploring-the-breakroom-toolkit/conference-rooms-and-booths.md#breakroom-helpdesk). We will assume that the Breakroom Helpdesk object is already installed in a Region, along with its single presenter seat.
The [Breakroom Toolkit](/creating-custom-experiences/exploring-the-breakroom-toolkit.md) includes a variety of [presenter seat objects](/creating-custom-experiences/exploring-the-breakroom-toolkit/add-on-seats.md) that you can add to any Presenter or Audience zone. Our goal is to place one additional standing presenter seat on either side of the desk to accommodate event staff.
To get started, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Inventory Button** to launch the [Inventory window](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
4. Locate the **Breakroom Addon Presenters object**. This object consists of nine standing presenter seats. To find it, use the **search field** at the top of the Inventory window to look for "presenters."
5. When you find the Breakroom Addon Presenters object, set it down in your Region using your [preferred method](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window). Click the **Save button**.

*Pictured: The Breakroom Addon Presenters object added to a Region, with its contents expanded in the Objects window.*
Here we encounter our first challenge. There are too many standing presenter seats for our purposes. For our next step, we will make all but two seats invisible.
6. In the Objects window, click the **> arrow** located beside the Breakroom Addon Presenters object to expand it.
7. Click the **> arrow** located beside the Presenter Sits object to expand it.
8. Here you will find the nine individual seats that make up the linked presenter seats object. To make a seat invisible, click the **eye icon** located to the right of its name. Repeat this step for every seat you want to make invisible. Click the **Save button**.

*Pictured: Nine standing presenter seat tags reduced to two.*
Now we need to move the seat tags into position by placing one on either side of the desk.
9. Locate the first seat you want to edit under Breakroom Addon Presenters > Presenter Sits in the Objects window. Click on the **seat name** to highlight that individual seat.
10. Use the [movement](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#movement) and [rotation](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#rotation) tools to position the seat tag in your Region. You can also key position values into the tag's [Transform component](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#editing-the-transform-component).
11. Once you have the first seat tag in position, repeat this process for the remaining seat. Click the **Save button**.

Finally, we need to connect the new presenter seats to the Breakroom Helpdesk voice zone.
12. Click the **Objects button** to launch the Objects window. Locate the **Breakroom Addon Presenters object**. Click on the object name to launch the **Inspector window**.
13. In the Inspector window, click on the **> arrow** to the left of the **RoomFurniture component** to expand it.
14. You will see a property titled **Zone Name**. In this field, *enter the Zone Name you want to attach the presenter seats to.* (For example, my Helpdesk voice zone is named "Entrance," so I would type in "Entrance.")
15. Click the **Reset Zones button** to reset the conference system.
16. Click the **Save button** to store your changes, and the **Close button** to exit the Region Editor.
warning
You can add as many presenter seats as you like to a voice zone. However, it is important to note that Breakroom's media streaming system cannot accommodate more than 17 simultaneous webcam or screen share users.
##### Removing presenter seats[β](#removing-presenter-seats "Direct link to Removing presenter seats")
To remove presenter seats from a voice zone (for example, if you want two presenter spots instead of nine), you would follow the same instructions included in the example tutorial above.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. In the Objects window, click the **> arrow** located beside the Breakroom Addon Presenters object to expand it.
4. Click the **> arrow** located beside the Presenter Sits object to expand it.
5. Here you will find the individual seats that make up the linked presenter seats object. To make a seat invisible, click the **eye icon** located to the right of its name. Repeat this step for every seat you want to make invisible.
6. Click the **Reset Zones button** to reset the conference system.
7. Click the **Save button** to store your changes, and the **Close button** to exit the Region Editor.
warning
The Presenter and Audience zones seats that come preconfigured in Breakroom's Region templates cannot be edited, as they are uploaded with the Region as a whole. We apologize for the inconvenience.
##### Restricting presenter seat access[β](#restricting-presenter-seat-access "Direct link to Restricting presenter seat access")

*Pictured: An individual presenter seat being isolated and edited in the Region Editor.*
It is possible to prevent unauthorized users from jumping on empty presenter seats by restricting access to VIPs or staff members only. To get started, follow these steps.
1. Log in to your Breakroom world and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. In the Objects window, click the **> arrow** located beside the Breakroom Addon Presenters object to expand it.
4. Click the **> arrow** located beside the Presenter Sits object to expand it.
5. Here you will find the individual seats that make up the linked presenter seats object. To edit a seat, **click on it** in the Objects window. Doing so will launch the **Inspector window** for that seat.
6. In the Inspector window, locate the **ScriptingData component**. Click the **> arrow** on the left to expand it.
7. Here you will see three properties and their associated fields. We are concerned only with the **VIP** and **Staff fields**. *The Reserved field should not be edited.*
1. VIP field: To restrict presenter seat access to [Region VIPs](https://docs.breakroom.tech/open-the-doors/managing-access-to-your-world/region-level-user-permissions) and above, as well as [world-level Administrators](https://docs.breakroom.tech/open-the-doors/managing-access-to-your-world/world-level-user-permissions) and above, type *yes* into this field.
2. Staff field: To restrict presenter seat access to [Region Moderators](https://docs.breakroom.tech/open-the-doors/managing-access-to-your-world/region-level-user-permissions) and above, as well as [world-level Administrators](https://docs.breakroom.tech/open-the-doors/managing-access-to-your-world/world-level-user-permissions) and above, type *yes* into this field.
8. Repeat these steps for every seat you want to restrict. When you are satisfied, click the **Reset Zones button** to reset the conference system.
9. Click the **Save button** to store your changes, and the **Close button** to exit the Region Editor.
warning
The Presenter and Audience zones seats that come preconfigured in Breakroom's Region templates cannot be edited, as they are uploaded with the Region as a whole. We apologize for the inconvenience.
#### Controlling audience voice chat and media access[β](#controlling-audience-voice-chat-and-media-access "Direct link to Controlling audience voice chat and media access")

*Pictured: The Crowd management panel.*
Using the [Crowd management panel](/running-your-event/moderator-tools/crowd-management.md), Moderators can permit or restrict access to voice chat, webcam streaming, and screen sharing in Presenter and Audience zones.
To locate this panel, click the **Moderator controls/Key button** located on the right side of the screen, and then the **Crowd management button**. In order to moderate Presenter and Audience zones, you will use the buttons under the **Zone Settings section**.
In detail, the available zone settings are:
* **Quiet Mode**: When turned on, Quiet Mode will mute every user who is not currently seated on a [presenter seat](/running-your-event/customizing-the-conference-system-components/setting-up-presenter-and-audience-zones.md#using-presenter-and-audience-zones).
* **Audience Mode**: When turned on, Audience Mode grants users access to *all enabled* communication options in that voice zone (e.g., voice chat, webcam, and screen share). Audience Mode overrides Quiet Mode, if Quiet Mode is also turned on.
* **Admin Mode**: When turned on, Admin Mode permits Moderators to access *all enabled* communication options in that voice zone (e.g., voice chat, webcam, and screen share). Admin Mode overrides Quiet Mode.
To customize a voice zone's communication settings, follow the steps below.
1. Navigate your avatar to the appropriate Region.
2. Position your avatar inside the voice zone that you want to customize.
3. Click the **Moderator tools/Key button** located on the right side of the screen.
4. Click the **Crowd management button**. In the **Crowd Management panel** that appears, locate the **Zone Settings section**.
5. Click the relevant buttons to customize the voice zone.
1. If a button says **Quiet/Audience/Admin is On**, then that communication setting is currently *enabled*. Click the button again to disable it.
2. If the button says **Quiet/Audience/Admin is Off**, then that communication setting is currently *disabled*. Click the button again to enable it.
6. Repeat this process for every voice zone you want to customize.
The most common change Moderators will make is to toggle Quiet Mode on or off in Presenter zones. This will enable the audience to use voice chatβfor example, during a Q\&A session.
---
### The RoomFurniture component
[YouTube video player](https://www.youtube.com/embed/hPiwHQUT7RE)
#### Overview[β](#overview "Direct link to Overview")
When you select a prefab [breakout area](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md) or [voice zone](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md) object in Breakroom's [Region Editor](/creating-custom-experiences/using-the-region-editor.md), you'll see a number of *components* listed in the Inspector window for that object.

*Pictured: An example Inspector window, with three components listed for the selected object.*
These components contain properties that can be edited to customize various object factors and behaviors. For example, the *Transform component* contains information about a virtual object's position and size. You can [edit](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md#editing-the-transform-component) these properties manually by entering new values into the fields.
When it comes to editing and customizing prefab breakout areas and voice zones, the **RoomFurniture component** is of key importance. In the sections that follow, we'll explore the various object factors that the RoomFurniture component controls.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
After using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) to add or edit a voice zone, always remember to click the **Reset Zones button** to reset the conferencing system. If this doesn't seem to push your changes forward, try saving your work, leaving the Region, and entering it again.
#### Accessing the RoomFurniture component[β](#accessing-the-roomfurniture-component "Direct link to Accessing the RoomFurniture component")

*Pictured: The RoomFurniture component, expanded to display all 15 fields.*
After you add a Breakroom Breakout Area or Breakroom Voice Zone object to your Region, follow the steps below to locate the RoomFurniture component and view its properties.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Breakroom Breakout Area** or **Breakroom Voice Zone object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Click on the object name to launch the **Inspector window**.
5. In the Inspector window, locate the **RoomFurniture component**. Expand this component by clicking the **> arrow** located to the left of its name.
In the sections that follow, we'll explain the functions each property controls and discuss ways to customize your Breakroom Region setup.
#### Zone ID[β](#zone-id "Direct link to Zone ID")
When you add a new Breakroom Breakout Area or Breakroom Voice Zone object to your Region, it will be automatically assigned a unique **Zone ID**. This number identifies the zone as a self-contained media point.
To change the Zone ID:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone ID field**, enter the ID number you want to use.
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
info
Grouping certain types of Zone IDs together can help with project organization. For example, important zones such as a help desk and an auditorium could be identified as Zones 1 and 2 respectively, while breakout rooms could be identified from Zone 10 upwards.
##### β IMPORTANT NOTE ABOUT ZONE IDS β[β](#-important-note-about-zone-ids- "Direct link to β IMPORTANT NOTE ABOUT ZONE IDS β")
If two breakout areas or voice zones are assigned the same Zone ID, users in those areas will be considered to be within the same voice zone, even if they are separated by the entire length of a Region. This may be just the trick you need to create points of interest and interaction for your usersβ or it could result in cross-chatter and confusion.

**If you are experiencing issues with voice zones, always check your Zone IDs.** If you do have duplicate Zone IDs within a Region, the warning pictured above will appear in the Region Editor. Please see our page on [troubleshooting duplicate zone errors](/running-your-event/customizing-the-conference-system-components/troubleshooting-duplicate-zone-errors.md) for more information.
#### Zone Name[β](#zone-name "Direct link to Zone Name")
When you add a new Breakroom Breakout Area or Breakroom Voice Zone object to your Region, it is automatically assigned a **Zone Name**. In the case of prefab [breakout areas](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md), this name will take the form of "Breakout N," where *N* is a unique number. This naming convention ensures that the breakout area is added to the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel). In the case of [custom voice zones](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md), the zone name will default to "Workshop."
You can rename a breakout area or voice zone at any time. Uses for this may include:
* Fixing issues caused by redundant prefab breakout area names, or manually reordering breakout areas
* Designating a custom voice zone as a breakout area by changing its name to "Breakout N" (where *N* is a unique number). This will add it to the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel) and the [moderator tools](/running-your-event/moderator-tools/crowd-management.md)
* Linking a breakout area or custom voice zone to the [General Navigation panel](/getting-started/using-the-conference-system.md#the-general-navigation-panel) or [Areas of Interest panel](/getting-started/using-the-conference-system.md#the-areas-of-interest-panel) when [installing the conference system](/advanced-tutorials/uploading-your-own-region/installing-the-conference-system-components.md) in a bespoke Region
To change the Zone Name:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Name field**, enter the name you want to use.
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes.
#### Zone Type[β](#zone-type "Direct link to Zone Type")
As explained in our documentation concerning [voice zones and conference permissions](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md), there are five types of voice zones available for use in Breakroom. To review, these are:
* **Presenter:** Presenter zones restrict the use of screen and webcam sharing to *only* users in a designated presenter seat. Voice chat is available to everyone.
* **Audience:** Audience zones go a step further than Presenter zones, restricting voice chat and media sharing to *only* users in a designated presenter seat.
* **Meeting:** In Meeting zones, voice chat and media sharing are enabled for all users.
* **Voice:** Within Voice zones, only [voice chat](/getting-started/using-the-conference-system.md#voice-chat) will work.
* **Silent:** In Silent zones, voice chat and media sharing are disabled for all users.
You can change a breakout area or voice zone's Zone Type at any time by following these steps.
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Type field**, enter the type (presenter, audience, meeting, voice, silent) you want to use.
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes.
#### Zone Voice[β](#zone-voice "Direct link to Zone Voice")
The Zone Voice property controls whether voice chat is enabled in a particular breakout area or voice zone.
To enable or disable voice chat:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Voice field**, enter the word *yes* or *no.*
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
warning
Disabling the Zone Voice property may not disable voice chat entirely. For instance, a user standing in a breakout area with Zone Voice deactivated will still be able to hear and participate in chat from the *surrounding* voice zone (e.g. the [Global voice zone](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md#voice-zone-types)), as nested voice zones can impact one another.
However, this property is useful in certain cases. For example, you may want to create a custom voice zone where users can share their screens while they participate in Global chat.
#### Zone Spatial[β](#zone-spatial "Direct link to Zone Spatial")
The **Zone Spatial** property controls the [spatial audio effect](/running-your-event/understanding-the-conference-system/voice-chat-and-spatial-audio.md) that users will experience when standing in a breakout area or voice zone. When spatial audio is enabled, voice zones behave much like you would expect in the "real world"βother avatars (or people) standing nearby will be easy to hear, while avatars standing at a distance may be more difficult to hear, if you can hear them at all.
By entering *0* in the Zone Spatial field, you can turn off spatial audio entirely. This means that everyone in the voice zone will be heard at the same volume, with no spatial audio effect.
If you enter a *1* or above in the Zone Spatial field, you will enable spatial audio. The number represents the number of meters surrounding each avatar wherein their voice feed can be heard by others. *1* equals one meter, *5* equals five meters, etc.
To edit the Zone Spatial property:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Spatial field**, enter either a *0* or the number of meters you prefer.
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
#### Zone Chat[β](#zone-chat "Direct link to Zone Chat")
The Zone Chat property controls whether a dedicated, zone-specific text channel is available to users.
To enable or disable text chat:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Chat field**, enter the word *yes* or *no.*
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
warning
Turning Zone Chat off will not disable text chat as a whole for end users. It will simply remove the option of having a dedicated text chat within the specified voice zone. If you want to disable text chat across the whole of your Breakroom World by [customizing the UI](/creating-custom-experiences/ui-customization-options.md), please see our [Creating Custom Experiences section](/creating-custom-experiences.md).
#### Auto Configure[β](#auto-configure "Direct link to Auto Configure")
This field is for internal Breakroom use. You will not need to manually edit it.
#### Zone Priority[β](#zone-priority "Direct link to Zone Priority")

*PIctured: An example of two nested voice zones in the Region Editor, with the smaller one highlighted.*
The **Zone Priority** property can be used to create "nested" voice zones, or voice zones located inside other voice zones. In the image above you will see multiple voice zones, some of which are overlapping:
* The cozy chat area (highlighted), located in its own cube-shaped voice zone
* The concourse end (center), located in a spherical voice zone
* The auditorium (back), with its own associated voice zone
* The Global voice zone (not highlighted), which covers the entirety of the Region
Let us consider the voice zones represented by the cube and the sphere, specifically. By setting the large spherical voice zone as *Priority 2* and the cube as *Priority 3*, we can specify that users seated within the cozy chat area should only participate in audio or video chat with each other, even though their avatars are technically *also* located inside the sphere... which is located inside the Global voice zone.
Creating nested voice zones may appear to be a simple matter stacking voice zones on top of one another. However, doing so may not achieve the effect you wantβwhat matters is the Zone Priority number each voice zone has been assigned. The Global voice zone is always *Priority 1*; the higher the number, the higher the zone priority.
To edit an area's Zone Priority:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Priority field**, enter the priority number you want to assign to the voice zone.
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
#### Zone Color[β](#zone-color "Direct link to Zone Color")
When you add a new Breakroom Breakout Area to your Region, it will automatically assign itself a unique **Zone Color**. This color will be applied to the actual breakout space, and will also be used as the teleport button background color in the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel).
To change the Zone Color:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Color field**, enter one of the following color keywords:
1. Blue
2. Orange
3. White
4. Grey
5. Magenta
6. Teal
7. Black
8. Cyan
9. Red
10. Purple
11. Pink
12. Green
13. Yellow
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes.
##### Changing the Zone Color presets[β](#changing-the-zone-color-presets "Direct link to Changing the Zone Color presets")

*Highlighted: The location of the Colors component.*
If you like, you can change the hexadecimal presets for each of the color keywords listed above. To do so, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Breakroom Breakout Area** or **Breakroom Voice Zone object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Expand that object by clicking the **> arrow** located to the left of the object name.
5. Locate the **Colors** component and click on it. This will launch the **Inspector window**.

7. In the Inspector window, expand the **ScriptingData component** by clicking the **> arrow** next to its name.
8. Enter the [hexadecimal color codes](https://www.w3schools.com/colors/colors_picker.asp) you would like to assign to each keyword.
9. Click the **Reset Zones button** to reset the conferencing system.
10. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
info
Color keywords can only be edited on a per-object basis. They cannot be changed on a global basis.
#### Zone Camera Default[β](#zone-camera-default "Direct link to Zone Camera Default")
By editing the **Zone Camera Default** property, you can change which camera angle users see when they first sit down in a breakout area or voice zone. Camera options include:
* Behind
* Forward
* Speaker
* Screen
* Audience
* Free
To change the default camera:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Camera Default field**, enter the name of the camera you would like to use (behind, forward, speaker, screen, audience, or free).
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
#### Zone Camera List[β](#zone-camera-list "Direct link to Zone Camera List")
By editing the **Zone Camera List**, you can change which camera angles users will be able to access through the [gesture and camera panel](/getting-started/using-the-conference-system.md#seats-and-gestures). Camera options include:
* Behind
* Forward
* Speaker
* Screen
* Audience
* Free
By default, the Zone Camera List is blank, indicating that users have access to all of the cameras listed above. If you enter one or more specific camera names, users will be restricted to only those choices.
To edit the Zone Camera List:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Camera List field**, enter the camera names you want to make available, separated by commas. For example:
```text
Behind,Speaker
```
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
#### Zone Visible[β](#zone-visible "Direct link to Zone Visible")
The **Zone Visible** property controls whether a breakout area or custom voice zone appears in any navigation tools. This includes the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel) and the [Areas of Interest panel](/getting-started/using-the-conference-system.md#the-areas-of-interest-panel).
To add or remove a breakout area or custom voice zone from Region navigation tools:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Zone Visible field**, enter the word *yes* or *no.*
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
#### Screen options (Width, Height, Scale)[β](#screen-options-width-height-scale "Direct link to Screen options (Width, Height, Scale)")
The **Width**, **Height**, and **Scale properties** can be used to change the aspect ratio or size of the screen used to display user-driven media inside a breakout area or voice zone. By manually editing the Width and Height fields, you can create custom aspect ratios.
You can also edit the final display size of the screen overall by changing the number in the Scale field. The value in this field is a multiplier with a default of 1, so you might enter *.5* to create a screen half the size, or *2* to create a screen double the size. Our [custom voice zone](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md) walkthrough contains an illustrated example of how you might edit this field.
As a brief overview, to edit a voice zone screen's aspect ratio or size:
1. Follow the [steps above](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#accessing-the-roomfurniture-component) to access the RoomFurniture component.
2. In the **Width, Height, or Scale fields**, enter the value(s) you prefer.
3. Click the **Reset Zones button** to reset the conferencing system.
4. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
---
### Troubleshooting duplicate zone errors
#### Overview[β](#overview "Direct link to Overview")
The prefab [breakout areas](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md) and [voice zone](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md) objects included with your Breakroom subscription are designed to set themselves up automatically. When added to a Region, each object should assign itself a unique Zone ID and Zone Name. However, occasionally you may run into situations where two or more voice zones are assigned the same information.

*Pictured: An example Duplicate Zone Name warning, with beacons turned on.*
In these situations, the Region Editor will display a warning panel in the lower middle portion of the screen. Depending on the type of information that has been duplicated, you may see a *Duplicate Zone ID warning*, a *Duplicate Zone Name warning*, or both.
Clicking on either warning will trigger beacons designed to help you locate the conflicting voice zones. You can then make any necessary changes.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
After using the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) to add or edit a voice zone, always remember to click the **Reset Zones button** to reset the conferencing system. If this doesn't seem to push your changes forward, try saving your work, leaving the Region, and entering it again.
#### Fixing duplicate Zone IDs[β](#fixing-duplicate-zone-ids "Direct link to Fixing duplicate Zone IDs")

If the Region Editor displays a *Duplicate Zone ID warning*, it means that two or more breakout areas or voice zones are assigned the same Zone ID. You can learn more about [Zone IDs](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-id) in our [RoomFurniture component documentation](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md), but the key things to remember are:
* A Zone ID identifies the breakout area or voice zone as a self-contained media point.
* If two voice zones are assigned the same Zone ID, then users located in those two zones can hear one another over voice chat, see each other over webcam, etc., even if the voice zones are located a good distance from each other. This may result in cross-chatter and confusion.
To change a breakout area or voice zone's Zone ID, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Breakroom Breakout Area** or **Breakroom Voice Zone object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Click on the object name to launch the **Inspector window.**
5. In the Inspector window, locate the **RoomFurniture component**. Expand this component by clicking the **> arrow** located to the left of its name.
6. In the **Zone ID field**, enter the ID number you want to use.
7. Click the **Reset Zones button** to reset the conferencing system.
8. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
info
Remember: Clicking on the Duplicate Zone ID warning will trigger highlight beacons over both duplicate zones.
#### Fixing duplicate Zone Names[β](#fixing-duplicate-zone-names "Direct link to Fixing duplicate Zone Names")

If the Region Editor displays a Duplicate Zone Name warning, it means that two or more breakout areas or voice zones are assigned the same [Zone Name](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-name). Zone Names mainly serve to identify or label destinations that will appear in the [Breakout Rooms panel](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel) and the [Areas of Interest panel](/getting-started/using-the-conference-system.md#the-areas-of-interest-panel).
To change a breakout area or voice zone's Zone Name, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Breakroom Breakout Area** or **Breakroom Voice Zone object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Click on the object name to launch the **Inspector window.**
5. In the Inspector window, locate the **RoomFurniture component**. Expand this component by clicking the **> arrow** located to the left of its name.
6. In the **Zone name field**, enter the name you want to use.
7. Click the **Reset Zones button** to reset the conferencing system.
8. Click the **Save button** to store your changes. Click the **Close button** to exit the Region Editor.
info
Remember: Clicking on the Duplicate Zone Name warning will trigger highlight beacons over both duplicate zones.
---
### Moderator tools
#### Overview [](#overview)[β](#overview- "Direct link to overview-")
Breakroom's moderator tools offer event coordinators a virtual leg-up when it comes to attendee support and logistics. By accessing a single menu, you can message users as a whole or individually, teleport users to different locations within a Region, and field questions from audience members. You can also stream music and video to create a unique multimedia experience.
#### Accessing the moderator controls [](#accessing-the-moderator-controls)[β](#accessing-the-moderator-controls- "Direct link to accessing-the-moderator-controls-")
##### Moderator tool permissions [](#moderator-control-permissions)[β](#moderator-tool-permissions- "Direct link to moderator-tool-permissions-")
Key event coordinators and stakeholders will have access to the moderator tools by default. This list includes:
* The [World Owner](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md#owner)
* [World-level](/opening-the-doors/creating-and-managing-user-accounts/world-level-user-permissions.md) Administrators, Moderators, and Developers
* [Region-level](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md) Owners, Administrators, and Moderators
This section of the documentation refers to these individuals collectively as "Moderators."
##### Launching the moderator tools[β](#launching-the-moderator-tools "Direct link to Launching the moderator tools")

*Highlighted: The expanded moderator tools, with an arrow pointing to the **Maximize button**.*
To launch the moderator tools, click the **Moderator tools/Key button** located on the right side of the screen. To further expand the moderator tools menu, click the **Maximize button** located at the bottom.

*Pictured: The fully expanded moderator tools.*
Here's a brief overview of the moderator tools UI, with links to relevant information.
| Button | Purpose | |
| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - |
| Close button | Closes the menu. | |
| [Breakroom Training Instructor Mode button](../../getting-started/using-breakroom-for-training#as-an-instructor) | Allows Moderators to act as an Instructor on the Breakroom for Training system. | |
| [Broadcast messages button](broadcast-messages) | Allows Moderators to send messages to one or more attendees in the Region. | |
| [Crowd management button](crowd-management) | Allows Moderators to teleport one or more users around the Region, and to control access to [voice chat](../../getting-started/using-the-conference-system/#voice-chat). | |
| [Audience questions button](audience-questions) | Allows Moderators to review audience questions [submitted](../../getting-started/using-the-conference-system/#submitting-questions) through the conference system. | |
| Raised hands button | Allows Moderators to identify users who have their [hands raised](../../getting-started/using-the-conference-system/#raise-hand-and-emoji-buttons). | |
| [Presentation controls button](presentation-controls) | Allows Moderators to control signage and videos for presentations. | |
| Support requests button | Allows Moderators to address submitted support requests. (Note: This feature is currently unavailable.) | |
| [Hidden UI button](hidden-ui-toggle) | Allows Moderators to reveal UI elements that are hidden from most users. | |
| [Participation button](participation) | Allows Moderators to post a participation system URL for use in the Region, such as Slido. | |
| [Audio stream button](audio-streams) | Allows Moderators to switch the Region audio stream. | |
| Minimize button | Minimizes the expanded menu. | |
We'll explore the moderator tools in more detail in the sections that follow.
danger
The **Moderator tools/Key button** is normally visible only to the user types listed [above](/running-your-event/moderator-tools.md#moderator-control-permissions). However, other users may see this button if you have enabled a password on the moderator tools to make them more broadly accessible. If you would like to enable a password as part of your event security or logistics plan, please contact our [Customer Success Team](/help/where-to-find-support.md) for more information.
---
### Audience questions
[YouTube video player](https://www.youtube.com/embed/SwNBkdxkzKE?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview [](#audience-questions-overview)[β](#overview- "Direct link to overview-")

*Highlighted: The location of the Audience questions button.*
Breakroom's conference system allows users to [direct questions](/getting-started/using-the-conference-system.md#submitting-questions) to your event management team. This functionality can be used to facilitate question-and-answer sessions, keep crowds hyped and engaged, or streamline user supportβthe choice is yours.
info
If you prefer to use your own system for tracking questions, or if you want to replace the audience question function with a feedback form, polls, etc., you can do so using the [Participation button ](/running-your-event/moderator-tools/participation.md)located in the moderator tools.
#### Reviewing audience questions[β](#reviewing-audience-questions "Direct link to Reviewing audience questions")

*Pictured: The Audience questions button, with a green light to indicate a new question has been received.*
When a new audience question has been submitted, Moderators will be alerted by the appearance of a **green dot** next to the Audience questions button in the moderator toolbar.

Clicking the **Audience questions button** will open the Submitted Questions window. Questions can then reviewed and addressed individually, by any means that is appropriate. A content question may be presented to a guest speaker, while a request for help may be addressed via direct text message.
Clicking the relevant **Delete button** will remove the question from the Submitted Questions window.
---
### Audio streams
[YouTube video player](https://www.youtube.com/embed/jdNHaK3qAKg?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview[β](#overview "Direct link to Overview")

*Highlighted: The location of the Audio stream button.*
The **Audio stream button** (highlighted above) allows Moderators to enter a known audio stream address. This stream will then be played in real time throughout the Region.
info
Users with advanced permissions can access additional audio stream options through the [Region Information window](/building-new-worlds/region-settings.md#region-wide-audio-streams), including a menu of live audio streams.
#### Enabling an audio stream[β](#enabling-an-audio-stream "Direct link to Enabling an audio stream")

To enter an audio stream address using this tool, follow the steps below.
1. Navigate your avatar to the Region you want to edit.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Audio stream button**.
4. A pop-up will appear. Paste your stream address into the provided field, and click **Set URL**.

*Highlighted: The location of the Radio button.*
Users can now toggle the audio stream by clicking the **Radio button** located in the [Settings toolbar](/getting-started/ui-tour.md#the-settings-toolbar). Within the [Settings window](/getting-started/settings.md#audio-settings), users can adjust the music volume independently of the other types of audio that might play in-world.
---
### Broadcast messages
[YouTube video player](https://www.youtube.com/embed/RE-o6MegYT4?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview[β](#overview "Direct link to Overview")

*Highlighted: The location of the Broadcast messages button.*
The **Broadcast messages button** (highlighted above) gives [Moderators](/running-your-event/moderator-tools.md#accessing-the-moderator-controls) the ability to send text messages to all users currently gathered within a Region, or to individual users. Moderators can flag their messages for reply, allowing users to respond with a minimum of effort. Moderators can also create countdown timers to assist with event management.

After accessing the [moderator tools](/running-your-event/moderator-tools.md#accessing-the-moderator-controls), click the **Broadcast messages button** in the panel that appears on the right-hand side. This will open the Broadcast Message panel. A quick rundown of the UI will be helpful before we delve into the various messaging options.
| | |
| ----------------------- | ----------------------------------------------------------------------------------------- |
| Button or UI component | Function |
| Set Timer toggle | Allows you to activate or deactivate the countdown timer displayed on users' screens. |
| Timer field | Allows you to enter the countdown timer start value (in hours and minutes). |
| Select recipient menu | Allows you to select a message recipient (i.e., *Everyone* or a specific user). |
| Optional templates menu | Allows you to select a pre-defined message template. |
| Message field | Allows you to compose your own message. |
| Message type menu | Allows you to choose whether users can respond to your message, and how they can respond. |
| Send button | Sends the current message. |
| Send and Close button | Sends the current message and closes the Broadcast Message panel. |
| Close button | Closes the Broadcast Message panel. |
#### Message types [](#message-types)[β](#message-types- "Direct link to message-types-")
##### Region broadcasts [](#region-broadcasts)[β](#region-broadcasts- "Direct link to region-broadcasts-")
Region broadcasts are useful when it comes to managing event logistics. You can use them to keep everyone in your Region on task, announce schedule changes, or provide event transition cues.

*Pictured: An example Region broadcast message.*
Here's an example of a message intended for everyone within the Region. Notice how the options are set up:
* The Select recipient drop-down menu is set to *Everyone*, so everyone in the Region will see the announcement
* The Message type drop-down menu is set to *Message*, so the announcement will be displayed with no expectation of a reply
Here's how the example message might appear to users located within the Region:

To send a Region broadcast message like the one above, follow these steps:
1. Navigate your avatar to the Region where you want to communicate with your users.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Broadcast messages button**.
4. In the **Broadcast Message panel** that appears, use the **Select recipient drop-down menu** to select *Everyone*.
5. Enter the **message** you want to send, or select a template using the **Optional templates drop-down menu**.
6. Set the **Message type drop-down menu** to *Message*.
7. Click the **Send** or **Send and Close button**.
##### Direct messages[β](#direct-messages "Direct link to Direct messages")

*Pictured: An example direct broadcast message.*
You can also send direct messages to individual users located in a region. To do so, follow these steps.
1. Navigate your avatar to the Region where you want to communicate with your users.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Broadcast messages button**.
4. In the **Broadcast Message panel** that appears, use the **Select recipient drop-down menu** to select your intended *recipient*. You can use the **search field** to search for a specific name.
5. Enter the **message** you want to send, or select a template using the **Optional templates drop-down menu**.
6. Set the **Message type drop-down menu** to *Message*.
7. Click the **Send** or **Send and Close button**.
##### Yes-or-no messages[β](#yes-or-no-messages "Direct link to Yes-or-no messages")
In certain cases, you may want to gather feedback from users in the form of a yes-or-no response. You can broadcast an open question to everyone gathered within your Region, or limit your question to a particular user.

*Pictured: An example direct yes-or-no broadcast message.*
Here's an example of how you might approach a specific user. Notice that:
* The Select recipient menu is set to *a specific user*
* The Message type menu is set to *Yes or No Response*
Here's how the example message might appear to the intended user:

You can see that in addition to being able to close the message, the user can answer *Yes* or *No* by clicking the relevant buttons.

In our hypothetical example, the user has responded by answering that *yes*, she can hear other attendees speaking. Above is the return message a Moderator might receive. From here, the Moderator can reply again through the message pop-up by clicking the **Reply button**. Alternatively, the Moderator may close the message by clicking the **Close button**, and approach the user directly through text or voice chat.
To send a yes-or-no message, follow these steps:
1. Navigate your avatar to the Region where you want to communicate with your users.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Broadcast messages button**.
4. In the **Broadcast Message panel** that appears, enter the following information:
1. Use the **Select recipient drop-down menu** to select *Everyone* or your intended *recipient*. You can use the **search field** to search for a specific name.
2. Enter the **message** you want to send, or select a template using the **Optional templates drop-down menu**.
3. Set the **Message type drop-down menu** to *Yes or No Response*.
5. Click the **Send** or **Send and Close button**.
##### Input messages[β](#input-messages "Direct link to Input messages")
Input messages allow Moderators to solicit detailed responses and feedback from users. These messages can be broadcast to an entire Region, or targeted at a single person.

*Pictured: An example input response message.*
In the example image above, the Moderator is sending a message to everyone. Notice that:
* The Select recipient menu is set to *Everyone*
* The Message type drop-down menu is set to *Input Response*
Here's how the example message might appear to users located within the Region:

You can see that a user has received this message and has entered her thoughts in the **response field**. She can now click **Send** to reply to the Moderator, or dismiss the announcement pop-up by clicking **Close**.

Here's an example of how the user's response may appear to a Moderator. The Moderator can now respond to the user by clicking **Reply**, or **Close** the conversation.
To send an input message, follow these steps:
1. Navigate your avatar to the Region where you want to communicate with your users.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Broadcast messages button**.
4. In the **Broadcast Message panel** that appears, enter the following information:
1. Use the **Select recipient drop-down menu** to select *Everyone* or your intended *recipient*. You can use the **search field** to search for a specific name.
2. Enter the **message** you want to send, or select a template using the **Optional templates drop-down menu**.
3. Set the **Message type drop-down menu** to *Input Response*.
5. Click the **Send** or **Send and Close button**.
#### Countdown timers[β](#countdown-timers "Direct link to Countdown timers")
You can also use the Broadcast Message panel to create countdown timers that will appear on users' screens. Timers can be added to any message type, and users can see one individual timer and one global timer.

*Pictured: An example broadcast message with an associated timer.*
In the example image above, the Moderator is sending a message to everyone. Notice that:
* The **Set Timer toggle** is switched *On*
* A number value has been entered into the minutes field

Here's an example of how timers may appear to an individual user. This user has received one private timer ("Timer") and one global timer ("Event Timer"). By attaching private timers to [direct messages](/running-your-event/moderator-tools/broadcast-messages.md#direct-messages), you can issue individual cues to help speakers and educators transition between events.
To attach a timer to any type of broadcast message, follow these steps:
1. Navigate your avatar to the Region where you want to communicate with your users.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Broadcast messages button**.
4. In the **Broadcast Message panel** that appears, switch the **Set Timer toggle** to *On*. Enter the timer length in **hours** and **minutes**.
5. Complete your message as normal.
6. Click the **Send** or **Send and Close button**.
When you issue a new event or private timer, it will override any previous timers.
---
### Crowd management
[YouTube video player](https://www.youtube.com/embed/ODDfMepQNXU?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview[β](#overview "Direct link to Overview")

*Highlighted: The location of the Crowd management button.*
The **Crowd Management button** (highlighted above) gives [Moderators](/running-your-event/moderator-tools.md#accessing-the-moderator-controls) the ability to teleport one or more users between different areas in the same Region. Moderators can also control user access to voice chat on a zone-by-zone basis.

After accessing the [moderator tools](/running-your-event/moderator-tools.md#accessing-the-moderator-controls), click the **Crowd Management button** in the panel that appears on the right-hand side. This will open the Crowd Management panel. A quick rundown of the UI will be helpful before we discuss specific use cases.
| | |
| ------------------------- | --------------------------------------------------------------------------------------------------------------- |
| Button or UI component | Function |
| Auditorium button | All users in the Region will be invited to teleport to the Auditorium. |
| Breakout button | All users in the Region will be teleported to a breakout area. |
| Quiet is On/Off button | Mutes or unmutes audience voice chat within the current voice zone. |
| Audience is On/Off button | Controls whether audience members have access to presentation tools in the current voice zone. |
| Admin is On/Off button | Controls whether Administrative staff members can override mute settings in the current voice zone. |
| Attendees button | Opens the attendee selection menu. |
| Places button | Opens the places selection menu. |
| Action/Teleport button | Completes your teleportation command, sending everyone (or a single individual) to the location of your choice. |
#### Teleporting users [](#teleporting-users)[β](#teleporting-users- "Direct link to teleporting-users-")
Breakroom's moderator tools offer both broad and granular options for Regional crowd management.
##### The Auditorium button [](#the-auditorium-button)[β](#the-auditorium-button- "Direct link to the-auditorium-button-")

*Pictured: The moderator tools > Crowd Management panel, and the Auditorium teleport invitation.*
Clicking the **Crowd Management > Auditorium button** will invite every user in the Region to gather in that Region's designated [Auditorium space](/getting-started/using-the-conference-system.md#the-general-navigation-panel). Users will then have the option to accept or decline the invitation.
##### The Breakout button[β](#the-breakout-button "Direct link to The Breakout button")

Clicking the **Crowd Management > Breakout button** will teleport every user in the Region to a [breakout area](/getting-started/using-the-conference-system.md#the-breakroom-rooms-panel). Users will be randomly distributed between the Region's active breakout areas, and will not be presented with the option to decline the teleportation order.
#### Custom teleport options [](#custom-teleport-options)[β](#custom-teleport-options- "Direct link to custom-teleport-options-")
Using the **Crowd Management** panel, you can teleport groups or individuals between areas in your Region. Users will not be presented with the option to decline your custom teleportation orders, and will be moved automatically to the area you specify.
Executing a custom teleport is a multi-stage process consisting of selecting attendees, selecting a destination, and then executing the teleport command. To get started, follow these steps.
##### **Selecting attendees**[β](#selecting-attendees "Direct link to selecting-attendees")
1. Navigate your avatar to the Region where you want to move your users.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Crowd Management button**.
4. Click the **Attendees button**. In the **Select User to Teleport panel** that appears, select either:
1. Everyone
2. A single named user

*Pictured: The moderator tools > Crowd Management panel, and the Select User to Teleport panel.*
Before we move on, it's important to note that the Select User to Teleport panel provides a number of search and sort functions to help you navigate long attendee lists. Here is a brief overview of the UI.
| | |
| ------------------------- | -------------------------------------------------------------- |
| Button or UI component | Function |
| User search field | Allows you to search for a specific user. |
| AZβ Ascending button | Sorts the user menu in alphabetical order. |
| ZAβ Descending button | Sorts the user menu in reverse alphabetical order. |
| Nearest proximity button | Sorts the user menu by users closest to the Moderator. |
| Farthest proximity button | Sorts the user menu by users farthest away from the Moderator. |
##### Selecting a destination[β](#selecting-a-destination "Direct link to Selecting a destination")

*Pictured: The moderator tools > Crowd Management panel, and the Select Teleport Location panel.*
After you select *who* you want to teleport, you'll need to select *where* you want to send them. To continue building your custom teleport command, follow these steps.
6. Click the **Places button**.
7. In the **Select Teleport Location panel** that appears, click on your teleport destination.
##### Multi-zone landmarks[β](#multi-zone-landmarks "Direct link to Multi-zone landmarks")

*Highlighted: Multi-zone landmark options in the Crowd Management panel.*
Teleport targets labeled *multiple locations* can be employed to teleport a crowd of users, with that crowd then being broken up and distributed randomly between the associated landmarks.
In the highlighted example above, choosing either **Breakout** or **Picnic Meeting Point** will randomly distribute the chosen users between all points labeled *Breakout* or *Picnic Meeting Point*. These points can be [breakout areas](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md), [voice zones](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md), or [Breakroom Landmark objects](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-landmark.md).
##### Finalizing your custom teleport command[β](#finalizing-your-custom-teleport-command "Direct link to Finalizing your custom teleport command")
After you've selected the users you want to move and their destination, you can finalize your custom teleport command by clicking the **Teleport button**. If you are teleporting everyone in the Region, click the **"Yes, I mean everyone" button** in the dialog box that appears.
#### Controlling access to voice chat and media sharing[β](#controlling-access-to-voice-chat-and-media-sharing "Direct link to Controlling access to voice chat and media sharing")

Using the Crowd Management panel, Moderators can permit or restrict access to voice chat, webcam streaming, and screen sharing on a zone-by-zone basis.
In detail, these zone settings are:
* **Quiet Mode**: When turned on, Quiet Mode will mute every user who is not currently seated on a [presenter seat](/getting-started/using-the-conference-system.md#presenter-seats). In voice zone types that do not include presenter seats, turning on Quiet Mode will mute *all* users.
* **Audience Mode**: When turned on, Audience Mode grants users access to *all enabled* communication options in that voice zone (e.g., voice chat, webcam, and screen share). Audience Mode overrides Quiet Mode, if Quiet Mode is also turned on.
* **Admin Mode**: When turned on, Admin Mode permits [Moderators ](/running-your-event/moderator-tools.md#accessing-the-moderator-controls)to access *all enabled* communication options in that voice zone (e.g., voice chat, webcam, and screen share). Admin Mode overrides Quiet Mode.
To customize a voice zone's communication settings, follow the steps below.
1. Navigate your avatar to the appropriate Region.
2. Position your avatar inside the voice zone that you want to customize.
3. Click the **Moderator tools/Key button** located on the right side of the screen.
4. Click the **Crowd Management button**. In the **Crowd Management panel** that appears, locate the **Zone Settings section**.
5. Click the relevant buttons to customize the voice zone.
1. If a button says **Quiet/Audience/Admin is On**, then that communication setting is currently *enabled*. Click the button again to disable it.
2. If the button says **Quiet/Audience/Admin is Off**, then that communication setting is currently *disabled*. Click the button again to enable it.
6. Repeat this process for every voice zone you want to customize.
##### Muting and banning users [](#muting-and-banning-users)[β](#muting-and-banning-users- "Direct link to muting-and-banning-users-")
For more information about [muting and banning](/building-new-worlds/region-settings.md#muting-and-banning-region-visitors) users on a Region-wide level, please see our [Building New Worlds section](/building-new-worlds.md).
---
### Hidden UI toggle
[YouTube video player](https://www.youtube.com/embed/RBKehGq2f84?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview[β](#overview "Direct link to Overview")

*Highlighted: The location of the UI toggle button.*
Depending on the needs of a particular event, World Owners may elect to [disable certain portions](/creating-custom-experiences/ui-customization-options.md#enabling-or-disabling-ui-functions) of [Breakroom's UI](/getting-started/ui-tour.md), such as avatar customization or text chat. Moderators still have access to these disabled UI components, however, and can toggle them on or off by clicking the **UI Toggle button** located in the moderator tools (highlighted above).
Being able to access hidden portions of the UI offers many benefits for event coordinators. For example, a World Owner may decide to turn off the Shop button for general users, preventing them from purchasing avatar components and other Inventory items. However, a Moderator may need to restore their personal Shop functionality in order to purchase decorative items or furniture for an event.
---
### Participation
[YouTube video player](https://www.youtube.com/embed/JEQg0oH570w?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview[β](#overview "Direct link to Overview")

*Pictured: An example of a customized participation form made available through Breakroom.*
As an alternative to using Breakroom's built-in [question management](/running-your-event/moderator-tools/audience-questions.md) system, you can tie your own question tracking software, spreadsheets, forms, polls, or any other webpage to the [Question button](/getting-started/using-the-conference-system.md#submitting-questions) located in the [conference tools](/getting-started/using-the-conference-system.md). Doing so will provide users with a pop-up where they can interact with your content.
#### Changing the participation URL[β](#changing-the-participation-url "Direct link to Changing the participation URL")

*Highlighted: The location of the Participation button.*
To enter a custom participation URL for your users to access, follow these steps.
1. Navigate your avatar to the Region you want to edit.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Participation button**.
4. A pop-up will appear. Paste your website address into the provided field, and click **Set URL**.

*Pictured: The Question button.*
Users can now access your participation link by clicking the **Question button** located in the [conference system communication panel](/getting-started/using-the-conference-system.md#communicating-at-an-event). Users can **Close** or **Refresh** the in-world browser panel by clicking the relevant buttons.
---
### Presentation controls
[YouTube video player](https://www.youtube.com/embed/x4Ar5mgCuZ4?list=PLMmBhuOTME3Ue8nZ3QwEOsXjM39UAR61p)
#### Overview[β](#overview "Direct link to Overview")

*Pictured: A presenter on stage in the Breakroom Conference Region, with identifying signage.*
In some Region template [presentation zones](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md), such as the 90-seat auditorium that comes standard with the Breakroom Conference and Desert Island [Region templates](/building-new-worlds/region-template-descriptions.md), you have the option of offering additional information in the form of static ***signs*** located on either side of the main stage. You can also create a playlist of ***videos*** that will be broadcast on a central screen. Both of these media types are controlled through the same interface, giving you the ability to effectively manage virtual presentations in real time.

*Pictured: An example of how the presentation control panel may appear.*
Here you can see how the presentation control panel may appear to Moderators. In this example, there are two signs and three videos available. The media order can be changed to facilitate rapid deployment, and the option to turn off signs or videos entirely is also available.
Signs are useful tools that you can use to:
* Brand your event
* Identify presenters or video content
* Publish session information
* Present static slides while a video plays
* Assist with event transitions and offer scheduling reminders (e.g., "Break in ten minutes")
#### Adding signs and videos[β](#adding-signs-and-videos "Direct link to Adding signs and videos")

*Highlighted: The location of the Presentation controls button.*
To add signs or videos to the presentation control panel, follow the steps below.
1. Navigate your avatar to the Region where you want to control or customize a presentation.
2. Click the **Moderator tools/Key button** located on the right side of the screen.
3. Click the **Presentation controls button** (highlighted above).

4. The **presentation control panel** will appear at the top of your screen. You can click the **Close button** at any time to close the panel. To proceed with a sign or video upload, click the **+ button** located on the relevant side.

*Pictured: An example sign.*
5. If you are creating a sign, the **Create New Sign dialog box** will appear. Click the **Upload Image button** to select a new image from your computer, or click the **Image Library button** to select an image that you have [previously uploaded](/creating-custom-experiences/managing-your-media-library.md).
6. Enter a name for the sign in the **name field**, and click the **Save button.** You will see your image added to the presentation control panel in the form of a button.

7. If you are adding a video, the **Video information dialog box** will appear. Enter a **title** for your video and the **streaming URL** into the appropriate fields. When you are done, click the **Save button**.
#### Managing and deploying signs and videos[β](#managing-and-deploying-signs-and-videos "Direct link to Managing and deploying signs and videos")

Once a sign or video has been [added](/running-your-event/moderator-tools/presentation-controls.md#adding-signs-and-videos) to the presentation control panel, it can be ordered in the list, activated, or deactivated using the available UI components.
| | |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Button | Function |
| X | Deletes the chosen sign or video from the presentation control panel. |
| β¬οΈ | Moves the chosen sign or video ***down*** one space in the list. |
| β¬οΈ | Moves the chosen sign or video ***up*** one space in the list. |
| Sign or video name | Displays the chosen sign on the screens located to either side of the presentation area, or starts the chosen video on the central screen. |
| No Sign button | Turns off any active signs and removes the display boards from the presentation area. |
| No Video button | Stops the video playing on the central presentation screen. |
---
### Raised hands
#### Overview[β](#overview "Direct link to Overview")

*Highlighted: The location of the Raised hands button.*
The **Raised hands button** allows you to view a list of all attendees who currently have their [hands raised](/getting-started/using-the-conference-system.md#raise-hand-and-emoji-buttons) via the [conference tools](/getting-started/using-the-conference-system.md). You can also dismiss one or all raised hands in the Region.
#### Viewing and dismissing raised hands[β](#viewing-and-dismissing-raised-hands "Direct link to Viewing and dismissing raised hands")

To view a list of attendees who have their hands raised, click the **Raised hands button**.
To dismiss an individual attendee's raised hand, click the **X button** beside their name. To dismiss all raised hands in a Region, click the **Dismiss All button**.
---
### Understanding the conference system
#### Overview[β](#overview "Direct link to Overview")

Breakroom's [conference system](/getting-started/using-the-conference-system.md) is comprehensive, and consists of:
* [Voice chat](/getting-started/using-the-conference-system.md#voice-chat)
* [Webcam streaming](/getting-started/using-the-conference-system.md#webcam-streaming)
* [Screen sharing](/getting-started/using-the-conference-system.md#screen-share)
* [Navigation tools](/getting-started/using-the-conference-system.md#navigating-an-event)
* [Moderation tools](/running-your-event/moderator-tools.md)
* [Scheduling tools](/exploring-breakroom/using-the-meetings-window.md)
* [Interactive emotes and gestures](/getting-started/using-the-conference-system.md#raise-hand-and-emoji-buttons)
* [A toolkit of media products](/creating-custom-experiences/exploring-the-breakroom-toolkit.md)
* [No-code gamification](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-games.md)
In this section, we'll explore the conference system core in greater depth. You'll get to know the bones of the product, and learn more about how you can build Regions that truly serve your needs. Whether you want to add additional [breakout areas](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md) to a Region, remove [presenter seats](/running-your-event/customizing-the-conference-system-components/setting-up-presenter-and-audience-zones.md) from a stage, or integrate [educational content](/breakroom-for-training/installing-breakroom-for-training.md) into Breakroom, we'll walk you through every step.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
---
### Voice chat and spatial audio
#### Overview[β](#overview "Direct link to Overview")
[Voice chat](/getting-started/using-the-conference-system.md#voice-chat) is a key conference system functionβbut at Breakroom, we empower you to build your World, your way. On this page we'll review instructions for disabling voice chat when needed, as well as discuss the spatial audio feature and how it works.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
#### Disabling voice chat[β](#disabling-voice-chat "Direct link to Disabling voice chat")
There may be occasions where you want to disable voice chat on a Region-wide basis, or disable voice chat in an individual breakout area or voice zone.
##### Disabling voice chat for an entire Region [](#spatial-audio)[β](#disabling-voice-chat-for-an-entire-region- "Direct link to disabling-voice-chat-for-an-entire-region-")

*Pictured: VOIP options available through the Region Information window.*
To disable voice chat entirely for a Region, follow these steps.
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Click the **Region Information button** located above the mini map.
3. Click the **Edit button** in the Permissions panel.
4. Scroll down to the section titled **VOIP**. Check the box next to the **"VOIP is disabled in this Region" option**.
5. Scroll down and click the **Save button**.
To restore voice chat to a muted Region, repeat the steps above and check the box next to the **"VOIP is enabled for everyone by default" option**.
info
Muting voice chat through the Region Information window will not remove the Microphone button from the conference system. However, the button will no longer work if clicked.
##### Disabling voice chat for a single voice zone[β](#disabling-voice-chat-for-a-single-voice-zone "Direct link to Disabling voice chat for a single voice zone")
To disable all media sharing options in a voice zone (including voice chat, webcam, and screen sharing), follow the steps below.

*Pictured: The RoomFurniture component for a Breakroom Voice Zone object, with the Zone Type property highlighted.*
1. Log in to your Breakroom World and navigate your avatar to the Region you would like to edit.
2. Open the Region Editor by clicking the **Edit Region button** at the bottom of your screen.
3. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
4. In the Objects window, locate the **Breakroom Breakout Area** or **Breakroom Voice Zone object** you want to edit. (Tip: You can use the **search field** at the top of the window to search for a specific object.) Click on the object name to launch the **Inspector window**.
5. In the Inspector window, locate the **RoomFurniture component**. Expand this component by clicking the **> arrow** located to the left of its name.
6. In the **Zone Type field**, enter the word "silent."
7. Click the **Reset Zones button** to reset the conferencing system.
8. Click the **Save button** to store your changes.
After you have closed the Region Editor, leave the voice zone and then return to it. You will see that most of the media buttons are gone, and that the Microphone button is grayed out to indicate that it is inaccessible.
If you prefer, you can turn voice chat off while leaving other media sharing options available by editing the [Zone Voice property](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-voice) located under the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md). However, if you have nested voice zones, users may still be able to hear and participate in voice chat from *surrounding* voice zones (including the Global voice zone).
#### Spatial audio [](#spatial-audio)[β](#spatial-audio- "Direct link to spatial-audio-")

*Pictured: An example of a voice zone boundary indicator. This user will need to move inside the boundary indicator if she wants to be heard by others in the breakout room.*
[Global voice zones](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md#voice-zone-types) have spatial audio set up by default. This means that a crowded virtual event will sound much like a similar event in "real life"**β**you'll be able to easily hear the people standing right next to you, while you may not be able to hear someone standing on the other side of the room. In a virtual world like Breakroom, this can initially confuse some users.
If you're having trouble hearing someone in voice chat even though you can see their avatar, make sure that you're both standing in the same [voice zone](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md#voice-zones-in-action). (If someone is standing in an auditorium voice zone, for example, and someone else is standing just outside of it, they will not be able to hear each other.) If you're both in the same voice zone, try moving closer together.
If you're still having trouble using voice chat, please consult our [troubleshooting tips](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md). If you want to edit the spatial distance for a specific breakout area or voice zone object, or turn off spatial audio altogether, please consult our [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-spatial) documentation.
---
### Voice zones, zone types, and conference permissions
#### Overview[β](#overview "Direct link to Overview")
Collaboration is the soul of Breakroomβand that collaboration happens inside different types of *voice zones*. Voice zones are virtual objects that encompass the areas where audio and video sharing will take place. These objects are normally invisible to you and your users.

*Pictured: A voice zone set up around an info desk, currently visible through the Region Editor (the green cube).*
Each [voice zone type](/running-your-event/understanding-the-conference-system/voice-zones-zone-types-and-conference-permissions.md#voice-zone-types) behaves differently, giving you the ability to structure online work, conferences, and presentations in a number of ways. By adding [breakout areas](/running-your-event/customizing-the-conference-system-components/adding-breakout-areas.md), creating [custom voice zones](/running-your-event/customizing-the-conference-system-components/creating-custom-voice-zones.md), and editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md) attached to Breakout Area and Voice Zone objects, you can streamline communication and remove potential pain points.
This page will serve as a brief introduction to the different voice zone types and how they can be used. It is strongly recommended that you read and understand this information prior to customizing your first Breakroom Region.
info
The instructions provided in this section presume an advanced working knowledge of Breakroom. Please consult our documentation if you need help [installing](/creating-custom-experiences/using-the-region-editor.md) and [positioning](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md) virtual objects, or editing the [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
#### Voice zone types[β](#voice-zone-types "Direct link to Voice zone types")
Currently, Breakroom offers five different voice zone types.
* Presenter
* Audience
* Meeting
* Voice
* Silent
**Voice chat**: Available to all users.
**Webcam and screen share**: Restricted to *only* those users in the designated [presenter seats](/getting-started/using-the-conference-system.md#presenter-seats). Moderators can choose to [enable media sharing](/running-your-event/moderator-tools/crowd-management.md#controlling-access-to-voice-chat) permissions for the audience if they wish.
**Voice chat, webcam and screen share**: Restricted to *only* those users in the designated [presenter seats](/getting-started/using-the-conference-system.md#presenter-seats). Moderators can choose to [enable media sharing](/running-your-event/moderator-tools/crowd-management.md#controlling-access-to-voice-chat) permissions for the audience if they wish.
**Voice chat, webcam and screen share**: Available to all users. Everyone can chat and share media.
**Voice chat**: Available to all users.
**Webcam and screen share**: Disabled. No one can share media.
**Voice chat, webcam and screen share**: Disabled. No one can voice chat or share media.
*Voice* is the standard setting for the *Global voice zone,* which is an invisible voice zone that encompasses the whole of your Region. It may help to visualize this voice zone as the general environment of your Region, or as "anywhere another, specific voice zone is *not*." This topic will be explained in more detail below. Voice zones can also be nested within one another.
Voice zone type information is stored in the [Zone Type property](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md#zone-type), under the voice zone object's [RoomFurniture component](/running-your-event/customizing-the-conference-system-components/the-roomfurniture-component.md).
warning
The media streaming system cannot accommodate more than 17 simultaneous webcam or screen share users at this time.
#### Voice zones in action[β](#voice-zones-in-action "Direct link to Voice zones in action")
To visually illustrate how multiple voice zones could be set up in a Region, let's take a closer look at one of the Breakroom [Region templates](/building-new-worlds/region-template-descriptions.md).

The image above is a flyover shot of the Breakroom Campus Large Region. You can see that it consists of several lobbies, meeting rooms, and an amphitheater, as well as trees and gardens. Everything you see here is contained inside the *Global voice zone*.

Here's a top-down view of the same Region. Each of the highlighted areas above is a separate voice zone. Depending on each zone's type, these spaces offer different communication options.
* The circular amphitheater is a *Presenter zone*. Someone can give a video presentation here, and audience members will not be able to interrupt by sharing their own video streams. In order to present, users will have to sit on a **presenter seat** (normally located at the front of the auditorium). The audience can interact via voice chat to ask questions or participate in activities.
* The red, yellow, blue, and green offices are *Meeting zones*. Everyone can share video and speak on voice chat, just as they might expect to do in a physical conference room.
* Everywhere else falls within the Global voice zone, which is a *Voice zone*. This means that users can voice chat with one another as they move between the offices, but they cannot share their webcams or screens.
Only users with avatars currently located *inside* a particular voice zone can hear, share, and communicate with other users in that zone. This design makes it possible for different meetings or events to be held concurrently in the same Region without technical interference or audio competition. Likewise, when you are inside an isolated voice zone (such as an office), you will no longer hear voice chat taking place in the Global voice zone.
When you approach the edge of a voice zone, a transparent blue *boundary indicator* will appear. This serves as a reminder that you are about to enter or leave a voice zone, or that you need to enter a voice zone in order to speak with users located on the other side.

*Pictured: An example of a voice zone boundary indicator. This user will need to move inside the boundary indicator if she wants to be heard by others in the breakout room.*
#### Conference permissions[β](#conference-permissions "Direct link to Conference permissions")
Among the voice zone types, Presenter and Audience zones are unique, as both make use of special *presenter seats*. By positioning their avatars in these seats, presenters can gain access to voice chat and media sharing functions within a particular voice zone, even if these functions are otherwise restricted. Users with access to the [Breakroom moderator tools](/running-your-event/moderator-tools.md) can also grant access to voice chat or media sharing functions as needed.
For help [setting up or customizing Presenter and Audience zones](/running-your-event/customizing-the-conference-system-components/setting-up-presenter-and-audience-zones.md), as well as detailed information on using the moderator tools to [control audience access to media sharing functions](/running-your-event/moderator-tools/crowd-management.md#controlling-access-to-voice-chat-and-media-sharing), please see our [Running Your Event section](/running-your-event.md).
---
## Scripting
### Welcome to Scripting API
**This documentation is in progress. Please visit** [**this page**](/scripting/support/report-an-issue.md) **to report any issues, missing information, corrections or suggestions you may have.**
#### **Introduction**[β](#introduction "Direct link to introduction")
Scripting in Sinespace uses the **Lua programming language**.
Sinespace offers scripters **Unity components,** which are added to GameObjects, that will run the scripts(code) that we write inside them.
These Unity components come within the **Sinespace Editor Pack** package, which needs to be installed in our Unity project before we begin scripting.
Our core class is the [SScript](/scripting/client-scripting-api-reference/region/sscript.md) class, which is accessed by writing "Space".
Example: `Space.Log('Hello World')` is equivalent to [SScript.Log('Hello world')](/scripting/client-scripting-api-reference/region/sscript.md#log).
All of your functions/properties will be accessed starting with 'Space' which also navigates to other classes. There's very few exceptions that are accessed directly such as "Math" ([SMath](/scripting/server-scripting-api-reference/library/smath.md)) and "Color"([SColor](/scripting/client-scripting-api-reference/types/scolor.md)).
Example: `Space.Network.SendNetworkMessage()` this starts with the [SScript](/scripting/client-scripting-api-reference/region/sscript.md) class and goes into the [SNetwork](/scripting/client-scripting-api-reference/network/snetwork.md) class.
##### Client Scripts vs Server Scripts[β](#client-scripts-vs-server-scripts "Direct link to Client Scripts vs Server Scripts")
Client scripts run client-side, and Server scripts run server-side.
Browsing the left panel of this documentation you will find that our API Reference is split into two different parts - Client Scripting and Server Scripting.
##### **Your first Client Script**[β](#your-first-client-script "Direct link to your-first-client-script")
To begin creating your first Sinespace Client Script, make sure you have the Sinespace Editor Pack properly installed, and then:
* Select your GameObject
* Click **Add Component**
* Search for and select **Scripting Runtime**
* Enter your code in the **Script Contents** text box - for example `Space.Log('Hello World!')`
* Press **Play Scene** (you should see your "Hello World!" in the Unity console window)
##### Your first Server Script[β](#your-first-server-script "Direct link to Your first Server Script")
It's recommended that new scripters familiarize themselves with Client scripts first before jumping into Server scripts, or creating more complicated objects that require server scripts.
Visit the [Server Scripts guide](/scripting/guides/server-scripts.md) to begin your first Server script.
---
### Changelog
#### [ποΈAPI Changelog](/scripting/changelog/api-changelog.md)
[A list of changes to the Sinespace API](/scripting/changelog/api-changelog.md)
---
### API Changelog
| Date | Change | Version |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| 20 December 2022 | SClickable.InvokeClick added SGrid.ID added (white-label only) | 2022.1f16419 (Current Live Release) |
| 26 August 2022 | [SScript.ComponentName](../client-scripting-api-reference/region/sscript#componentname) added [SStateMachine.ComponentName](../client-scripting-api-reference/components/sstatemachine#componentname) added [SScriptingRuntime.ComponentName](../client-scripting-api-reference/components/sscriptingruntime#componentname) added[SScriptingEvents.ComponentName](../client-scripting-api-reference/components/sscriptingevents#componentname) added [SScriptingData.ComponentName](../client-scripting-api-reference/components/sscriptingdata#componentname) added | 15969 |
| 26 August 2022 | [SNavMeshAgent.Warp](../client-scripting-api-reference/components/snavmeshagent#warp) added | 15967 |
| 17 August 2022 | \*Network Messages can now be sent 20 times per second (up from 10) | 15912 |
| 17 August 2022 | [SNetwork.SendNetworkMessageToUser ](../client-scripting-api-reference/network/snetwork#sendnetworkmessagetouser)added [SNetwork.SubscribeToRegionPropertyUpdate](../client-scripting-api-reference/network/snetwork#subscribetoregionpropertyupdate) added | 15910 |
| 11 August 2022 | [SAvatar.OnAvatarAttached](../client-scripting-api-reference/types/savatar#onavatarattached) added [SAvatar.OnAvatarDetached](../client-scripting-api-reference/types/savatar#onavatardetached) added | 15867 |
| 20 May 2022 | [SUI.OpenFeedbackWindow](../client-scripting-api-reference/client/sui#openfeedbackwindow) added (white-label) [SUI.HideFeedbackWindow](../client-scripting-api-reference/client/sui#hidefeedbackwindow) added (white-label) | 15375 |
| 18 May 2022 | [SRenderSettings.SetGlobalShaderVector](../client-scripting-api-reference/region/srendersettings#setglobalshadervector) Added an additional parameter to the function, which will count as the 4th component of a Vector4. (Incase we wanted to pass a Vector4 instead of Vector3). | 15369 |
| 17 May 2022 | [SUIDropdown.SetValueByText](../client-scripting-api-reference/components/suidropdown#setvaluebytext) added | 15362 |
| 29 Apr 2022 | [SDateTime](../client-scripting-api-reference/types/sdatetime) expanded with Year, Month, Day, Hour, Minute, Second, Millisecond properties | 15303 |
| 27 Apr 2022 | [SGrid.ThemeColor1](../client-scripting-api-reference/region/sgrid#themecolor1) added [SGrid.ThemeColor2](../client-scripting-api-reference/region/sgrid#themecolor2) added [SGrid.ThemeColor3](../client-scripting-api-reference/region/sgrid#themecolor3) added [SGrid.ThemeColor4](../client-scripting-api-reference/region/sgrid#themecolor4) added [SGrid.TextColor1](../client-scripting-api-reference/region/sgrid#textcolor1) added [SGrid.TextColor2](../client-scripting-api-reference/region/sgrid#textcolor2) added | 15300 |
| 25 Mar 2022 | [SScene.Population](../client-scripting-api-reference/region/sscene#population) added | 15151 |
| 8 Mar 2022 | [SDateTime](../client-scripting-api-reference/types/sdatetime) added | 15057 |
| 20 Dec 2021 | [SAnimator.PlaybackTime](../client-scripting-api-reference/components/sanimator#playbacktime) added | 14426 |
| 16 Dec 2021 | [SAvatar.DisplayName](../client-scripting-api-reference/types/savatar#displayname) added | 14405 |
| 8 Dec 2021 | [SRoomFloor.Owner](../client-scripting-api-reference/components/sroomfloor#owner) added [SFurniture.Floor](../client-scripting-api-reference/components/sfurniture#floor) added | 14331 |
| 2 Dec 2021 | [SLineRenderer.SetPosition](../client-scripting-api-reference/components/slinerenderer#setposition)/[GetPosition](../client-scripting-api-reference/components/slinerenderer#getposition) are now 0-index | 14276 |
| 24 Nov 2021 | [SGameObject.Moniker](../client-scripting-api-reference/types/sgameobject#moniker) added | 14193 |
| 16 Nov 2021 | [SAvatar.PlayCustomAnimation](../client-scripting-api-reference/types/savatar#playcustomanimation) no longer blocks avatar from moving | 14144 |
---
### Client Scripting API
#### [πClient](/scripting/client-scripting-api-reference/client.md)
[4 items](/scripting/client-scripting-api-reference/client.md)
---
### Client
The client runtime surface β entry points for on-screen dialogues, player input, shared data, and the in-world UI that client scripts can drive.
---
### SDialogues
#### Index[β](#index "Direct link to Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**ColorPicker**](sdialogues#colorpicker) (string title, string okbutton, Action< SColor > onChange, Action< SColor > onSelect, Action onCancel, SColor defaultColor) |
| void [**YesNoInput** ](sdialogues#yesnoinput)(string title, string okbutton, string cancelButton, Action< bool > result) |
| void [**TextInput** ](sdialogues#textinput)(string title, string okButton, Action< string > result) |
| void [**OpenURL** ](sdialogues#openurl)(string url, bool newTab = true) |
| void [**SendLocalChat** ](sdialogues#sendlocalchat)(string message, string from) |
#### Functions[β](#functions "Direct link to Functions")
##### **ColorPicker**[β](#colorpicker "Direct link to colorpicker")
*Opens a color picker dialogue.*
void **ColorPicker**(string title, string okbutton, Action< SColor > onChange, Action< SColor > onSelect, Action onCancel, SColor defaultColor)
| Parameter | Type | Description |
| ------------ | ---------------------------- | -------------------------------------------------------------------------------------------------------- |
| title | string | The title of the color picker window. Choose something brief and appropriate like 'Select a wall color'. |
| okbutton | string | The title of the 'OK' button. Should indicate the action e.g. 'Adjust Wall'. |
| onChange | Action\\\ or Closure | Any color change while the color picker is open will trigger onChange(SColor). |
| onSelect | Action\\\ or Closure | Triggers onSelect(SColor) once the "ok" button is pressed. |
| onCancel | Action\\\ or Closure | The title of the 'OK' button. Should indicate the action e.g. 'Adjust Wall'. |
| defaultColor | SColor | The color to open the colour picker with. |
* Lua
```lua
--clicking the object will open a color picker that changes the object's color
thisGameObject = Space.Host.ExecutingObject
originalColor = thisGameObject.Renderer.Material.GetColor("_Color")
OnChange = function(SColor)
thisGameObject.Renderer.Material.SetColor("_Color",SColor)
end
OnSelect = function(SColor)
thisGameObject.Renderer.Material.SetColor("_Color",SColor)
end
OnCancel = function()
thisGameObject.Renderer.Material.SetColor("_Color",originalColor)
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### **YesNoInput**[β](#yesnoinput "Direct link to yesnoinput")
*Opens a simple Yes/No dialogue**.***
void **YesNoInput**(string title, string okbutton, string cancelButton, Action< bool > result)
| Parameter | Type | Description |
| ------------ | --------------- | --------------------------------------------------------------------------------------------- |
| title | string | The question to be asked of the user. Should be a simple statement, e.g. "Save room changes?" |
| okbutton | string | The text on the OK button, should indicate the action, e.g. "Save Room" |
| cancelButton | string | The text on the cancel button, should indicate the action, e.g. "Not now" |
| result | Action\\\ | Will fire a callback event depending on the status of the users actions |
* Lua
```lua
hostObject = Space.Host.ExecutingObject
local deltaPos = Vector.New(0,100,0)
local teleportTo = hostObject.WorldPosition + deltaPos
function teleportMeUp (b)
if b then
Space.Scene.PlayerAvatar.Teleport(teleportTo)
end
end
function openDialogue ()
Space.Dialogues.YesNoInput ("Ready for a teleport?", "Yes", "No", teleportMeUp)
end
hostObject.SubscribeToEvents()
hostObject.OnMouseDown(openDialogue)
```
##### TextInput[β](#textinput "Direct link to TextInput")
*Opens a text entry window with room for a single multi-line text field.*
void **TextInput** ( string title, string okButton, Action< string > result)
| Parameter | Type | Description |
| --------- | ---------------- | ----------------------------------------------------------------------------------- |
| title | string | The accompanying text. Should be something ala "Enter your username". |
| okButton | string | The text displayed on the OK button, should be descriptive, e.g. "Change Username". |
| result | Action< string > | Triggers result(string) once the "Ok" button is pressed. |
* Lua
```lua
hostObject = Space.Host.ExecutingObject
printToLog = function (s)
Space.Log(s)
end
function openDialogue ()
Space.Dialogues.TextInput ("Write anything.", "Done", printToLog)
end
hostObject.OnMouseDown(openDialogue)
```
##### OpenURL[β](#openurl "Direct link to OpenURL")
*Opens the specified URL in the in-app web browser, or the system web browser. In some environments the user may be prompted before this is opened.*
void **OpenURL** ( string url, bool newTab = true )
| Parameter | Type | Description |
| --------- | ------ | --------------------------------------- |
| url | string | The web address to open. |
| newTab | bool | Does the URL open in a new browser tab? |
* Lua
```lua
-- when the object is clicked, the "sine.space" website is opened
hostObject = Space.Host.ExecutingObject
function openTheWebsite ()
Space.Dialogues.OpenURL("http://sine.space/")
end
hostObject.OnMouseDown(openTheWebsite)
```
##### SendLocalChat[β](#sendlocalchat "Direct link to SendLocalChat")
*Sends a message into the 'Script' chat channel.*
void **SendLocalChat** ( string message, string from )
| Parameter | Type | Description |
| --------- | ------ | ------------------------------------- |
| message | string | The message to appear in the channel. |
| from | string | The 'from' username for the message. |
* Lua
```lua
hostObject = Space.Host.ExecutingObject
function chatMessage ()
Space.Dialogues.SendLocalChat ("I've been clicked", "Clickable Object")
end
hostObject.OnMouseDown(chatMessage)
```
---
### SInput
#### Functions[β](#functions "Direct link to Functions")
##### **GetKeyDown**[β](#getkeydown "Direct link to getkeydown")
bool **GetKeyDown** (string key)
*Returns true if 'key' was pressed during this frame.*
| Parameter | Type | Description |
| --------- | ------ | -------------------------------------------------------------------------------------------- |
| key | string | [Input key name](/scripting/client-scripting-api-reference/client/sinput.md#input-key-names) |
* Lua
```lua
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetKeyDown("space") then
Space.Log("Jump Key Down")
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### **GetKeyUp**[β](#getkeyup "Direct link to getkeyup")
bool **GetKeyUp** (string key)
*Returns true if 'key' is no longer pressed during this frame (but was in the last).*
| Parameter | Type | Description |
| --------- | ------ | -------------------------------------------------------------------------------------------- |
| key | string | [Input key name](/scripting/client-scripting-api-reference/client/sinput.md#input-key-names) |
* Lua
```lua
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetKeyUp("space") then
Space.Log("Jump Key Released")
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### **GetKey**[β](#getkey "Direct link to getkey")
bool **GetKey** (string key)
*Returns true if 'key' is being held pressed.*
| Parameter | Type | Description |
| --------- | ---- | -------------------------------------------------------------------------------------------- |
| key | bool | [Input key name](/scripting/client-scripting-api-reference/client/sinput.md#input-key-names) |
* Lua
```lua
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetKey("space") then
Space.Log("Jump Key Held")
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### GetMouseDown[β](#getmousedown "Direct link to GetMouseDown")
bool **GetMouseDown** (int button)
*Returns true if mouse 'button' was pressed during this frame.*
| Parameter | Type | Description |
| --------- | ---- | -------------------------------------------------------------------------------------------------------------------------- |
| button | int | *button* values are 0 for the primary button (often the left button), 1 for secondary button, and 2 for the middle button. |
* Lua
```lua
if Space.Input.GetMouseDown(1) then
Space.Log("Right Mouse button pressed in this frame")
end
```
* Lua
```lua
--this script will make this object jump to wherever you right click
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseDown(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### GetMouseUp[β](#getmouseup "Direct link to GetMouseUp")
bool **GetMouseUp** (int button)
*Returns true if mouse 'button' is no longer pressed during this frame (but was in the last).*
| Parameter | Type | Description |
| --------- | ---- | -------------------------------------------------------------------------------------------------------------------------- |
| button | int | *button* values are 0 for the primary button (often the left button), 1 for secondary button, and 2 for the middle button. |
* Lua
```lua
if Space.Input.GetMouseUp(1) then
Space.Log("Right Mouse button was just unpressed")
end
```
##### GetMouseHold[β](#getmousehold "Direct link to GetMouseHold")
bool **GetMouseHold** (int button)
*Returns true if mouse 'button' is being held pressed.*
| Parameter | Type | Description |
| --------- | ---- | -------------------------------------------------------------------------------------------------------------------------- |
| button | int | *button* values are 0 for the primary button (often the left button), 1 for secondary button, and 2 for the middle button. |
* Lua
```lua
if Space.Input.GetMouseHold(1) then
Space.Log("Right Mouse button being held")
end
```
* Lua
```lua
--this script will make this object will follow your ovement while holding right click
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseHold(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### Vibrate[β](#vibrate "Direct link to Vibrate")
void **Vibrate** (float intensity, float duration, bool leftHand)
*Vibrates the controller (or phone, or gamepad) if a rumble device is present.*
| Parameter | Type | Description |
| --------- | ----- | ------------------------------------------------------------------------------------------------ |
| intensity | float | Intensity of the vibration from 0.0 to 1.0 |
| duration | float | Duration of the vibration. Maximum 1.0 second. |
| leftHand | bool | If true the vibration will be on the left hand and if false on the right hand (where applicable) |
* Lua
```lua
Space.Input.Vibrate(1,1,false)
```
#### Properties[β](#properties "Direct link to Properties")
##### **ScrollWheel**[β](#scrollwheel "Direct link to scrollwheel")
float **ScrollWheel** `get`
*Returns a non-0 value if the mouse wheel is being scrolled, value usually ranges from -1 to 1\*\*.\*\**
* Lua
```lua
scrollWheel = Space.Input.ScrollWheel
```
* Lua
```lua
--Object will move up and down with scroll wheel movement
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
thisGameObject.WorldPosition = thisGameObject.WorldPosition + (thisGameObject.Up * Space.Input.ScrollWheel)
end
thisGameObject.OnUpdate(OnUpdate)
```
##### MousePosition[β](#mouseposition "Direct link to MousePosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MousePosition** `get`
*Returns the current position of the mouse in screen pixels. If on a touch screen device, this will also return the location of the first finger being pressed.*
* Lua
```lua
currentMousePos = Space.Input.MousePosition
```
* Lua
```lua
--Object will follow your mouse movement while holding right click
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseHold(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### MovementAxis[β](#movementaxis "Direct link to MovementAxis")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MovementAxis** `get`
*Returns left/right (A/D) movement on X, forward/back (W/S) on Y, and up/down (E/C) on Z.*
* Lua
```lua
moveAxis = Space.Input.MovementAxis
```
* Lua
```lua
--Object moves according to your AWSD presses
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.MovementAxis.Y > 0 then
thisGameObject.WorldPosition = thisGameObject.WorldPosition + thisGameObject.Forward
elseif Space.Input.MovementAxis.Y < 0 then
thisGameObject.WorldPosition = thisGameObject.WorldPosition - thisGameObject.Forward
end
if Space.Input.MovementAxis.X > 0 then
thisGameObject.WorldPosition = thisGameObject.WorldPosition + thisGameObject.Right
elseif Space.Input.MovementAxis.X < 0 then
thisGameObject.WorldPosition = thisGameObject.WorldPosition - thisGameObject.Right
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### TurnAxis[β](#turnaxis "Direct link to TurnAxis")
[SVector](/scripting/client-scripting-api-reference/types/svector.md)? **TurnAxis** `get`
Returns the Turn Axis (-1 to 1 on Vector's X value).
* Lua
```lua
turnAxis = Space.Input.TurnAxis
```
* Lua
```lua
--makes this object color red if player is turning left
--and color green if player is turning right
--and blue if player is not turning
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.TurnAxis.X > 0 then
thisGameObject.Renderer.Material.SetColor("_Color",Color.Red)
elseif Space.Input.TurnAxis.X < 0 then
thisGameObject.Renderer.Material.SetColor("_Color",Color.Green)
elseif Space.Input.TurnAxis.X == 0 then
thisGameObject.Renderer.Material.SetColor("_Color",Color.Blue)
end
end
thisGameObject.OnUpdate(OnUpdate)
```
***
##### MouseLook[β](#mouselook "Direct link to MouseLook")
bool **MouseLook** `get` `set`
Enable or disable Mouse Look feature.
* Lua
```lua
Space.Input.MouseLook = true
```
* Lua
```lua
--the below script will put your player into MouseLook mode if you are near the object
--and return you to normal mode if you are far from the object
thisGameObject = Space.Host.ExecutingObject
function OnUpdate()
positionAvatar = Space.Scene.PlayerAvatar.GameObject.WorldPosition
positionObject = thisGameObject.WorldPosition
if positionAvatar.InRange(positionObject, 5.0) then
if Space.Input.MouseLook == false then
Space.Input.MouseLook = true
end
else
if Space.Input.MouseLook == true then
Space.Input.MouseLook = false
end
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### MouseX[β](#mousex "Direct link to MouseX")
float **MouseX** `get`
*Returns a float representing the Mouse/Right Joystick horizontal movement. If the value is positive the movement is upwards. If the value is negative the movement is downwards. The value is derived by multiplying mouse delta with axis sensitivity. This is frame-rate independent; you do not need to be concerned about varying frame-rates when using this value.*
* Lua
```lua
MouseX = Space.Input.MouseX
```
* Lua
```lua
--the below script will rotate this object along the Y axis
--according to your mouse/right joystick horizontal movement
thisGameObject = Space.Host.ExecutingObject
function OnUpdate()
currentY = thisGameObject.WorldRotation.EulerAngles.Y
newY = currentY + Space.Input.MouseX
thisGameObject.WorldRotation = Quaternion.Euler(0, newY, 0)
end
thisGameObject.OnUpdate(OnUpdate)
```
##### MouseY[β](#mousey "Direct link to MouseY")
float **MouseY** `get`
*Returns a float representing the Mouse/Right Joystick vertical movement. If the value is positive the movement is to the right. If the value is negative the movement is to the left. The value is derived by multiplying mouse delta with axis sensitivity. This is frame-rate independent; you do not need to be concerned about varying frame-rates when using this value.*
* Lua
```lua
MouseY = Space.Input.MouseY
```
* Lua
```lua
--the below script will rotate this object along the Y axis
--according to your mouse/right joystick vertical movement
thisGameObject = Space.Host.ExecutingObject
function OnUpdate()
currentX = thisGameObject.WorldRotation.EulerAngles.X
newX = currentX + Space.Input.MouseY
thisGameObject.WorldRotation = Quaternion.Euler(newX , 0, 0)
end
thisGameObject.OnUpdate(OnUpdate)
```
##### ClickToWalk[β](#clicktowalk "Direct link to ClickToWalk")
[SVector](/scripting/client-scripting-api-reference/types/svector.md)? **TurnAxis** `get`
*Returns the Turn Axis (-1 to 1 on Vector's X value).*
* Lua
```lua
turnAxis = Space.Input.TurnAxis
```
* Lua
```lua
--makes this object color red if player is turning left
```
##### Fire[β](#fire "Direct link to Fire")
bool **Fire** `get`
*Return true if primary fire is pressed (Mouselook Mode).*
* Lua
```lua
fireIsPressed = Space.Input.Fire
```
* Lua
```lua
--Create a GameObject from resource when Primary Fire button is pressed
--[Add resource "bullet" as a resource in scripting runtime component]
thisGameObject = Space.Host.ExecutingObject
bullet = Space.GetResource("bullet")
OnUpdate = function()
if Space.Input.Fire then
Space.Scene.CreateGameObject(bullet)
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### AltFire[β](#altfire "Direct link to AltFire")
bool **AltFire** `get`
*Return true if alternative fire is pressed (Mouselook Mode)*
* Lua
```lua
altFireIsPressed = Space.Input.AltFire
```
* Lua
```lua
--Create a GameObject from resource when Alternate Fire button is pressed
--[Add resource "bullet" as a resource in scripting runtime component]
thisGameObject = Space.Host.ExecutingObject
bullet = Space.GetResource("bullet")
OnUpdate = function()
if Space.Input.AltFire then
Space.Scene.CreateGameObject(bullet)
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### CursorInUI[β](#cursorinui "Direct link to CursorInUI")
bool **CursorInUI** `get`
*Returns true if the cursor is over the Sinespace UI.*
* Lua
```lua
cursorInUI = Space.Input.CursorInUI
```
* Lua
```lua
--this object is going to listen to your scroll wheel movement and move accordingly
--UNLESS your cursor is on the sinespace UI
--(Example: Scrolling chat won't also move the object)
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.CursorInUI == false then
thisGameObject.WorldPosition = thisGameObject.WorldPosition + (thisGameObject.Up * Space.Input.ScrollWheel)
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### IsVRAvailable[β](#isvravailable "Direct link to IsVRAvailable")
bool **IsVRAvailable** `get`
*Returns true if VR is available.*
* Lua
```lua
isAvailable = Space.Input.IsVRAvailable
```
##### IsVRActive[β](#isvractive "Direct link to IsVRActive")
bool **IsVRActive** `get`
*Returns true if VR is active.*
* Lua
```lua
turnAxis = Space.Input.TurnAxis
```
##### **VRLeftControllerPosition**[β](#vrleftcontrollerposition "Direct link to vrleftcontrollerposition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md)? **VRLeftControllerPosition** `get`
*Returns position of Left VR Controller.*
* Lua
```lua
posVRleft = Space.Input.VRLeftControllerPosition
```
##### **VRRightControllerPosition**[β](#vrrightcontrollerposition "Direct link to vrrightcontrollerposition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md)? **VRRightControllerPosition** `get`
*Returns position of Right VR Controller.*
* Lua
```lua
posVRright = Space.Input.VRRightControllerPosition
```
##### **VRLeftControllerRotation**[β](#vrleftcontrollerrotation "Direct link to vrleftcontrollerrotation")
[SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md)? **VRLeftControllerRotation** `get`
*Returns rotation of Left VR Controller.*
* Lua
```lua
rotVRleft = Space.Input.VRLeftControllerRotation
```
##### **VRRightControllerRotation**[β](#vrrightcontrollerrotation "Direct link to vrrightcontrollerrotation")
[SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md)? **VRRightControllerRotation** `get`
*Returns rotation of Right VR Controller.*
* Lua
```lua
rotVRright = Space.Input.VRRightControllerRotation
```
#### Input Key Names[β](#input-key-names "Direct link to Input Key Names")
Key names follow these naming conventions:
| **Key family** | **Naming convention** |
| -------------- | ------------------------------------------------------------------------------------------------------------------- |
| Letter keys | `a`, `b`, `c`β¦ |
| Number keys | `1`, `2`, `3`β¦ |
| Arrow keys | `up`, `down`, `left`, `right` |
| Numpad keys | `[1]`, `[2]`, `[3]`, `[+]`, `[equals]`β¦ |
| Modifier keys | `right shift`, `left shift`, `right ctrl`, `left ctrl`, `right alt`, `left alt`, `right cmd`, `left cmd` |
| Special keys | `backspace`, `tab`, `return`, `escape`, `space`, `delete`, `enter`, `insert`, `home`, `end`, `page up`, `page down` |
| Function keys | `f1`, `f2`, `f3`β¦ |
Mouse buttons are named `mouse 0, mouse 1, mouse 2,` and so on.
Joystick buttons follow these naming conventions:
| **Button origin** | **Naming convention** |
| ---------------------------------------- | -------------------------------------------------------------------- |
| A specific button on any joystick | `joystick button 0`, `joystick button 1`, `joystick button 2`β¦ |
| A specific button on a specific joystick | `joystick 1 button 0`, `joystick 1 button 1`, `joystick 2 button 0`β¦ |
---
### SShared
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetGlobal**](sshared#setglobal)(string ns, string key, DynValue value) |
| void [**SetSuperGlobal**](sshared#setsuperglobal)(string ns, string key, DynValue value) |
| DynValue [**GetGlobal**](sshared#getglobal)(string ns, string key) |
| DynValue [**GetSuperGlobal**](sshared#getsuperglobal)(string ns, string key) |
| void [**RegisterFunction**](sshared#registerfunction)(string ns, string func, Closure reference) |
| void [**RegisterBroadcastFunction**](sshared#registerbroadcastfunction)(string ns, string func, Closure reference) |
| void [**UnregisterBroadcastFunction**](sshared#unregisterbroadcastfunction)(string ns, string func, Closure reference)void [**UnregisterBroadcastFunction**](sshared#unregisterbroadcastfunction)(string ns, string func) |
| void [**CallFunction**](sshared#callfunction)(string ns, string func, IEnumerable< DynValue > args) |
| void [**CallBroadcastFunction**](sshared#callbroadcastfunction)(string ns, string func, IEnumerable< DynValue > args) |
#### Functions[β](#functions "Direct link to Functions")
##### SetGlobal[β](#setglobal "Direct link to SetGlobal")
void **SetGlobal**(string ns, string key, DynValue value)
*Sets a global key to a value. The value can be any object type.*
| Parameter | Type | Description |
| --------- | -------- | ----------- |
| ns | string | |
| key | string | |
| value | DynValue | |
* Lua
```lua
Space.Shared.SetGlobal("com.someNameHere.world", "version", "1.02");
```
* Lua
```lua
-- This one script placed on a multiple number of objects will track the number
-- of clicks user has made using a Global Variable
-- note: the GetGlobal/SetGlobal functions are client side
thisObject = Space.Host.ExecutingObject
namespace = "com.example.shared"
key = "clicktracker"
OnClick = function()
local currentClicks = Space.Shared.GetGlobal(namespace, key)
if currentClicks == nil then
currentClicks = 1
else
currentClicks = currentClicks + 1
end
Space.Shared.SetGlobal(namespace, key, currentClicks)
Space.Log("Total Clicks = " .. currentClicks)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### SetSuperGlobal[β](#setsuperglobal "Direct link to SetSuperGlobal")
void **SetSuperGlobal**(string ns, string key, DynValue value)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Shared.SetSuperGlobal("com.someNameHere.world", "version", "1.02");
```
* Lua
```lua
example 2
```
##### GetGlobal[β](#getglobal "Direct link to GetGlobal")
DynValue **GetGlobal**(string ns, string key)
*Retrieves a previously set global variable, or returns nil.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
versionValue = Space.Shared.GetGlobal("com.someNameHere.world", "version")
```
* Lua
```lua
-- This one script placed on a multiple number of objects will track the number
-- of clicks user has made using a Global Variable
-- note: the GetGlobal/SetGlobal functions are client side
thisObject = Space.Host.ExecutingObject
namespace = "com.example.shared"
key = "clicktracker"
OnClick = function()
local currentClicks = Space.Shared.GetGlobal(namespace, key)
if currentClicks == nil then
currentClicks = 1
else
currentClicks = currentClicks + 1
end
Space.Shared.SetGlobal(namespace, key, currentClicks)
Space.Log("Total Clicks = " .. currentClicks)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GetSuperGlobal[β](#getsuperglobal "Direct link to GetSuperGlobal")
DynValue **GetSuperGlobal**(string ns, string key)
*Retrieves a previously set super global variable, or returns nil.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
versionValue = Space.Shared.GetSuperGlobal("com.someNameHere.world", "version");
```
* Lua
```lua
--these two scripts are in two different regions but script B will know that you came from A
--REGION A script
username = Space.Scene.PlayerAvatar.Username
region = Space.Scene.Name
Space.Shared.SetSuperGlobal (username, "Last Location", region)
--REGION B script
username = Space.Scene.PlayerAvatar.Username
region = Space.Shared.GetSuperGlobal (username, "Last Location")
Space.Dialogues.SendLocalChat ("You have arrived from ".. region, "Last Location")
```
##### RegisterFunction[β](#registerfunction "Direct link to RegisterFunction")
void **RegisterFunction**(string ns, string func, Closure reference)
*Makes func into a global function that can be accessed anywhere.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function someFunction(name)
Space.Log("Hello " .. name);
end
Space.Shared.RegisterFunction("com.someNameHere.world", "func", someFunction);
```
* Lua
```lua
--Script placed on object A will allow other objects to call one of it's registered functions when clicked
--Script in Object A
thisObject = Space.Host.ExecutingObject
namespace = "com.example.shared"
LogFunction = function(Parameter)
Space.Log("I've been called with parameter: " .. Parameter)
end
Space.Shared.RegisterFunction(namespace, "Log", LogFunction)
-- Script in Other Objects
thisObject = Space.Host.ExecutingObject
namespace = "com.example.shared"
OnClick = function()
Space.Shared.CallFunction(namespace, "Log", {"Example"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### RegisterBroadcastFunction[β](#registerbroadcastfunction "Direct link to RegisterBroadcastFunction")
void **RegisterBroadcastFunction**(string ns, string func, Closure reference)
*Makes func into a global function that can be accessed anywhere.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function someFunction(name)
Space.Log("Hello " .. name);
end
Space.Shared.RegisterBroadcastFunction("com.someNameHere.world", "func", someFunction);
```
##### UnregisterBroadcastFunction[β](#unregisterbroadcastfunction "Direct link to UnregisterBroadcastFunction")
void **UnregisterBroadcastFunction**(string ns, string func, Closure reference) void **UnregisterBroadcastFunction**(string ns, string func)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Script A: Receiver
function someFunction(status)
if status == "start"
then Space.Log("Do receiver 1 procedures.")
end
end
Space.Shared.RegisterBroadcastFunction("com.someNameHere.world", "func", someFunction);
-- Script B: Another Receiver
function someFunction(status)
if status == "start"
then Space.Log("Do receiver 2 procedures.")
end
end
Space.Shared.RegisterBroadcastFunction("com.someNameHere.world", "func", someFunction);
--Script C: Sender
local ball = Space.Host.ExecutingObject;
ball.SubscribeToEvents();
function onDown()
local queue = Space.Shared.CallBroadcastFunction("com.someNameHere.world", "func", {"start"});
Space.Log("number in queue: " .. queue);
Space.Shared.UnregisterBroadcastFunction("com.someNameHere.world", "func", someFunction);
Space.Log("UnregisterBroadcastFunction");
end
ball.OnMouseDown(onDown);
```
##### CallFunction[β](#callfunction "Direct link to CallFunction")
void **CallFunction**(string ns, string func, IEnumerable< DynValue > args)
*Calls the registered function with the specified arguments.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Shared.CallFunction("com.someNameHere.world", "func",{"Smith"});
```
* Lua
```lua
--Script placed on object A will allow other objects to call one of it's registered functions when clicked
--Script in Object A
thisObject = Space.Host.ExecutingObject
namespace = "com.example.shared"
LogFunction = function(Parameter)
Space.Log("I've been called with parameter: " .. Parameter)
end
Space.Shared.RegisterFunction(namespace, "Log", LogFunction)
-- Script in Other Objects
thisObject = Space.Host.ExecutingObject
namespace = "com.example.shared"
OnClick = function()
Space.Shared.CallFunction(namespace, "Log", {"Example"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### CallBroadcastFunction[β](#callbroadcastfunction "Direct link to CallBroadcastFunction")
void **CallBroadcastFunction**(string ns, string func, IEnumerable< DynValue > args)
*Makes func into a global function that can be accessed anywhere.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function someFunction(name)
Space.Log("Hello " .. name);
end
Space.Shared.RegisterBroadcastFunction("com.someNameHere.world", "func", someFunction);
```
---
### SUI
#### Functions[β](#functions "Direct link to Functions")
##### AddNotification[β](#addnotification "Direct link to AddNotification")
void **AddNotification** (string title, string text)
*Shows a notification*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.UI.AddNotification('Warning','This is a notification')
```
* Lua
```lua
--This script will send a notification every time a new player joins region
--including the users name
function sendNotification(Av)
Space.UI.AddNotification("New User","User joined: " .. Av.Username)
end
Space.Scene.OnPlayerJoin(sendNotification)
```
##### OpenAppearanceEditor[β](#openappearanceeditor "Direct link to OpenAppearanceEditor")
void **OpenAppearanceEditor**()
*Opens the Appearance Editor (Outfit)*
* Lua
```lua
Space.UI.OpenAppearanceEditor()
```
* Lua
```lua
--This script will make a button open the Appearance Editor
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
OnClick = function()
Space.UI.OpenAppearanceEditor()
end
theButton.UIButton.OnClick(OnClick)
```
##### ShowPathToLocation[β](#showpathtolocation "Direct link to ShowPathToLocation")
void **ShowPathToLocation** (string reason, [SVector](/scripting/client-scripting-api-reference/types/svector.md) location)
*Shows a path to given location*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.UI.ShowPathToLocation("A Reason", aLocation)
```
##### ShowLocation[β](#showlocation "Direct link to ShowLocation")
void **ShowLocation** (string reason, [SVector](/scripting/client-scripting-api-reference/types/svector.md) location)
*Shows given location*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.UI.ShowLocation("the reason", aLocation)
```
##### AddGlobalActionButton[β](#addglobalactionbutton "Direct link to AddGlobalActionButton")
void **AddGlobalActionButton** (string button, string tooltip, Closure action)
Adds a "Global Action Button" which is a custom button you add to the UI that calls an action of your choice then clears after being clicked
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.UI.AddGlobalActionButton("Button 1", "Stand Up", aFunction)
```
##### ClearGlobalActionButton[β](#clearglobalactionbutton "Direct link to ClearGlobalActionButton")
void **ClearGlobalActionButton** (string button)
*Clears a previously added Global Action Button 'button'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.UI.ClearGlobalActionButton("The Button")
```
* Lua
```lua
--This script will make this object make you dance when clicked
--and also show a Global Action button to let you stop the dance (and clear that button)
--[required: Add the dance animation to the Scripting Runtime's "Resources" section with name "dance"]
thisObj = Space.Host.ExecutingObject
danceAnim = Space.GetResource("dance")
isDancing = false
gbClick = function()
Space.Scene.PlayerAvatar.StopCustomAnimation()
Space.UI.ClearGlobalActionButton("Stop Dance")
isDancing = false
end
OnClick = function()
if not isDancing then
Space.Scene.PlayerAvatar.PlayCustomAnimation(danceAnim)
Space.UI.AddGlobalActionButton("Stop Dance","", gbClick)
isDancing = true
end
end
thisObj.AddClickable()
thisObj.Clickable.OnClick(OnClick)
```
##### OpenQuestsWindow[β](#openquestswindow "Direct link to OpenQuestsWindow")
void **OpenQuestsWindow** ()
*Opens the Quests window. *(white-label grid only)**
* Lua
```lua
Space.UI.OpenQuestsWindow()
```
* Lua
```lua
example --This script will make a button show/hide the Quests Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideQuestsWindow()
isShown = false
else
Space.UI.OpenQuestsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideQuestsWindow[β](#hidequestswindow "Direct link to HideQuestsWindow")
void **HideQuestsWindow** ()
*Hides the Quests window. *(white-label grid only)**
* Lua
```lua
Space.UI.HideQuestsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Quests Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideQuestsWindow()
isShown = false
else
Space.UI.OpenQuestsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenSettingsWindow[β](#opensettingswindow "Direct link to OpenSettingsWindow")
void **OpenSettingsWindow** ()
*Opens the Settings window. *(white-label grid only)**
* Lua
```lua
Space.UI.OpenSettingsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Settings Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideSettingsWindow()
isShown = false
else
Space.UI.OpenSettingsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideSettingsWindow[β](#hidesettingswindow "Direct link to HideSettingsWindow")
void **HideSettingsWindow** ()
*Hides the Settings window. *(white-label grid only)**
* Lua
```lua
Space.UI.HideSettingsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Settings Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideSettingsWindow()
isShown = false
else
Space.UI.OpenSettingsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenFriendsWindow[β](#openfriendswindow "Direct link to OpenFriendsWindow")
void **OpenFriendsWindow** ()
*Opens the Friends window. *(white-label grid only)**
* Lua
```lua
Space.UI.OpenFriendsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Friends Window--(example: tools for user to customize UI)--[You need to add a UI Button as a reference in the Scripting Runtime Component]theButton = Space.Host.GetReference('TheButton')local isShown = falseOnClick = function() if isShown then Space.UI.HideFriendsWindow() isShown = false else Space.UI.OpenFriendsWindow() isShown = true endendtheButton.UIButton.OnClick(OnClick)
HideFriendsWindow
```
##### HideFriendsWindow[β](#hidefriendswindow "Direct link to HideFriendsWindow")
void **HideFriendsWindow** ()
*Hides the Friends window. *(white-label grid only)**
* Lua
```lua
Space.UI.HideFriendsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Friends Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideFriendsWindow()
isShown = false
else
Space.UI.OpenFriendsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenExploreWindow[β](#openexplorewindow "Direct link to OpenExploreWindow")
void **OpenExploreWindow** ()
*Opens the Explore window. *(white-label grid only)**
* Lua
```lua
Space.UI.OpenExploreWindow()
```
* Lua
```lua
--This script will make a button show/hide the Explore Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideExploreWindow()
isShown = false
else
Space.UI.OpenExploreWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideExploreWindow[β](#hideexplorewindow "Direct link to HideExploreWindow")
void **HideExploreWindow** ()
*Hides the Explore window (white-label grid only)*
* Lua
```lua
Space.UI.HideExploreWindow()
```
* Lua
```lua
--This script will make a button show/hide the Explore Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideExploreWindow()
isShown = false
else
Space.UI.OpenExploreWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenEventsWindow[β](#openeventswindow "Direct link to OpenEventsWindow")
void **OpenEventsWindow** ()
*Opens the Events window (white-label grid only)*
* Lua
```lua
Space.UI.OpenEventsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Events Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideEventsWindow()
isShown = false
else
Space.UI.OpenEventsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideEventsWindow[β](#hideeventswindow "Direct link to HideEventsWindow")
void **HideEventsWindow** ()
*Hides the Events window (white-label grid only)*
* Lua
```lua
Space.UI.HideEventsWindow()
```
* Lua
```lua
--This script will make a button show/hide the Events Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideEventsWindow()
isShown = false
else
Space.UI.OpenEventsWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenHomeWindow[β](#openhomewindow "Direct link to OpenHomeWindow")
void **OpenHomeWindow** ()
*Opens the Home window (white-label grid only)*
* Lua
```lua
Space.UI.OpenHomeWindow()
```
* Lua
```lua
--This script will make a button show/hide the Home Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideHomeWindow()
isShown = false
else
Space.UI.OpenHomeWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideHomeWindow[β](#hidehomewindow "Direct link to HideHomeWindow")
void **HideHomeWindow** ()
*Hides the Home window (white-label grid only)*
* Lua
```lua
Space.UI.HideHomeWindow()
```
* Lua
```lua
--This script will make a button show/hide the Home Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideHomeWindow()
isShown = false
else
Space.UI.OpenHomeWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenInventoryWindow[β](#openinventorywindow "Direct link to OpenInventoryWindow")
void **OpenInventoryWindow** ()
*Opens the Inventory window (white-label grid only)*
* Lua
```lua
Space.UI.OpenInventoryWindow()
```
* Lua
```lua
--This script will make a button show/hide the Inventory Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideInventoryWindow()
isShown = false
else
Space.UI.OpenInventoryWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideInventoryWindow[β](#hideinventorywindow "Direct link to HideInventoryWindow")
void **HideInventoryWindow** ()
*Hides the Inventory window (white-label grid only)*
* Lua
```lua
Space.UI.HideInventoryWindow()
```
* Lua
```lua
--This script will make a button show/hide the Inventory Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideInventoryWindow()
isShown = false
else
Space.UI.OpenInventoryWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenOutfitWindow[β](#openoutfitwindow "Direct link to OpenOutfitWindow")
void **OpenOutfitWindow** ()
*Opens the Outfit window (white-label grid only)*
* Lua
```lua
Space.UI.OpenOutfitWindow()
```
* Lua
```lua
--This script will make a button show/hide the Outfit Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideOutfitWindow()
isShown = false
else
Space.UI.OpenOutfitWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideOutfitWindow[β](#hideoutfitwindow "Direct link to HideOutfitWindow")
void **HideOutfitWindow** ()
*Hides the Outfit window (white-label grid only)*
* Lua
```lua
Space.UI.HideOutfitWindow()
```
* Lua
```lua
--This script will make a button show/hide the Outfit Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideOutfitWindow()
isShown = false
else
Space.UI.OpenOutfitWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenShopWindow[β](#openshopwindow "Direct link to OpenShopWindow")
void **OpenShopWindow** ()
*Opens the Shop window (white-label grid only)*
* Lua
```lua
Space.UI.OpenShopWindow()
```
* Lua
```lua
--This script will make a button show/hide the Shop Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideShopWindow()
isShown = false
else
Space.UI.OpenShopWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideShopWindow[β](#hideshopwindow "Direct link to HideShopWindow")
void **HideShopWindow** ()
*Hides the Shop window (white-label grid only)*
* Lua
```lua
Space.UI.HideShopWindow()
```
* Lua
```lua
--This script will make a button show/hide the Shop Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideShopWindow()
isShown = false
else
Space.UI.OpenShopWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenSnapshotWindow[β](#opensnapshotwindow "Direct link to OpenSnapshotWindow")
void **OpenSnapshotWindow** ()
*Opens the Snapshot window (white-label grid only)*
* Lua
```lua
Space.UI.OpenSnapshotWindow()
```
* Lua
```lua
--This script will make a button show/hide the Snapshot Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideSnapshotWindow()
isShown = false
else
Space.UI.OpenSnapshotWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideSnapshotWindow[β](#hidesnapshotwindow "Direct link to HideSnapshotWindow")
void **HideSnapshotWindow** ()
*Hides the Snapshot window (white-label grid only)*
* Lua
```lua
Space.UI.HideSnapshotWindow()
```
* Lua
```lua
--This script will make a button show/hide the Snapshot Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideSnapshotWindow()
isShown = false
else
Space.UI.OpenSnapshotWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenHelpWindow[β](#openhelpwindow "Direct link to OpenHelpWindow")
void **OpenHelpWindow** ()
*Opens the Help window (white-label grid only)*
* Lua
```lua
Space.UI.OpenHelpWindow()
```
* Lua
```lua
--This script will make a button show/hide the Help Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideHelpWindow()
isShown = false
else
Space.UI.OpenHelpWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideHelpWindow[β](#hidehelpwindow "Direct link to HideHelpWindow")
void **HideHelpWindow** ()
*Hides the Help window (white-label grid only)*
* Lua
```lua
Space.UI.HideHelpWindow()
```
* Lua
```lua
--This script will make a button show/hide the Help Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideHelpWindow()
isShown = false
else
Space.UI.OpenHelpWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenProfileWin[β](#openprofilewin "Direct link to OpenProfileWin")
void **OpenProfileWin** ()
*Opens the Profile window (white-label grid only)*
* Lua
```lua
Space.UI.OpenProfileWin()
```
* Lua
```lua
--This script will make a button show/hide the Profile Win
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideProfileWindow()
isShown = false
else
Space.UI.OpenProfileWin()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideProfileWindow[β](#hideprofilewindow "Direct link to HideProfileWindow")
void **HideProfileWindow**()
*Hides the Profile window (white-label grid only)*
* Lua
```lua
Space.UI.HideProfileWindow()
```
* Lua
```lua
--This script will make a button show/hide the Profile Win
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideProfileWindow()
isShown = false
else
Space.UI.OpenProfileWin()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenUpgradeAccountWindow[β](#openupgradeaccountwindow "Direct link to OpenUpgradeAccountWindow")
void **OpenUpgradeAccountWindow** ()
*Opens the Upgrade Account window (white-label grid only)*
* Lua
```lua
Space.UI.OpenUpgradeAccountWindow()
```
* Lua
```lua
--This script will make a button show/hide the Upgrade Account Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideUpgradeAccountWindow()
isShown = false
else
Space.UI.OpenUpgradeAccountWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideUpgradeAccountWindow[β](#hideupgradeaccountwindow "Direct link to HideUpgradeAccountWindow")
void **HideUpgradeAccountWindow** ()
*Hides the Upgrade Account window (white-label grid only)*
* Lua
```lua
Space.UI.HideUpgradeAccountWindow()
```
* Lua
```lua
--This script will make a button show/hide the Upgrade Account Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideUpgradeAccountWindow()
isShown = false
else
Space.UI.OpenUpgradeAccountWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenRegionInfoWindow[β](#openregioninfowindow "Direct link to OpenRegionInfoWindow")
void **OpenRegionInfoWindow** ()
*Opens the Region Info window (white-label grid only)*
* Lua
```lua
Space.UI.OpenRegionInfoWindow()
```
* Lua
```lua
--This script will make a button show/hide the Region Info Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideRegionInfoWindow()
isShown = false
else
Space.UI.OpenRegionInfoWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideRegionInfoWindow[β](#hideregioninfowindow "Direct link to HideRegionInfoWindow")
void **HideRegionInfoWindow** ()
*Hides the Region Info window (white-label grid only)*
* Lua
```lua
Space.UI.HideRegionInfoWindow()
```
* Lua
```lua
--This script will make a button show/hide the Region Info Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideRegionInfoWindow()
isShown = false
else
Space.UI.OpenRegionInfoWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenExitWindow[β](#openexitwindow "Direct link to OpenExitWindow")
void **OpenExitWindow** ()
*Opens the Exit window (white-label grid only)*
* Lua
```lua
Space.UI.OpenExitWindow()
```
* Lua
```lua
--This script will make a button show/hide the Exit Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideExitWindow()
isShown = false
else
Space.UI.OpenExitWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideExitWindow[β](#hideexitwindow "Direct link to HideExitWindow")
void **HideExitWindow** ()
*Hides the Exit window (white-label grid only)*
* Lua
```lua
Space.UI.HideExitWindow()
```
* Lua
```lua
--This script will make a button show/hide the Exit Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideExitWindow()
isShown = false
else
Space.UI.OpenExitWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenMailWindow[β](#openmailwindow "Direct link to OpenMailWindow")
void **OpenMailWindow** ()
*Opens the Mail window (white-label grid only)*
* Lua
```lua
Space.UI.OpenMailWindow()
```
* Lua
```lua
--This script will make a button show/hide the Mail Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideMailWindow()
isShown = false
else
Space.UI.OpenMailWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideMailWindow[β](#hidemailwindow "Direct link to HideMailWindow")
void **HideMailWindow** ()
*Hides the Mail window (white-label grid only)*
* Lua
```lua
Space.UI.HideMailWindow()
```
* Lua
```lua
--This script will make a button show/hide the Mail Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideMailWindow()
isShown = false
else
Space.UI.OpenMailWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenFeedbackWindow[β](#openfeedbackwindow "Direct link to OpenFeedbackWindow")
void **OpenFeedbackWindow** ()
*Shows the Feedback window (white-label grid only)*
* Lua
```lua
Space.UI.OpenFeedbackWindow()
```
* Lua
```lua
--This script will make a button show/hide the Feedback Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideFeedbackWindow()
isShown = false
else
Space.UI.OpenFeedbackWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideFeedbackWindow[β](#hidefeedbackwindow "Direct link to HideFeedbackWindow")
void **HideFeedbackWindow** ()
*Hides the Feedback window (white-label grid only)*
* Lua
```lua
Space.UI.HideFeedbackWindow()
```
* Lua
```lua
--This script will make a button show/hide the Mail Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideFeedbackWindow()
isShown = false
else
Space.UI.OpenFeedbackWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenBuyGoldWindow[β](#openbuygoldwindow "Direct link to OpenBuyGoldWindow")
void **OpenBuyGoldWindow** ()
*Opens the Buy Gold window (white-label grid only)*
* Lua
```lua
Space.UI.OpenBuyGoldWindow()
```
* Lua
```lua
--This script will make a button show/hide the Buy Gold Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideBuyGoldWindow()
isShown = false
else
Space.UI.OpenBuyGoldWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideBuyGoldWindow[β](#hidebuygoldwindow "Direct link to HideBuyGoldWindow")
void **HideBuyGoldWindow** ()
*Hides the Buy Gold window (white-label grid only)*
* Lua
```lua
Space.UI.HideBuyGoldWindow()
```
* Lua
```lua
--This script will make a button show/hide the Buy Gold Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideBuyGoldWindow()
isShown = false
else
Space.UI.OpenBuyGoldWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenChatWindow[β](#openchatwindow "Direct link to OpenChatWindow")
void **OpenChatWindow** ()
*Opens the Chat window (white-label grid only)*
* Lua
```lua
Space.UI.OpenChatWindow()
```
* Lua
```lua
--This script will make a button show/hide the Chat Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideChatWindow()
isShown = false
else
Space.UI.OpenChatWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideChatWindow[β](#hidechatwindow "Direct link to HideChatWindow")
void **HideChatWindow** ()
*Hides the Chat window (white-label grid only)*
* Lua
```lua
Space.UI.HideChatWindow()
```
* Lua
```lua
--This script will make a button show/hide the Chat Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = true
OnClick = function()
if isShown then
Space.UI.HideChatWindow()
isShown = false
else
Space.UI.OpenChatWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenRoomEditorWindow[β](#openroomeditorwindow "Direct link to OpenRoomEditorWindow")
void **OpenRoomEditorWindow** ()
*Opens the Room Editor window (white-label grid only)*
* Lua
```lua
Space.UI.OpenRoomEditorWindow()
```
* Lua
```lua
--This script will make a button show/hide the Room Editor Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideRoomEditorWindow()
isShown = false
else
Space.UI.OpenRoomEditorWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### HideRoomEditorWindow[β](#hideroomeditorwindow "Direct link to HideRoomEditorWindow")
void **HideRoomEditorWindow** ()
*Hides the Room Editor window (white-label grid only)*
* Lua
```lua
Space.UI.HideRoomEditorWindow()
```
* Lua
```lua
--This script will make a button show/hide the Room Editor Window
--(example: tools for user to customize UI)
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
local isShown = false
OnClick = function()
if isShown then
Space.UI.HideRoomEditorWindow()
isShown = false
else
Space.UI.OpenRoomEditorWindow()
isShown = true
end
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenDevicePicker[β](#opendevicepicker "Direct link to OpenDevicePicker")
void **OpenDevicePicker** ()
*Opens the Device Picker*
* Lua
```lua
Space.UI.OpenDevicePicker()
```
* Lua
```lua
--This script will make a button open the Device Picker
--[You need to add a UI Button as a reference in the Scripting Runtime Component]
theButton = Space.Host.GetReference('TheButton')
OnClick = function()
Space.UI.OpenDevicePicker()
end
theButton.UIButton.OnClick(OnClick)
```
##### OpenDeviceTester[β](#opendevicetester "Direct link to OpenDeviceTester")
void **OpenDeviceTester** ()
*Opens the Device Tester*
* Lua
```lua
Space.UI.OpenDeviceTester()
```
##### Raycast[β](#raycast "Direct link to Raycast")
SUIRaycastResult **Raycast** ()
*Shoots a UI Raycast and returns the result as SUIRayCastResult*
* Lua
```lua
RayCastResult = Space.UI.Raycast()
```
* Lua
```lua
--This script will update a UIText element with the result of a UIRaycast whenever...
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.ToString()
end
end
end
thisObject.OnUpdate(OnUpdate)
```
#### Properties[β](#properties "Direct link to Properties")
##### ShowUI[β](#showui "Direct link to ShowUI")
bool **ShowUI** `get` `set`
*Show the User Interface*
* Lua
```lua
Space.UI.ShowUI = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide theUser Interface
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowUI= true
else
Space.UI.ShowUI= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowWorldUI[β](#showworldui "Direct link to ShowWorldUI")
bool **ShowWorldUI** `get` `set`
*Show the World User Interface.*
* Lua
```lua
Space.UI.ShowWorldUI = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the World UI
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowWorldUI= true
else
Space.UI.ShowWorldUI= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### MusicVolume[β](#musicvolume "Direct link to MusicVolume")
int **MusicVolume** `get` `set`
*Set/Get the Music volume (set: white-label grid only)*
* Lua
```lua
MusicVolume = Space.UI.MusicVolume
```
* Lua
```lua
--This script will make moving a slider control the Music Volume
--and also update a text field with the current Music Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.MusicVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MusicVolume
end
slider.OnValueChanged(OnValueChanged)
```
##### MasterVolume[β](#mastervolume "Direct link to MasterVolume")
int **MasterVolume** `get` `set`
*Set/Get the Master volume (set: white-label grid only)*
* Lua
```lua
MasterVolume = Space.UI.MasterVolume
```
* Lua
```lua
--This script will make moving a slider control the Master Volume
--and also update a text field with the current Master Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.MasterVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MasterVolume
end
slider.OnValueChanged(OnValueChanged)
```
##### SFXVolume[β](#sfxvolume "Direct link to SFXVolume")
int **SFXVolume** `get` `set`
*Set/Get the SFX volume (set: white-label grid only)*
* Lua
```lua
SFXVolume = Space.UI.SFXVolume
```
* Lua
```lua
--This script will make moving a slider control the SFX Volume
--and also update a text field with the current SFX Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.SFXVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.SFXVolume
end
slider.OnValueChanged(OnValueChanged)
```
##### UIVolume[β](#uivolume "Direct link to UIVolume")
int **UIVolume** `get` `set`
*Set/Get the UI volume (set: white-label grid only)*
* Lua
```lua
UIVolume = Space.UI.UIVolume
```
* Lua
```lua
--This script will make moving a slider control the UI Volume
--and also update a text field with the current UI Volume
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.UIVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.UIVolume
end
slider.OnValueChanged(OnValueChanged)
```
##### VOIPVolume[β](#voipvolume "Direct link to VOIPVolume")
int **VOIPVolume** `get` `set`
*Set/Get the VOIP volume (set: white-label grid only)*
* Lua
```lua
VOIPVolume = Space.UI.VOIPVolume
```
* Lua
```lua
--This script will make moving a slider control the Voice Volume
--and also update a text field with the current Voice Volume
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.VOIPVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.VOIPVolume
end
slider.OnValueChanged(OnValueChanged)
```
##### ShowFriendsButton[β](#showfriendsbutton "Direct link to ShowFriendsButton")
bool **ShowFriendsButton** `get` `set`
*Show the Friends button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowFriendsButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Friends Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowFriendsButton = true
else
Space.UI.ShowFriendsButton = false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowExploreButton[β](#showexplorebutton "Direct link to ShowExploreButton")
bool **ShowExploreButton** `get` `set`
*Show the Explore button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowExploreButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Explore Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowExploreButton = true
else
Space.UI.ShowExploreButton = false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowQuestsButton[β](#showquestsbutton "Direct link to ShowQuestsButton")
bool **ShowQuestsButton** `get` `set`
*Show the Quests button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowQuestsButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Quests button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowQuestsButton= true
else
Space.UI.ShowQuestsButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowInventoryButton[β](#showinventorybutton "Direct link to ShowInventoryButton")
bool **ShowInventoryButton** `get` `set`
*Show the Inventory button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowInventoryButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Inventory Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowInventoryButton= true
else
Space.UI.ShowInventoryButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowOutfitButton[β](#showoutfitbutton "Direct link to ShowOutfitButton")
bool **ShowOutfitButton** `get` `set`
*Set to true to show the Outfit button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowOutfitButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Outfit Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowOutfitButton= true
else
Space.UI.ShowOutfitButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowShopButton[β](#showshopbutton "Direct link to ShowShopButton")
bool **ShowShopButton** `get` `set`
*Show the Shop button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowShopButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Shop Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowShopButton= true
else
Space.UI.ShowShopButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowAuctionButton[β](#showauctionbutton "Direct link to ShowAuctionButton")
bool **ShowAuctionButton** `get` `set`
*Show the Auction button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowAuctionButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Auction Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowAuctionButton = true
else
Space.UI.ShowAuctionButton = false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowSnapshotButton[β](#showsnapshotbutton "Direct link to ShowSnapshotButton")
bool **ShowSnapshotButton** `get` `set`
*Show the Snapshot button.*(white-label grid only)\*\*
* Lua
```lua
Space.UI.ShowSnapshotButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Snapshot Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowSnapshotButton= true
else
Space.UI.ShowSnapshotButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowHelpButton[β](#showhelpbutton "Direct link to ShowHelpButton")
bool **ShowHelpButton** `get` `set`
*Show the Help button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowHelpButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Help Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowHelpButton= true
else
Space.UI.ShowHelpButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowCurrencyButton[β](#showcurrencybutton "Direct link to ShowCurrencyButton")
bool **ShowCurrencyButton** `get` `set`
*Show the Currency button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowCurrencyButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Currency Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowCurrencyButton= true
else
Space.UI.ShowCurrencyButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowGoldAndBuyButton[β](#showgoldandbuybutton "Direct link to ShowGoldAndBuyButton")
bool **ShowGoldAndBuyButton** `get` `set`
*Show the Gold and Buy button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowGoldAndBuyButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Gold and Buy button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowGoldAndBuyButton= true
else
Space.UI.ShowGoldAndBuyButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowChat[β](#showchat "Direct link to ShowChat")
bool **ShowChat** `get` `set`
*Show the Chat. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowChat = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Chat
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowChat= true
else
Space.UI.ShowChat= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowMiniMap[β](#showminimap "Direct link to ShowMiniMap")
bool **ShowMiniMap** `get` `set`
*Set to true to show the Minimap. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowMiniMap = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Minimap
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowMiniMap= true
else
Space.UI.ShowMiniMap= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowHotBar[β](#showhotbar "Direct link to ShowHotBar")
bool **ShowHotBar** `get` `set`
*Show the Hot Bar. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowHotBar = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Hot Bar
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowHotBar= true
else
Space.UI.ShowHotBar= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowEventsButton[β](#showeventsbutton "Direct link to ShowEventsButton")
bool **ShowEventsButton** `get` `set`
*Show the Events button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowEventsButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Events button
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowEventsButton= true
else
Space.UI.ShowEventsButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowHomeButton[β](#showhomebutton "Direct link to ShowHomeButton")
bool **ShowHomeButton** `get` `set`
*Show the Home button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowHomeButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Home Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowHomeButton= true
else
Space.UI.ShowHomeButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowActivityPanel[β](#showactivitypanel "Direct link to ShowActivityPanel")
bool **ShowActivityPanel** `get` `set`
*Show the Activity Panel. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowActivityPanel = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Activity Panel
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowActivityPanel= true
else
Space.UI.ShowActivityPanel= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowProfileImage[β](#showprofileimage "Direct link to ShowProfileImage")
bool **ShowProfileImage** `get` `set`
*Show the Profile Image. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowProfileImage = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Profile Image
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowProfileImage= true
else
Space.UI.ShowProfileImage= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowRightButtonGroup[β](#showrightbuttongroup "Direct link to ShowRightButtonGroup")
bool **ShowRightButtonGroup** `get` `set`
*Show the Right Button Group. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowRightButtonGroup = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Right Button Group
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowRightButtonGroup= true
else
Space.UI.ShowRightButtonGroup= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowRoomInfoOption[β](#showroominfooption "Direct link to ShowRoomInfoOption")
bool **ShowRoomInfoOption** `get` `set`
*Show the Room Info Option. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowRoomInfoOption = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Room Info Option
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowRoomInfoOption= true
else
Space.UI.ShowRoomInfoOption= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowSearch[β](#showsearch "Direct link to ShowSearch")
bool **ShowSearch** `get` `set`
*Show the Search bar. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowSearch = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Search Bar
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowSearch= true
else
Space.UI.ShowSearch= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowMailButton[β](#showmailbutton "Direct link to ShowMailButton")
bool **ShowMailButton** `get` `set`
*Show the Mail button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowMailButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Mail Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowMailButton = true
else
Space.UI.ShowMailButton = false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowNotificationButton[β](#shownotificationbutton "Direct link to ShowNotificationButton")
bool **ShowNotificationButton** `get` `set`
*Show the Notification button. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowNotificationButton = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Notification Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowNotificationButton= true
else
Space.UI.ShowNotificationButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### ShowClock[β](#showclock "Direct link to ShowClock")
bool **ShowClock** `get` `set`
*Show the clock. *(white-label grid only)**
* Lua
```lua
Space.UI.ShowClock = false
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Clock
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowClock= true
else
Space.UI.ShowClock= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
---
### Components
Components are the behaviours attached to scene objects. This section covers the full set client scripts can read and control β rendering, physics, audio, animation, UI, and interaction components.
---
### SAnimation
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SAnimationState [**GetState** ](sanimation#getstate)()SAnimationState [**GetState** ](sanimation#getstate)(string state) |
| void [**Blend** ](/scripting/client-scripting-api-reference/components/sanimation.md#blend)(string animation, float targetWeight=1.0F, float fadeLength=0.3F) |
| void [**CrossFade** ](/scripting/client-scripting-api-reference/components/sanimation.md#crossfade)(string animation, float fadeLength=0.3F) |
| SAnimationState [**CrossFadeQueued** ](/scripting/client-scripting-api-reference/components/sanimation.md#crossfadequeued)(string animation, float fadeLength=0.3F, bool playNow=false) |
| int [**GetClipCount** ](/scripting/client-scripting-api-reference/components/sanimation.md#getclipcount)() |
| bool [**IsPlaying** ](/scripting/client-scripting-api-reference/components/sanimation.md#isplaying)(string animation) |
| bool [**Play** ](sanimation#play)()bool [**Play** ](sanimation#play)(string animation) |
| SAnimationState [**PlayQueued** ](/scripting/client-scripting-api-reference/components/sanimation.md#playqueued)(string animation, bool playNow=false) |
| void [**Rewind** ](/scripting/client-scripting-api-reference/components/sanimation.md#rewind)(string animation) |
| void [**Sample** ](/scripting/client-scripting-api-reference/components/sanimation.md#sample)() |
| void [**Stop** ](sanimation#stop)()void [**Stop** ](sanimation#stop)(string animation) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------------ |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sanimation.md#enabled)`get` `set` |
| IDictionary< string, SAnimationState > [**States** ](/scripting/client-scripting-api-reference/components/sanimation.md#states)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetState[β](#getstate "Direct link to GetState")
[SAnimationState](/scripting/client-scripting-api-reference/types/sanimationstate.md) **GetState** () [SAnimationState](/scripting/client-scripting-api-reference/types/sanimationstate.md) **GetState** (string state)
*Returns the SAnimationState for the default animation clip.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
State = Space.Host.ExecutingObject.Animation.GetState()
State = Space.Host.ExecutingObject.Animation.GetState("statename")
```
##### Blend[β](#blend "Direct link to Blend")
void **Blend** (string animation, float targetWeight=1.0F, float fadeLength=0.3F)
*Blends the animation named animation towards targetWeight over the next time seconds. Playback of other animations will not be affected.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.Blend("animationname",1.0,0.3)
```
##### CrossFade[β](#crossfade "Direct link to CrossFade")
void **CrossFade** (string animation, float fadeLength=0.3F)
*Fades the animation with name animation in over a period of time seconds and fades other animations out.*
*If mode is PlayMode.StopSameLayer, animations in the same layer as animation will be faded out while animation is faded in. if mode is PlayMode.StopAll, all animations will be faded out while animation is faded in.*
*If the animation is not set to be looping it will be stopped and rewound after playing.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.CrossFade("animationname", 0.3)
```
##### CrossFadeQueued[β](#crossfadequeued "Direct link to CrossFadeQueued")
[SAnimationState](/scripting/client-scripting-api-reference/types/sanimationstate.md) **CrossFadeQueued** (string animation, float fadeLength=0.3F, bool playNow=false)
*Returns a duplicated SAnimationState. This duplicate will self-destruct after it is finished playing. Referencing it after it has completed will result in an error.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
NewSAnimationState = Space.Host.ExecutingObject.Animation.CrossFadeQueued("animationname", 0.3, false)
```
##### GetClipCount[β](#getclipcount "Direct link to GetClipCount")
int **GetClipCount** ()
*Get the number of clips currently assigned to this animation.*
* Lua
```lua
NumberOfClips = Space.Host.ExecutingObject.Animation.GetClipCount()
```
##### IsPlaying[β](#isplaying "Direct link to IsPlaying")
bool **IsPlaying** (string animation)
*Is the animation named name playing?*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
IsPlaying = Space.Host.ExecutingObject.Animation.IsPlaying("animationname")
```
##### Play[β](#play "Direct link to Play")
bool **Play** () bool **Play** (string animation)
*Plays an animation without any blending.*
*If no name is supplied then the default animation will be played. In cases where the animation can't be played (ie, there is no default animation or no animation with the specified name), the function will return false.*
*The optional playMode lets you choose how this animation will affect others already playing.*
*If the specified animation is already playing then other animations will be stopped but the animation will not rewind to the beginning.*
*When the end of the animation is reached it will automatically be stopped and rewound to the start unless the PlayMode is set to Loop.*
*Note that if you call Animation.Play on an object during a frame update where the object is also deactivated then the call will effectively be cancelled; the animation will not start playing when the object is later reactivated. However, if you make the call on a subsequent frame (ie, while the object is still inactive) then the animation will start playing after reactivation.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.Play()
Space.Host.ExecutingObject.Animation.Play("animationname")
```
##### PlayQueued[β](#playqueued "Direct link to PlayQueued")
[SAnimationState](/scripting/client-scripting-api-reference/types/sanimationstate.md) **PlayQueued** (string animation, bool playNow=false)
*Returns a duplicated SAnimationState. This duplicate will self-destruct after it is finished playing. Referencing it after it has completed will result in an error.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.PlayQueued("animationname","false")
```
##### Rewind[β](#rewind "Direct link to Rewind")
void **Rewind** (string animation)
*Rewinds the animation named name.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.Rewind()
```
##### Sample[β](#sample "Direct link to Sample")
void **Sample** ()
*Samples animations at the current state.*
*This is useful when you explicitly want to set up some animation state, and sample it once.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.Sample()
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** () void **Stop** (string animation)
*Stops all playing animations that were started with this Animation.*
*Stopping an animation also Rewinds it to the Start.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animation.Stop()
Space.Host.ExecutingObject.Animation.Stop("animationname")
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
Whether this component is enabled or not.
* Lua
```lua
Space.Host.ExecutingObject.Animation.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Animation component
thisGameObject = Space.Host.ExecutingObject
animation = thisGameObject.Animation
OnClick = function()
animation.Enabled = not animation.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### States[β](#states "Direct link to States")
IDictionary< string, [SAnimationState](/scripting/client-scripting-api-reference/types/sanimationstate.md) > **States** `get`
*Returns a table of* [*SAnimationState*](/scripting/client-scripting-api-reference/types/sanimationstate.md) *names and references*
* Lua
```lua
States = Space.Host.ExecutingObject.Animation.States
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Animation.GameObject
```
---
### SAnimator
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Rebind** ](/scripting/client-scripting-api-reference/components/sanimator.md#rebind)() |
| void [**Stop** ](/scripting/client-scripting-api-reference/components/sanimator.md#stop)() |
| void [**SetTime** ](/scripting/client-scripting-api-reference/components/sanimator.md#settime)(double time) |
| double [**GetTime** ](/scripting/client-scripting-api-reference/components/sanimator.md#gettime)() |
| double [**GetNormalizedTime** ](/scripting/client-scripting-api-reference/components/sanimator.md#getnormalizedtime)(int layer=0) |
| double [**GetLength** ](/scripting/client-scripting-api-reference/components/sanimator.md#getlength)(int layer=0) |
| bool [**GetLoop** ](/scripting/client-scripting-api-reference/components/sanimator.md#getloop)(int layer=0) |
| float [**GetFloat** ](sanimator#getfloat)(string name)float [**GetFloat** ](sanimator#getfloat)(int id) |
| bool [**GetBool** ](sanimator#getbool)(string name)bool [**GetBool** ](sanimator#getbool)(int id) |
| int [**GetInteger** ](sanimator#getinteger)(string name)int [**GetInteger** ](sanimator#getinteger)(int id) |
| void [**ResetTrigger** ](sanimator#resettrigger)(string name)void [**ResetTrigger** ](sanimator#resettrigger)(int id) |
| bool [**IsParameterControlledByCurve** ](sanimator#isparametercontrolledbycurve)(string name)bool [**IsParameterControlledByCurve** ](sanimator#isparametercontrolledbycurve)(int id) |
| string [**GetLayerName** ](/scripting/client-scripting-api-reference/components/sanimator.md#getlayername)(int layerIndex) |
| int [**GetLayerIndex** ](/scripting/client-scripting-api-reference/components/sanimator.md#getlayerindex)(string layerName) |
| float [**GetLayerWeight** ](/scripting/client-scripting-api-reference/components/sanimator.md#getlayerweight)(int layerIndex) |
| void [**SetLayerWeight** ](/scripting/client-scripting-api-reference/components/sanimator.md#setlayerweight)(int layerIndex, float weight) |
| bool [**IsInTransition** ](/scripting/client-scripting-api-reference/components/sanimator.md#isintransition)(int layerIndex) |
| void [**CrossFadeInFixedTime** ](sanimator#crossfadeinfixedtime)(string stateName, float transitionDuration, int layer)void [**CrossFadeInFixedTime** ](sanimator#crossfadeinfixedtime)(string stateName, float transitionDuration)void [**CrossFadeInFixedTime** ](sanimator#crossfadeinfixedtime)(string stateName, float transitionDuration, int layer, float fixedTime) |
| void [**CrossFade** ](sanimator#crossfade)(string stateName, float transitionDuration, int layer)void [**CrossFade** ](sanimator#crossfade)(string stateName, float transitionDuration)void [**CrossFade** ](sanimator#crossfade)(string stateName, float transitionDuration, int layer, float normalizedTime) |
| void [**PlayInFixedTime** ](sanimator#playinfixedtime)(string stateName, int layer)void [**PlayInFixedTime** ](sanimator#playinfixedtime)(string stateName)void [**PlayInFixedTime** ](sanimator#playinfixedtime)(string stateName, int layer, float fixedTime) |
| void [**Play** ](sanimator#play)(string stateName, int layer)void [**Play** ](sanimator#play)(string stateName)void [**Play** ](sanimator#play)(string stateName, int layer, float normalizedTime) |
| void [**StartPlayback** ](/scripting/client-scripting-api-reference/components/sanimator.md#startplayback)() |
| void [**StopPlayback** ](/scripting/client-scripting-api-reference/components/sanimator.md#stopplayback)() |
| void [**StartRecording** ](/scripting/client-scripting-api-reference/components/sanimator.md#startrecording)() |
| void [**StopRecording** ](/scripting/client-scripting-api-reference/components/sanimator.md#stoprecording)() |
| void [**Update** ](/scripting/client-scripting-api-reference/components/sanimator.md#update)(float deltaTime) |
| void [**SetTrigger** ](sanimator#settrigger)(string trigger)void [**SetTrigger** ](sanimator#settrigger)(int id) |
| void [**SetFloat** ](sanimator#setfloat)(string name, float value, float dampTime, float deltaTime)void [**SetFloat** ](sanimator#setfloat)(int id, float value)void [**SetFloat** ](sanimator#setfloat)(int id, float value, float dampTime, float deltaTime)void [**SetFloat** ](sanimator#setfloat)(string name, float value) |
| void [**SetBool** ](sanimator#setbool)(int id, bool value)void [**SetBool** ](sanimator#setbool)(string name, bool value) |
| void [**SetInteger** ](sanimator#setinteger)(string name, int value)void [**SetInteger** ](sanimator#setinteger)(int id, int value) |
| int [**StringToHash** ](/scripting/client-scripting-api-reference/components/sanimator.md#stringtohash)(string name) |
| SAnimatorStateInfo [**GetCurrentAnimatorStateInfo** ](/scripting/client-scripting-api-reference/components/sanimator.md#getcurrentanimatorstateinfo)(int Layerindex) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------- |
| SResource [**Controller** ](/scripting/client-scripting-api-reference/components/sanimator.md#controller)`get` `set` |
| SResource [**Avatar** ](/scripting/client-scripting-api-reference/components/sanimator.md#avatar)`get` `set` |
| bool [**ApplyRootMotion** ](/scripting/client-scripting-api-reference/components/sanimator.md#applyrootmotion)`get` `set` |
| float [**PlaybackTime** ](/scripting/client-scripting-api-reference/components/sanimator.md#playbacktime)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sanimator.md#enabled)`get` `set` |
| string\[] [**Parameters** ](/scripting/client-scripting-api-reference/components/sanimator.md#parameters)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Rebind[β](#rebind "Direct link to Rebind")
void **Rebind** ()
*Rebind all the animated properties and mesh data with the Animator.*
* Lua
```lua
Space.Host.ExecutingObject.Animator.Rebind()
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*Stop the Animator.*
* Lua
```lua
Space.Host.ExecutingObject.Animator.Stop()
```
##### SetTime[β](#settime "Direct link to SetTime")
void **SetTime** (double time)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.SetTime(1.0)
```
##### GetTime[β](#gettime "Direct link to GetTime")
double **GetTime** ()
*Function Description*
* Lua
```lua
layerStateTime = Space.Host.ExecutingObject.Animator.GetTime(0)
```
##### GetNormalizedTime[β](#getnormalizedtime "Direct link to GetNormalizedTime")
double **GetNormalizedTime** (int layer=0)
*Normalized time of the State. The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerStateNormalizedTime = Space.Host.ExecutingObject.Animator.GetNormalizedTime(0)
```
##### GetLength[β](#getlength "Direct link to GetLength")
double **GetLength** (int layer=0)
*Current duration of the state.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerStateLength = Space.Host.ExecutingObject.Animator.GetLength(1)
```
##### GetLoop[β](#getloop "Direct link to GetLoop")
bool **GetLoop** (int layer=0)
*Is the state looping.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerStateLoop = Space.Host.ExecutingObject.Animator.GetLoop(0)
```
##### GetFloat[β](#getfloat "Direct link to GetFloat")
float **GetFloat** (string name) float **GetFloat** (int id)
*Returns the value of the given float parameter. name: The name of the parameter.* *id: The id of the parameter.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
getParam = Space.Host.ExecutingObject.Animator.GetFloat("paramName")
-- or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("paramName")
getParam = Space.Host.ExecutingObject.Animator.GetFloat(paramID)
```
* Lua
```lua
--clicking the object will toggle it's Animator's "flySpeed" float parameter between 0.0 and 5.0
thisObject = Space.Host.ExecutingObject
OnClick = function()
if thisObject.Animator.GetFloat("flySpeed") == 0.0 then
thisObject.Animator.SetFloat("flySpeed", 5.0)
else
thisObject.Animator.SetFloat("flySpeed", 0.0)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
* Lua
```lua
--clicking the object will toggle it's Animator's "flySpeed" float parameter between 0.0 and 5.0
--this script uses parameter ID instead of string (StringToHash function gets the ID)
thisObject = Space.Host.ExecutingObject
paramID = thisObject.Animator.StringToHash("flySpeed")
OnClick = function()
if thisObject.Animator.GetFloat(paramID) == 0.0 then
thisObject.Animator.SetFloat(paramID, 5.0)
else
thisObject.Animator.SetFloat(paramID, 0.0)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GetBool[β](#getbool "Direct link to GetBool")
bool **GetBool** (string name) bool **GetBool** (int id)
*Returns the value of the given boolean parameter. name: The name of the parameter.* *id: The id of the parameter.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isFlying = Space.Host.ExecutingObject.Animator.GetBool("IsFlying")
--or
ID = Space.Host.ExecutingObject.Animator.StringToHash("isFlying")
isFlying = Space.Host.ExecutingObject.Animator.GetBool(ID)
```
* Lua
```lua
--clicking the object will toggle it's "isFlying" bool parameter between true and false
thisObject = Space.Host.ExecutingObject
OnClick = function()
if thisObject.Animator.GetBool("isFlying") == true then
thisObject.Animator.SetBool("isFlying", false)
else
thisObject.Animator.SetBool("isFlying", true)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
* Lua
```lua
--clicking the object will toggle it's "isFlying" bool parameter between true and false
--this script uses parameter ID instead of string (StringToHash function gets the ID)
thisObject = Space.Host.ExecutingObject
OnClick = function()
parameterID = thisObject.Animator.StringToHash("isFlying")
if thisObject.Animator.GetBool(parameterID) == true then
thisObject.Animator.SetBool(parameterID, false)
else
thisObject.Animator.SetBool(parameterID, true)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GetInteger[β](#getinteger "Direct link to GetInteger")
int **GetInteger** (string name) int **GetInteger** (int id)
*Returns the value of the given integer parameter. name: The name of the parameter.* *id: The id of the parameter.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
getParam = Space.Host.ExecutingObject.Animator.GetInteger("paramName")
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("paramName")
getParam = Space.Host.ExecutingObject.Animator.GetInteger(paramID)
```
* Lua
```lua
--clicking the object will toggle it's Animator's "jumpHeight" int parameter between 0 and 5
thisObject = Space.Host.ExecutingObject
OnClick = function()
if thisObject.Animator.GetInteger("jumpHeight") == 0 then
thisObject.Animator.SetInteger("jumpHeight", 1)
else
thisObject.Animator.SetInteger("jumpHeight", 0)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
* Lua
```lua
--clicking the object will toggle it's Animator's "jumpHeight" int parameter between 0 and 5
--this script uses parameter ID instead of string (StringToHash function gets the ID)
thisObject = Space.Host.ExecutingObject
paramID = thisObject.Animator.StringToHash("jumpHeight")
OnClick = function()
if thisObject.Animator.GetInteger(paramID ) == 0 then
thisObject.Animator.SetInteger(paramID , 1)
else
thisObject.Animator.SetInteger(paramID , 0)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### ResetTrigger[β](#resettrigger "Direct link to ResetTrigger")
void **ResetTrigger** (string name) void **ResetTrigger** (int id)
*Resets the trigger parameter to false.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.ResetTrigger("parameterName")
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.ResetTrigger(paramID)
```
* Lua
```lua
-- when object is clicked, "clickedTrigger" trigger parameter will be set and initial trigger cleared
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.Animator.ResetTrigger("initialTrigger")
thisObject.Animator.SetTrigger("clickedTrigger")
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
* Lua
```lua
-- when object is clicked, "clickedTrigger" trigger parameter will be set and initial trigger cleared
thisObject = Space.Host.ExecutingObject
initialID = thisObject.Animator.StringToHash("initialTrigger")
clickedID = thisObject.Animator.StringToHash("clickedTrigger")
OnClick = function()
thisObject.Animator.ResetTrigger(initialID)
thisObject.Animator.SetTrigger(clickedID)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### IsParameterControlledByCurve[β](#isparametercontrolledbycurve "Direct link to IsParameterControlledByCurve")
bool **IsParameterControlledByCurve** (string name)
bool **IsParameterControlledByCurve** (int id)
*Returns true if a parameter is controlled by an additional curve on an animation.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
paramCurve = Space.Host.ExecutingObject.Animator.IsParameterControlledByCurve("parameterName")
```
##### GetLayerName[β](#getlayername "Direct link to GetLayerName")
string **GetLayerName** (int layerIndex)
*Gets name of the layer.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerName = Space.Host.ExecutingObject.Animator.GetLayerName(1)
```
##### GetLayerIndex[β](#getlayerindex "Direct link to GetLayerIndex")
int **GetLayerIndex** (string layerName)
*Gets the index of the layer with specified name.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerIndex = Space.Host.ExecutingObject.Animator.GetLayerIndex("Layer Name")
```
##### GetLayerWeight[β](#getlayerweight "Direct link to GetLayerWeight")
float **GetLayerWeight** (int layerIndex)
*Gets the layer's current weight.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerIndex = Space.Host.ExecutingObject.Animator.GetLayerWeight("Layer Name")
```
##### SetLayerWeight[β](#setlayerweight "Direct link to SetLayerWeight")
void **SetLayerWeight** (int layerIndex, float weight)
*Sets the weight of the layer at the given index.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.SetLayerWeight(0,2.0)
```
* Lua
```lua
--clicking the object will toggle the Layer Weight of your second layer (index 1) between 0.0 and 1.0
thisObject = Space.Host.ExecutingObject
OnClick = function()
if thisObject.Animator.GetLayerWeight(1) == 0 then
thisObject.Animator.SetLayerWeight(1, 1.0)
else
thisObject.Animator.SetLayerWeight(1, 0.0)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### IsInTransition[β](#isintransition "Direct link to IsInTransition")
bool **IsInTransition** (int layerIndex)
*Is the specified layer in a transition.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
layerTransition = Space.Host.ExecutingObject.Animator.IsInTransition(0)
```
##### CrossFadeInFixedTime[β](#crossfadeinfixedtime "Direct link to CrossFadeInFixedTime")
void **CrossFadeInFixedTime** (string stateName, float transitionDuration)
void **CrossFadeInFixedTime** (string stateName, float transitionDuration, int layer)
void **CrossFadeInFixedTime** (string stateName, float transitionDuration, int layer, float fixedTime)
*Creates a dynamic transition between the current state and the destination state. The duration and offset in the target state are in fixed time. stateName: The name of the destination state. transitionDuration: The duration of the transition. Value is in seconds. layer: Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played. fixedTime: Start time of the current destination state. Value is in seconds. If no explicit fixedTime is specified or fixedTime value is float.NegativeInfinity, the state will either be played from the start if it's not already playing, or will continue playing from its current time and no transition will happen.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.CrossFadeInFixedTime("State Name", 15.0)
Space.Host.ExecutingObject.Animator.CrossFadeInFixedTime("State Name", 15.0, 0)
Space.Host.ExecutingObject.Animator.CrossFadeInFixedTime("State Name", 15.0, 0 , 0.0)
```
* Lua
```lua
--clicking the object will make it's animator crossfade from current state to the middle of "Second State" (on the second layer) in 3 seconds
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.Animator.CrossFadeInFixedTime("Second State", 3.0, 1, 0.5)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### CrossFade[β](#crossfade "Direct link to CrossFade")
void **CrossFade** (string stateName, float transitionDuration)
void **CrossFade** (string stateName, float transitionDuration, int layer)
void **CrossFade** (string stateName, float transitionDuration, int layer, float normalizedTime)
*Creates a dynamic transition between the current state and the destination state. stateName: The name of the destination state. transitionDuration: The duration of the transition. Value is in source state normalized time. layer: Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played. normalizedTime: Start time of the current destination state. Value is in source state normalized time, should be between 0 and 1. If no explicit normalizedTime is specified or normalizedTime value is float.NegativeInfinity, the state will either be played from the start if it's not already playing, or will continue playing from its current time and no transition will happen.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
| | | |
| | | |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.CrossFade("State Name", 3.0)
Space.Host.ExecutingObject.Animator.CrossFade("State Name", 3.0, 0)
Space.Host.ExecutingObject.Animator.CrossFade("State Name", 3.0, 0 , 0.0)
```
* Lua
```lua
--clicking the object will make it's animator crossfade from current state to the middle of "Second State" (on the second layer)
--Crossfade duration will be triple the length of Source state
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.Animator.CrossFade("Second State", 3.0, 1, 0.5)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### PlayInFixedTime[β](#playinfixedtime "Direct link to PlayInFixedTime")
void **PlayInFixedTime** (string stateName, int layer) void **PlayInFixedTime** (string stateName) void **PlayInFixedTime** (string stateName, int layer, float fixedTime)
*Plays a state. The offset in the target state is in fixed time. stateName: The name of the state to play. Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.PlayInFixedTime("State Name")
Space.Host.ExecutingObject.Animator.PlayInFixedTime("State Name", 0)
Space.Host.ExecutingObject.Animator.PlayInFixedTime("State Name", 0, 0.0)
```
* Lua
```lua
--clicking the object will make it's animator play the "Second State", on the second Layer, and starting half a second in
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.Animator.PlayInFixedTime("Second State",1,0.5) --add "Second State" to the second Layer in Animator Controller
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Play[β](#play "Direct link to Play")
void **Play** (string stateName)
void **Play** (string stateName, int layer)
void **Play** (string stateName, int layer, float normalizedTime)
*Plays a state.*
| Parameter | Type | Description |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| stateName | string | The name of the state to play. |
| layer | int | Layer index containing the destination state. If no layer is specified or layer is -1, the first state that is found with the given name or hash will be played. |
| normalizedTime | float | Start time of the current destination state. Value is in normalized time. If no explicit normalizedTime is specified or value is float.NegativeInfinity, the state will either be played from the start if it's not already playing, or will continue playing from its current time. |
* Lua
```lua
Space.Host.ExecutingObject.Animator.Play("Run")
Space.Host.ExecutingObject.Animator.Play("Run", 0)
Space.Host.ExecutingObject.Animator.Play("Run", 0, 0.5)
```
##### StartPlayback[β](#startplayback "Direct link to StartPlayback")
void **StartPlayback** ()
*Sets the animator in playback mode.*
* Lua
```lua
Space.Host.ExecutingObject.Animator.StartPlayback()
```
##### StopPlayback[β](#stopplayback "Direct link to StopPlayback")
void **StopPlayback** ()
*Stops the animator playback mode. When playback stops, the avatar resumes getting control from game logic.*
* Lua
```lua
Space.Host.ExecutingObject.Animator.StopPlayback()
```
##### StartRecording[β](#startrecording "Direct link to StartRecording")
void **StartRecording** ()
*Sets the animator in recording mode. The recording will continue until the user calls StopRecording. Maximum 10,000 frames. Note it is not possible to start playback until a call to StopRecording is made*
* Lua
```lua
Space.Host.ExecutingObject.Animator.StartRecording()
```
##### StopRecording[β](#stoprecording "Direct link to StopRecording")
void **StopRecording** ()
*Stops animator record mode.*
* Lua
```lua
Space.Host.ExecutingObject.Animator.StopRecording()
```
##### Update[β](#update "Direct link to Update")
void **Update** (float deltaTime)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.Update()
```
##### SetTrigger[β](#settrigger "Direct link to SetTrigger")
void **SetTrigger** (string trigger)
void **SetTrigger** (int id)
*Sets a trigger parameter to active. A trigger parameter is a bool parameter that gets reset to false when it has been used in a transition. For state machines with multiple layers, the trigger will only get reset once all layers have been evaluated, so that the layers can synchronize their transitions on the same parameter.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.SetTrigger("TheTriggerName")
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("TheTriggerName")
Space.Host.ExecutingObject.SetTrigger(paramID)
```
##### SetFloat[β](#setfloat "Direct link to SetFloat")
void **SetFloat** (string name, float value)
void **SetFloat** (string name, float value, float dampTime, float deltaTime)
void **SetFloat** (int id, float value)
void **SetFloat** (int id, float value, float dampTime, float deltaTime)
*Send float values to the Animator to affect transitions. dampTime: The damper total time. deltaTime: The delta time to give to the damper.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.SetFloat("parameterName", 2.2)
--or
Space.Host.ExecutingObject.Animator.SetFloat("parameterName", 2.2,2.0,Space.DeltaTime)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.SetFloat(paramID, 2.2)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.SetFloat(paramID, 2.2,2.0,Space.DeltaTime)
```
* Lua
```lua
--clicking the object will make it's Animator damp transition it's "danceSpeed" property from 0.0 to 5.0
thisObject = Space.Host.ExecutingObject
OnClick = function()
Space.Host.StartCoroutine(function()
while thisObject.Animator.GetFloat("danceSpeed") < 5.0 do
thisObject.Animator.SetFloat("danceSpeed", 5.0, 1.0, Space.DeltaTime)
coroutine.yield(0)
end
end)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### SetBool[β](#setbool "Direct link to SetBool")
void **SetBool** (int id, bool value) void **SetBool** (string name, bool value)
*Sets the value of a boolean parameter.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.SetBool("IsFlying", true)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("parameterName")
Space.Host.ExecutingObject.Animator.SetFloat(paramID, 2.2)
```
* Lua
```lua
--clicking the object will toggle it's "isFlying" bool parameter between true and false
thisObject = Space.Host.ExecutingObject
OnClick = function()
if thisObject.Animator.GetBool("isFlying") == true then
thisObject.Animator.SetBool("isFlying", false)
else
thisObject.Animator.SetBool("isFlying", true)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### SetInteger[β](#setinteger "Direct link to SetInteger")
void **SetInteger** (string name, int value) void **SetInteger** (int id, int value)
*Sets the value of the given integer parameter.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.SetInteger("iParam", 2)
--or
paramID = Space.Host.ExecutingObject.Animator.StringToHash("iParam")
Space.Host.ExecutingObject.Animator.SetInteger(paramID, 2)
```
* Lua
```lua
--clicking the object will toggle it's Animator's "jumpHeight" int parameter between 0 and 5
thisObject = Space.Host.ExecutingObject
OnClick = function()
if thisObject.Animator.GetInteger("jumpHeight") == 0 then
thisObject.Animator.SetInteger("jumpHeight", 1)
else
thisObject.Animator.SetInteger("jumpHeight", 0)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### StringToHash[β](#stringtohash "Direct link to StringToHash")
int **StringToHash** (string name)
*Generates an parameter id from a string. Ids are used for optimized setters and getters on parameters.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
ID = Space.Host.ExecutingObject.Animator.StringToHash("isFlying")
```
* Lua
```lua
--clicking the object will toggle it's "isFlying" bool parameter between true and false
--this script uses parameter ID instead of string (StringToHash function gets the ID)
thisObject = Space.Host.ExecutingObject
OnClick = function()
parameterID = thisObject.Animator.StringToHash("isFlying")
if thisObject.Animator.GetBool(parameterID) == true then
thisObject.Animator.SetBool(parameterID, false)
else
thisObject.Animator.SetBool(parameterID, true)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GetCurrentAnimatorStateInfo[β](#getcurrentanimatorstateinfo "Direct link to GetCurrentAnimatorStateInfo")
[SAnimatorStateInfo](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md) **GetCurrentAnimatorStateInfo** (int Layerindex)
*Returns an SAnimatorStateInfo with the information on the current state..*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
```
#### Properties[β](#properties "Direct link to Properties")
##### Controller[β](#controller "Direct link to Controller")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Controller** `get` `set`
*The Animator Controller resource of this Animator*
* Lua
```lua
Space.Host.ExecutingObject.Animator.Controller = Space.GetResource("newController")
```
##### Avatar[β](#avatar "Direct link to Avatar")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Avatar** `get` `set`
*Gets/Sets the current Avatar.*
* Lua
```lua
currentAvatar = thisObject.Animator.Avatar
```
* Lua
```lua
-- when object is clicked, it's Animator's Avatar will be changed to an alternate one
thisObject = Space.Host.ExecutingObject
alternateAvatar = Space.GetResource("altavatar") -- add Avatar to Scripting Runtime resources section
OnClick = function()
thisObject.Animator.Avatar = alternateAvatar
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### ApplyRootMotion[β](#applyrootmotion "Direct link to ApplyRootMotion")
bool **ApplyRootMotion** `get` `set`
*Should root motion be applied?*
*Root motion is the effect where an object's entire mesh moves away from its starting point but that motion is created by the animation itself rather than by changing the Transform position.*
* Lua
```lua
Space.Host.ExecutingObject.Animator.ApplyRootMotion = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Root Motion
thisGameObject = Space.Host.ExecutingObject.Animator
OnClick = function()
animator.ApplyRootMotion = not animator.ApplyRootMotion
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### PlaybackTime[β](#playbacktime "Direct link to PlaybackTime")
float **PlaybackTime** `get` `set`
*Property Description*
* Lua
```lua
pace.Host.ExecutingObject.Animator.PlaybackTime = 0.5
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the Animator component is enabled or not*
* Lua
```lua
Space.Host.ExecutingObject.Animator.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Animator component
thisGameObject = Space.Host.ExecutingObject
animator = thisGameObject.Animator
OnClick = function()
animator.Enabled = not animator.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Parameters[β](#parameters "Direct link to Parameters")
string\[] **Parameters** `get`
*The AnimatorControllerParameter list used by the animator.*
* Lua
```lua
parameters = Space.Host.ExecutingObject.Animator.Parameters
for i=1,#parameters do Space.Log(parameters[i]) end --prints all parameters
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Animator.GameObject
```
---
### SAudioReactiveAnimation
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudioreactiveanimation.md#enabled)`get` `set` |
| [SAnimator](/scripting/client-scripting-api-reference/components/sanimator.md) [**Target** ](/scripting/client-scripting-api-reference/components/saudioreactiveanimation.md#target)`get` `set` |
| string [**Parameter** ](/scripting/client-scripting-api-reference/components/saudioreactiveanimation.md#parameter)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Returns true if the Audio Reactive Animation Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveAnimation.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Audio Reactive Animation component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveAnimation
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Target[β](#target "Direct link to Target")
[SAnimator](/scripting/client-scripting-api-reference/components/sanimator.md) **Target** `get` `set`
*The target Animator which the Audio Reactive Animation is affecting.*
* Lua
```lua
TargetAnimator = Space.Host.ExecutingObject.AudioReactiveAnimation.Target
```
* Lua
```lua
--clicking this object toggles between two Audio Reactive Animation targets
thisObject = Space.Host.ExecutingObject
animator1 = Space.Host.GetReference("object1").Animator --add this reference to Scripting Runtime component
animator2 = Space.Host.GetReference("object2").Animator --add this reference to Scripting Runtime component
OnClick = function()
if thisObject.AudioReactiveAnimation.Target == animator1 then
thisObject.AudioReactiveAnimation.Target = animator2
else
thisObject.AudioReactiveAnimation.Target = animator1
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Parameter[β](#parameter "Direct link to Parameter")
string **Parameter** `get` `set`
*The Parameter value which the Audio Reactive Animation is affecting in the target Animator.*
* Lua
```lua
Space.Host.ExecutingObject.SAudioReactiveAnimation.Parameter = "param2"
```
* Lua
```lua
--clicking this object toggles between two Audio Reactive Animation parameters
thisObject = Space.Host.ExecutingObject
parameter1 = "theParamName"
parameter2 = "theParamName2"
OnClick = function()
if thisObject.AudioReactiveAnimation.Parameter == parameter1 then
thisObject.AudioReactiveAnimation.Parameter = parameter2
else
thisObject.AudioReactiveAnimation.Parameter = parameter1
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.AudioReactiveAnimation.GameObject
```
---
### SAudioReactiveBase
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#enabled)`get` `set` |
| int [**BandMin** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#bandmin)`get` `set` |
| int [**BandMax** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#bandmax)`get` `set` |
| float [**BPMWindow** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#bpmwindow)`get` `set` |
| float [**LimitIncrease** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#limitincrease)`get` `set` |
| float [**LimitDecrease** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#limitdecrease)`get` `set` |
| float [**MinValue** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#minvalue)`get` `set` |
| float [**MaxValue** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#maxvalue)`get` `set` |
| int [**Mode** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#mode)`get` `set` |
| virtual float [**Power** ](/scripting/client-scripting-api-reference/components/saudioreactivebase.md#power)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the Audio Reactive component is enabled or not.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Audio Reactive Base component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactive
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### BandMin[β](#bandmin "Direct link to BandMin")
int **BandMin** `get` `set`
*The Band Min property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.BandMin= 1
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's Band Min property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.BandMin = (slider.Value * 12.0) -- from 0 to 12
end
slider.OnValueChanged(OVC)
```
##### BandMax[β](#bandmax "Direct link to BandMax")
int **BandMax** `get` `set`
*The Band Max property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.BandMax= 11
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's Band Max property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.BandMax = (slider.Value * 12.0) -- from 0 to 12
end
slider.OnValueChanged(OVC)
```
##### BPMWindow[β](#bpmwindow "Direct link to BPMWindow")
float **BPMWindow** `get` `set`
*The BPM Window property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.BPMWindow= 5
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's BPM Window property
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.BPMWindow = (slider.Value * 50) - 50 -- from -50 to 50
end
slider.OnValueChanged(OVC)
```
##### LimitIncrease[β](#limitincrease "Direct link to LimitIncrease")
float **LimitIncrease** `get` `set`
*The Limit Increase property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.LimitIncrease= 1
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's Limit Increase property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.LimitIncrease= (slider.Value * 50) - 50 -- from -50 to 50
end
slider.OnValueChanged(OVC)
```
##### LimitDecrease[β](#limitdecrease "Direct link to LimitDecrease")
float **LimitDecrease** `get` `set`
*The Limit Decrease property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.LimitDecrease= 3
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's Limit Decrease property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.LimitDecrease= (slider.Value * 50) - 50 -- from -50 to 50
end
slider.OnValueChanged(OVC)
```
##### MinValue[β](#minvalue "Direct link to MinValue")
float **MinValue** `get` `set`
*The Min Value property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.MinValue= 1
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's Min Value property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.MinValue= (slider.Value * 50) - 50 -- from -50 to 50
end
slider.OnValueChanged(OVC)
```
##### MaxValue[β](#maxvalue "Direct link to MaxValue")
float **MaxValue** `get` `set`
*The Max Value property of an Audio Reactive component.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.MaxValue= 3
```
* Lua
```lua
--the below script will make a slider change an Audio Reactive Component's Max Value property.
--[Add "theslider" and "theaudioreactive" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ar = Space.Host.GetReference("theaudioreactive").AudioReactive
OVC = function()
ar.MaxValue= (slider.Value * 50) - 50 -- from -50 to 50
end
slider.OnValueChanged(OVC)
```
##### Mode[β](#mode "Direct link to Mode")
int **Mode** `get` `set`
*The Mode property of an Audio Reactive component. Band is 0, and BMP is 1.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.Mode= 1
```
* Lua
```lua
--clicking this object will toggle between it's two Audio Reactive Modes
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactive
OnClick = function()
if component.Mode == 0 then
component.Mode = 1
else
component.Mode = 0
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Power[β](#power "Direct link to Power")
float **Power** `get`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactive.Power = 1
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.AudioReactive.GameObject
```
---
### SAudioReactiveLight
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#enabled)`get` `set` |
| SLight [**Target** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#target)`get` `set` |
| bool [**Range** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#range)`get` `set` |
| float [**MinRange** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#minrange)`get` `set` |
| float [**MaxRange** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#maxrange)`get` `set` |
| bool [**AnimateColor** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#animatecolor)`get` `set` |
| SColor [**MinColor** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#mincolor)`get` `set` |
| SColor [**MaxColor** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#maxcolor)`get` `set` |
| bool [**Intensity** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#intensity)`get` `set` |
| float [**MinIntensity** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#minintensity)`get` `set` |
| float [**MaxIntensity** ](/scripting/client-scripting-api-reference/components/saudioreactivelight.md#maxintensity)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Returns true if the Audio Reactive Light Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Audio Reactive Light component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveLight
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Target[β](#target "Direct link to Target")
SLight **Target** `get` `set`
*Returns true if the light target Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.Target = false
```
* Lua
```lua
--clicking the object will toggle between two different AudioReactiveLight targets
--[Add "light1" and "light2" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
light1 = Space.Host.GetReference("light1").Light
light2 = Space.Host.GetReference("light2").Light
OnClick = function()
if thisGameObject.AudioReactiveLight.Target == light1 then
thisGameObject.AudioReactiveLight.Target = light2
else
thisGameObject.AudioReactiveLight.Target = light1
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Range[β](#range "Direct link to Range")
bool **Range** `get` `set`
*Returns true if Range Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.Range = false
```
* Lua
```lua
--the below script will make the object toggle it's AudioReactiveLight's Range property
--[Add "arlight" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
OnClick = function()
arlight.Range= not arlight.Range
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### MinRange[β](#minrange "Direct link to MinRange")
float **MinRange** `get` `set`
*Returns MinRange value of the Audio Reactive Light.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.MinRange = 0.5
```
* Lua
```lua
--the below script will make a slider set the Audio Reactive Light's MinRange
--[Add "slider" and "arlight" references to the Scripting Runtime component]
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
OVC = function()
arlight.MinRange = (slider.Value * 9) + 1 --(from 1 to 10)
end
slider.OnValueChanged(OVC)
```
##### MaxRange[β](#maxrange "Direct link to MaxRange")
float **MaxRange** `get` `set`
*Returns MaxRange value of the Audio Reactive Light.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.MaxRange = 1
```
* Lua
```lua
--the below script will make a slider set the Audio Reactive Light's MaxRange
--[Add "slider" and "arlight" references to the Scripting Runtime component]
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
OVC = function()
arlight.MaxRange= (slider.Value * 10) + 10 --(from 10 to 20)
end
slider.OnValueChanged(OVC)
```
##### AnimateColor[β](#animatecolor "Direct link to AnimateColor")
bool **AnimateColor** `get` `set`
*Returns true if AnimateColor Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.AnimateColor = false
```
* Lua
```lua
--the below script will make the object Enable/Disable it's AudioReactiveLight's AnimateColor property
--[Add "arlight" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
OnClick = function()
arlight.AnimateColor = not arlight.AnimateColor
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### MinColor[β](#mincolor "Direct link to MinColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **MinColor** `get` `set`
*Returns MinColor value of the Audio Reactive Light.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.MinColor = Color.Red
```
* Lua
```lua
--clicking the object will open a color picker that changes AudioReactiveLight's MinColor
--[Add "arlight" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
originalColor = nil
OnChange = function(SColor)
arlight.MinColor = SColor
end
OnSelect = function(SColor)
arlight.MinColor = SColor
end
OnCancel = function()
arlight.MinColor = originalColor
end
OnClick = function()
originalColor = arlight.MinColor
Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### MaxColor[β](#maxcolor "Direct link to MaxColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **MaxColor** `get` `set`
*Returns MaxColor value of the Audio Reactive Light.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.MaxColor = Color.Blue
```
* Lua
```lua
--clicking the object will open a color picker that changes AudioReactiveLight's MaxColor
--[Add "arlight" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
originalColor = nil
OnChange = function(SColor)
arlight.MaxColor= SColor
end
OnSelect = function(SColor)
arlight.MaxColor= SColor
end
OnCancel = function()
arlight.MaxColor= originalColor
end
OnClick = function()
originalColor = arlight.MaxColor
Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Intensity[β](#intensity "Direct link to Intensity")
bool **Intensity** `get` `set`
*Returns true if Intensity Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.Intensity = false
```
* Lua
```lua
--the below script will make the object Enable/Disable it's AudioReactiveLight's Intensity property
--[Add "arlight" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
OnClick = function()
arlight.Intensity = not arlight.Intensity
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### MinIntensity[β](#minintensity "Direct link to MinIntensity")
float **MinIntensity** `get` `set`
*Returns MinIntensity value of the Audio Reactive Light.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.MinIntensity = 0.2
```
* Lua
```lua
--the below script will make a slider set the Audio Reactive Light's MinIntensity
--[Add "slider" and "arlight" references to the Scripting Runtime component]
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
OVC = function()
arlight.MinIntensity= (slider.Value * 1) --(from 0 to 1)
end
slider.OnValueChanged(OVC)
```
##### MaxIntensity[β](#maxintensity "Direct link to MaxIntensity")
float **MaxIntensity** `get` `set`
*Returns MaxIntensity value of the Audio Reactive Light.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveLight.MaxIntensity = 0.8
```
* Lua
```lua
--the below script will make a slider set the Audio Reactive Light's MaxIntensity
--[Add "slider" and "arlight" references to the Scripting Runtime component]
arlight = Space.Host.GetReference("arlight").AudioReactiveLight
slider = Space.Host.GetReference("slider").UISlider
OVC = function()
arlight.MaxIntensity= (slider.Value * 2) + 1 --(from 1 to 3)
end
slider.OnValueChanged(OVC)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.AudioReactiveLight.GameObject
```
---
### SAudioReactiveMaterial
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudioreactivematerial.md#enabled)`get` `set` |
| SMaterial [**Target** ](/scripting/client-scripting-api-reference/components/saudioreactivematerial.md#target)`get` `set` |
| SMaterial [**OriginalMaterial** ](/scripting/client-scripting-api-reference/components/saudioreactivematerial.md#originalmaterial)`get` `set` |
| SMaterial [**TargetMaterial** ](/scripting/client-scripting-api-reference/components/saudioreactivematerial.md#targetmaterial)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Returns true if the Audio Reactive Material Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveMaterial.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Audio Reactive Material component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveMaterial
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Target[β](#target "Direct link to Target")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **Target** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveMaterial.Target = AMaterial
```
##### OriginalMaterial[β](#originalmaterial "Direct link to OriginalMaterial")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **OriginalMaterial** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveMaterial.OriginalMaterial = AMaterial
```
##### TargetMaterial[β](#targetmaterial "Direct link to TargetMaterial")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **TargetMaterial** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveMaterial.TargetMaterial = AMaterial
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.AudioReactiveMaterial.GameObject
```
---
### SAudioReactiveParticleSystem
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#enabled)`get` `set` |
| SGameObject [**Target** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#target)`get` `set` |
| bool [**Position** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#position)`get` `set` |
| SVector [**MinPosition** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#minposition)`get` `set` |
| SVector [**MaxPosition** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#maxposition)`get` `set` |
| bool [**Rotation** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#rotation)`get` `set` |
| SVector [**MinRotation** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#minrotation)`get` `set` |
| SVector [**MaxRotation** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#maxrotation)`get` `set` |
| bool [**Scale** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#scale)`get` `set` |
| SVector [**MinScale** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#minscale)`get` `set` |
| SVector [**MaxScale** ](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md#maxscale)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Audio Reactive Particle System component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveParticleSystem
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Target[β](#target "Direct link to Target")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Target** `get` `set`
*Property Description*
* Lua
```lua
targetGameObject = Space.Host.ExecutingObject.AudioReactiveParticleSystem.Target
```
##### Position[β](#position "Direct link to Position")
bool **Position** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Position = true
```
##### MinPosition[β](#minposition "Direct link to MinPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MinPosition** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MinPosition = Vector.New(0,0,0)
```
##### MaxPosition[β](#maxposition "Direct link to MaxPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MaxPosition** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxPosition = Vector.New(10,10,10)
```
##### Rotation[β](#rotation "Direct link to Rotation")
bool **Rotation** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Rotation = true
```
##### MinRotation[β](#minrotation "Direct link to MinRotation")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MinRotation** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MinRotation = Vector.New(0,0,0)
```
##### MaxRotation[β](#maxrotation "Direct link to MaxRotation")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MaxRotation** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxRotation = Vector.New(10,10,10)
```
##### Scale[β](#scale "Direct link to Scale")
bool **Scale** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.Scale = true
```
##### MinScale[β](#minscale "Direct link to MinScale")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MinScale** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MinScale = Vector.New(1,1,1)
```
##### MaxScale[β](#maxscale "Direct link to MaxScale")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MaxScale** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveParticleSystem.MaxScale = Vector.New(1.2,1.2,1.2)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.AudioReactiveParticleSystem.GameObject
```
---
### SAudioReactiveTransform
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#enabled)`get` `set` |
| SGameObject [**Target** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#target)`get` `set` |
| bool [**Position** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#position)`get` `set` |
| SVector [**MinPosition** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#minposition)`get` `set` |
| SVector [**MaxPosition** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#maxposition)`get` `set` |
| bool [**Rotation** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#rotation)`get` `set` |
| SVector [**MinRotation** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#minrotation)`get` `set` |
| SVector [**MaxRotation** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#maxrotation)`get` `set` |
| bool [**Scale** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#scale)`get` `set` |
| SVector [**MinScale** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#minscale)`get` `set` |
| SVector [**MaxScale** ](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md#maxscale)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the Audio Reactive Transform component is enabled or not.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.Enabled= false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Audio Reactive Transform component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveTransform
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Target[β](#target "Direct link to Target")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Target** `get` `set`
*The target GameObject which will be affected by the Audio Reactive Transform.*
* Lua
```lua
target = Space.Host.ExecutingObject.AudioReactiveTransform.Target
```
* Lua
```lua
--clicking this object will toggle between two different Audio Reactive Transform targets
thisObject = Space.Host.ExecutingObject
target1 = Space.Host.GetReference("theTarget1") --add this reference to Scripting Runtime component
target2 = Space.Host.GetReference("theTarget2") --add this reference to Scripting Runtime component
function OnClickFunction()
if thisObject.AudioReactiveTransform.Target == target1 then
thisObject.AudioReactiveTransform.Target = target2
else
thisObject.AudioReactiveTransform.Target = target1
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Position[β](#position "Direct link to Position")
bool **Position** `get` `set`
*Whether or not the target's position will be affected by the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.Position = true
```
* Lua
```lua
--clicking this object will toggle it's Audio Reactive Transform Position property
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.AudioReactiveTransform.Position = not thisObject.AudioReactiveTransform.Position
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### MinPosition[β](#minposition "Direct link to MinPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MinPosition** `get` `set`
*Returns MinPosition value of the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.MinPosition = Vector.New(0,1,0)
```
##### MaxPosition[β](#maxposition "Direct link to MaxPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MaxPosition** `get` `set`
*Returns MaxPosition value of the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.MaxPosition = Vector.New(1,2,1)
```
##### Rotation[β](#rotation "Direct link to Rotation")
bool **Rotation** `get` `set`
*Whether or not the target's rotation will be affected by the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.Rotation= true
```
* Lua
```lua
--clicking this object will toggle it's Audio Reactive Transform Rotation property
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.AudioReactiveTransform.Rotation= not thisObject.AudioReactiveTransform.Rotation
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### MinRotation[β](#minrotation "Direct link to MinRotation")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MinRotation** `get` `set`
*Returns MinRotation value of the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.MinRotation = Vector.New(0,30,0)
```
##### MaxRotation[β](#maxrotation "Direct link to MaxRotation")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MaxRotation** `get` `set`
*Returns MaxRotation value of the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.MinRotation = Vector.New(0,60,0)
```
##### Scale[β](#scale "Direct link to Scale")
bool **Scale** `get` `set`
*Whether or not the target's scale will be affected by the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.Scale= true
```
* Lua
```lua
--clicking this object will toggle it's Audio Reactive Transform Scale property
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.AudioReactiveTransform.Scale= not thisObject.AudioReactiveTransform.Scale
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### MinScale[β](#minscale "Direct link to MinScale")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MinScale** `get` `set`
*Returns MinScale value of the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.MinScale = Vector.New(1,1,1)
```
##### MaxScale[β](#maxscale "Direct link to MaxScale")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **MaxScale** `get` `set`
*Returns MaxScale value of the Audio Reactive Transform.*
* Lua
```lua
Space.Host.ExecutingObject.AudioReactiveTransform.MaxScale = Vector.New(2,2,2)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.AudioReactiveTransform.GameObject
```
---
### SAudioSource
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Play** ](/scripting/client-scripting-api-reference/components/saudiosource.md#play)() |
| void [**Stop** ](/scripting/client-scripting-api-reference/components/saudiosource.md#stop)() |
| void [**Pause** ](/scripting/client-scripting-api-reference/components/saudiosource.md#pause)() |
| void [**UnPause** ](/scripting/client-scripting-api-reference/components/saudiosource.md#unpause)() |
| void [**PlayOneShot** ](/scripting/client-scripting-api-reference/components/saudiosource.md#playoneshot)(SResource clip, float volume) |
| void [**PlayClipAtPoint** ](/scripting/client-scripting-api-reference/components/saudiosource.md#playclipatpoint)(SResource clip, SVector position, float volume=1f) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/saudiosource.md#enabled)`get` `set` |
| bool [**Loop** ](/scripting/client-scripting-api-reference/components/saudiosource.md#loop)`get` `set` |
| float [**DopplerLevel** ](/scripting/client-scripting-api-reference/components/saudiosource.md#dopplerlevel)`get` `set` |
| float [**Volume** ](/scripting/client-scripting-api-reference/components/saudiosource.md#volume)`get` `set` |
| float [**Pitch** ](/scripting/client-scripting-api-reference/components/saudiosource.md#pitch)`get` `set` |
| float [**Time** ](/scripting/client-scripting-api-reference/components/saudiosource.md#time)`get` `set` |
| int [**TimeSamples** ](/scripting/client-scripting-api-reference/components/saudiosource.md#timesamples)`get` `set` |
| float [**Length** ](/scripting/client-scripting-api-reference/components/saudiosource.md#length)`get` |
| int [**Samples** ](/scripting/client-scripting-api-reference/components/saudiosource.md#samples)`get` |
| bool [**IsPlaying** ](/scripting/client-scripting-api-reference/components/saudiosource.md#isplaying)`get` |
| float [**PanStereo** ](/scripting/client-scripting-api-reference/components/saudiosource.md#panstereo)`get` `set` |
| float [**SpatialBlend** ](/scripting/client-scripting-api-reference/components/saudiosource.md#spatialblend)`get` `set` |
| bool [**Spatialize** ](/scripting/client-scripting-api-reference/components/saudiosource.md#spatialize)`get` `set` |
| bool [**SpatializePostEffects** ](/scripting/client-scripting-api-reference/components/saudiosource.md#spatializeposteffects)`get` `set` |
| float [**ReverbZoneMix** ](/scripting/client-scripting-api-reference/components/saudiosource.md#reverbzonemix)`get` `set` |
| bool [**BypassEffects** ](/scripting/client-scripting-api-reference/components/saudiosource.md#bypasseffects)`get` `set` |
| bool [**BypassListenerEffects** ](/scripting/client-scripting-api-reference/components/saudiosource.md#bypasslistenereffects)`get` `set` |
| bool [**BypassReverbZones** ](/scripting/client-scripting-api-reference/components/saudiosource.md#bypassreverbzones)`get` `set` |
| float [**Spread** ](/scripting/client-scripting-api-reference/components/saudiosource.md#spread)`get` `set` |
| int [**Priority** ](/scripting/client-scripting-api-reference/components/saudiosource.md#priority)`get` `set` |
| bool [**Mute** ](/scripting/client-scripting-api-reference/components/saudiosource.md#mute)`get` `set` |
| float [**MinDistance** ](/scripting/client-scripting-api-reference/components/saudiosource.md#mindistance)`get` `set` |
| float [**MaxDistance** ](/scripting/client-scripting-api-reference/components/saudiosource.md#maxdistance)`get` `set` |
| SResource [**AudioClip** ](/scripting/client-scripting-api-reference/components/saudiosource.md#audioclip)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### Play[β](#play "Direct link to Play")
void **Play** ()
*Starts playing the audio clip.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Play()
```
* Lua
```lua
-- For example, we have a short chime that we want to play every time a new avatar joins the scene.
hostObject = Space.Host.ExecutingObject
function welcomeSound ()
hostObject.Audio.Play()
end
Space.Scene.OnPlayerJoin(welcomeSound)
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*Stops playing the audio clip.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Stop()
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function audioOnOff ()
if hostObject.Audio.IsPlaying then
hostObject.Audio.Stop();
else
hostObject.Audio.Play();
end
Space.Log(hostObject.Audio.IsPlaying);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioOnOff);
-- Now, we can make the sound play or stop playing just by clicking the object.
```
##### Pause[β](#pause "Direct link to Pause")
void **Pause** ()
*Pauses the audio clip.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Pause()
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function pauseOnOff ()
if hostObject.Audio.IsPlaying then
hostObject.Audio.Pause();
else
hostObject.Audio.UnPause();
end
Space.Log(hostObject.Audio.IsPlaying);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(pauseOnOff);
-- Now, every time an object is clicked, the sound clip is paused/unpaused
```
##### UnPause[β](#unpause "Direct link to UnPause")
void **UnPause** ()
*Pauses the audio clip.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.UnPause()
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function pauseOnOff ()
if hostObject.Audio.IsPlaying then
hostObject.Audio.Pause();
else
hostObject.Audio.UnPause();
end
Space.Log(hostObject.Audio.IsPlaying);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(pauseOnOff);
-- Now, every time an object is clicked, the sound clip is paused/unpaused
```
##### PlayOneShot[β](#playoneshot "Direct link to PlayOneShot")
void **PlayOneShot** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md) clip, float volume)
*Plays the audio clip just ones at a desired volume.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Audio.PlayOneShot(AResource, 1.0)
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function playOnce ()
hostObject.Audio.PlayOneShot(Space.Resources[0],0.5);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(playOnce);
-- Now, every time the object is clicked, a sound clip we have in Scripting Runtime Resources is played at half the volume.
-- This happens regardless if the audio clip in the AudioClip property is playing or not.
```
##### PlayClipAtPoint[β](#playclipatpoint "Direct link to PlayClipAtPoint")
void **PlayClipAtPoint** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md) clip,[ SVector](/scripting/client-scripting-api-reference/types/svector.md) position, float volume=1f)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Audio.PlayClipAtPoint(AResource, AVector)
--or
Space.Host.ExecutingObject.Audio.PlayClipAtPoint(AResource, AVector, 0.5)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is the Audio Source component enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Enabled = false
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function audioOnOff ()
hostObject.Audio.Enabled = not hostObject.Audio.Enabled;
Space.Log(hostObject.Audio.Enabled);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioOnOff);
-- When the host object is clicked, the Audio Source component gets enabled, if it was disabled,
-- or disabled, if it was enabled, and its new state is printed to the console.
```
##### Loop[β](#loop "Direct link to Loop")
bool **Loop** `get` `set`
*Is looping of the sound clip enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Loop = true
```
* Lua
```lua
--the below script will make the object toggle it's Loop option OnClick
--[Add "audio" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio
OnClick = function()
audio.Loop = not audio.Loop
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### DopplerLevel[β](#dopplerlevel "Direct link to DopplerLevel")
float **DopplerLevel** `get` `set`
*The Doppler level of the Audio Source. (See: Doppler Effect)*
* Lua
```lua
Space.Host.ExecutingObject.Audio.DopplerLevel = 0.5
```
* Lua
```lua
--the below script will make a slider change the Audio Source's Doppler Level
--[Add "slider" and "audio" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.DopplerLevel = slider.Value * 5 --0 to 5
end
slider.OnValueChanged(OVC)
```
##### Volume[β](#volume "Direct link to Volume")
float **Volume** `get` `set`
*The Volume level of the Audio Source.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Volume = 0.5
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
Space.Log(hostObject.Audio.Volume);
-- 1 by default
function audioVolumeDecr ()
if hostObject.Audio.Volume > 0 then
hostObject.Audio.Volume = hostObject.Audio.Volume - 0.2;
end
Space.Log(hostObject.Audio.Volume);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioVolumeDecr);
-- Now, every time we click this object, the Volume level is decreased by 0.2, until it reaches 0.
```
##### Pitch[β](#pitch "Direct link to Pitch")
float **Pitch** `get` `set`
*The Pitch level for the Audio Source.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Pitch = 0.5
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
Space.Log(hostObject.Audio.Pitch);
-- 1 by default
function audioPitchChange ()
if hostObject.Audio.Pitch < 3 then
hostObject.Audio.Pitch = hostObject.Audio.Pitch + 0.5;
end
Space.Log(hostObject.Audio.Pitch);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(audioPitchChange);
-- Now, every time we click this object, the Pitch level is increased by 0.5, until it reaches 3.
```
##### Time[β](#time "Direct link to Time")
float **Time** `get` `set`
*Playback position in seconds.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Time = 10
```
* Lua
```lua
--the below script will make a slider set Audio Source's playback position (using seconds)
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.Time = slider.Value * audio.Length -- from 0 to Length of clip
end
slider.OnValueChanged(OVC)
```
##### TimeSamples[β](#timesamples "Direct link to TimeSamples")
int **TimeSamples** `get` `set`
*Playback position in PCM samples.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.TimeSamples = 5
```
* Lua
```lua
--the below script will make a slider set Audio Source's playback position (using PCM Samples)
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.TimeSamples = slider.Value * audio.Samples -- from 0 to number of samples
end
slider.OnValueChanged(OVC)
```
##### Length[β](#length "Direct link to Length")
float **Length** `get`
*Return Audio Length.*
* Lua
```lua
AudioLength = Space.Host.ExecutingObject.Audio.Length
```
* Lua
```lua
--the below script will make a slider set Audio Source's playback position (using seconds)
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.Time = slider.Value * audio.Length -- from 0 to Length of clip
end
slider.OnValueChanged(OVC)
```
##### Samples[β](#samples "Direct link to Samples")
int **Samples** `get`
*Return Audio Samples.*
* Lua
```lua
numSamples = Space.Host.ExecutingObject.Audio.Samples
```
* Lua
```lua
--the below script will make a slider set Audio Source's playback position (using PCM Samples)
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.TimeSamples = slider.Value * audio.Samples -- from 0 to number of samples
end
slider.OnValueChanged(OVC)
```
##### IsPlaying[β](#isplaying "Direct link to IsPlaying")
bool **IsPlaying** `get`
*Is the sound clip playing right now?*
* Lua
```lua
numSamples = Space.Host.ExecutingObject.Audio.IsPlaying
```
* Lua
```lua
--this script will play a looping sound only if someone is using the seat
--and will stop the sound if someone is not
--(Example: carnival game )
--[Object must contain a Seat component and AudioSource component]
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if thisGameObject.Seat.InUse then
if not thisGameObject.Audio.IsPlaying then
thisGameObject.Audio.Play()
end
else
if thisGameObject.Audio.IsPlaying then
thisGameObject.Audio.Stop()
end
end
end
thisGameObject.Audio.Loop = true
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### PanStereo[β](#panstereo "Direct link to PanStereo")
float **PanStereo** `get` `set`
*Pans the sound to the left or right. Values range from -1 to 1: 0 is the middle, -1 is full left, 1 is full right.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.PanStereo = -1
```
* Lua
```lua
--the below script will make a slider set the Stereo Pan
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.PanStereo = (slider.Value * 2) - 1 --(from -1 left to +1 right)
end
slider.OnValueChanged(OVC)
```
##### SpatialBlend[β](#spatialblend "Direct link to SpatialBlend")
float **SpatialBlend** `get` `set`
*The level of impact 3D effects make on the AudioSource. 0 - no impact (full 2D sound), 1 - maximum impact (full 3D sound).*
* Lua
```lua
Space.Host.ExecutingObject.Audio.SpatialBlend = 1
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function spBlendChange ()
if hostObject.Audio.SpatialBlend < 1 then
hostObject.Audio.SpatialBlend = hostObject.Audio.SpatialBlend + 0.2;
else
hostObject.Audio.SpatialBlend = 0;
end
Space.Log(hostObject.Audio.SpatialBlend);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(spBlendChange);
-- Spatial Blend is increased by 0.2 every time the object is clicked, until it reaches 1.
-- Then with the next click, it resets back to 0.
```
##### Spatialize[β](#spatialize "Direct link to Spatialize")
bool **Spatialize** `get` `set`
*Is spatialization enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Spatialize = true
```
* Lua
```lua
--the below script will make the object toggle it's Spatialize feature OnClick
--[Add "audio" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio
OnClick = function()
audio.Spatialize = not audio.Spatialize
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### SpatializePostEffects[β](#spatializeposteffects "Direct link to SpatializePostEffects")
bool **SpatializePostEffects** `get` `set`
*Is spatialization enabled before or after other filters are in action?*
* Lua
```lua
Space.Host.ExecutingObject.Audio.SpatializePostEffects = true
```
* Lua
```lua
--the below script will make the object toggle it's Spatialize Post Effects feature OnClick
--[Add "audio" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio
OnClick = function()
audio.SpatializePostEffects = not audio.SpatializePostEffects
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### ReverbZoneMix[β](#reverbzonemix "Direct link to ReverbZoneMix")
float **ReverbZoneMix** `get` `set`
*The level at which the audio coming from this Audio Source will be mixed into the global reverb of the scene (accomplished with Reverb Zones).*
* Lua
```lua
Space.Host.ExecutingObject.Audio.ReverbZoneMix = true
```
* Lua
```lua
exa--the below script will make a slider set the Reverb Zone Mix value
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.ReverbZoneMix = (slider.Value * 1.1) --(from 0.0 to 1.1)
end
slider.OnValueChanged(OVC)
```
##### BypassEffects[β](#bypasseffects "Direct link to BypassEffects")
bool **BypassEffects** `get` `set`
*When true, none of global sound effects (reverbs, filters, etc.) are applied to the audio from this Audio Source.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.BypassEffects = true
```
* Lua
```lua
--the below script will make the object toggle it's Bypass Effects feature OnClick
--[Add "audio" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio
OnClick = function()
audio.BypassEffects = not audio.BypassEffects
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### BypassListenerEffects[β](#bypasslistenereffects "Direct link to BypassListenerEffects")
bool **BypassListenerEffects** `get` `set`
*When true, whichever global effects are set on the Audio Listener will not be applied to the audio from this Audio Source.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.BypassListenerEffects = true
```
* Lua
```lua
--the below script will make the object toggle it's Bypass Listener Effects feature OnClick
--[Add "audio" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio
OnClick = function()
audio.BypassListenerEffects = not audio.BypassListenerEffects
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### BypassReverbZones[β](#bypassreverbzones "Direct link to BypassReverbZones")
bool **BypassReverbZones** `get` `set`
*When true, the audio from this Audio Source is not mixed into the global reverb generated through Reverb Zones.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.BypassReverbZones = true
```
* Lua
```lua
--the below script will make the object toggle it's Bypass Reverb Zones feature OnClick
--[Add "audio" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
audio = Space.Host.GetReference("audio").Audio
OnClick = function()
audio.BypassReverbZones = not audio.BypassReverbZones
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Spread[β](#spread "Direct link to Spread")
float **Spread** `get` `set`
*The angle of spread of the audio channels in the 3D space (only works for stereo and multichannel audio). 0 by default - all channels are concentrated at the same speaker location, making it "mono".*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Spread = 10.0
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function increaseSpread ()
if hostObject.Audio.Spread < 360 then
hostObject.Audio.Spread = hostObject.Audio.Spread + 90;
end
Space.Log(hostObject.Audio.Spread);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(increaseSpread);
-- Every time an object is clicked, the spread increases by 90 degrees - compare the sound at different angles of spread!
```
##### Priority[β](#priority "Direct link to Priority")
int **Priority** `get` `set`
*The priority of this Audio Source: when there are more Audio Sources playing than channels available, Priority defines which channels will be discarded in favour of those with a higher priority. 0 is the highest priority, 255 - the lowest.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Priority = 50
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function changePriority ()
if hostObject.Audio.Priority == 0 then
hostObject.Audio.Priority = 255;
else
hostObject.Audio.Priority = 0;
end
Space.Log(hostObject.Audio.Priority);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(changePriority);
-- Now the Audio Source alternates between the highest and the lowest priorities.
-- This can be useful, for example, in a scene with an ambient sound set at Priority 128, where we have a speaker, which plays a certain looped audio nonstop.
-- When we want to hear the audio, we change it to the highest priority, so it blocks the ambient sound.
-- When we don't, we change it to the lowest, and the ambient sound dominates the scene again.
```
##### Mute[β](#mute "Direct link to Mute")
bool **Mute** `get` `set`
*Is the audio muted? If True, the Volume is set to 0. If False, the Volume is restored to the original level.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.Mute = true
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject;
function muteOnOff ()
hostObject.Audio.Mute = not hostObject.Audio.Mute;
Space.Log(hostObject.Audio.Mute);
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(muteOnOff);
-- Now clicking the object works like the Mute button.
```
##### MinDistance[β](#mindistance "Direct link to MinDistance")
float **MinDistance** `get` `set`
*At which distance from the Audio Source the sound will begin ceasing? The sound will be heard at its maximum volume within this distance. (Spatial Blend should not be equal to 0 for this property to take effect.)*
* Lua
```lua
Space.Host.ExecutingObject.Audio.MinDistance = 2.0
```
* Lua
```lua
--the below script will make a slider set the Minimum Distance
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.MinDistance = (slider.Value * 20) + 10 --(from 10 to 30)
end
slider.OnValueChanged(OVC)
```
##### MaxDistance[β](#maxdistance "Direct link to MaxDistance")
float **MaxDistance** `get` `set`
*At which distance from the Audio Source the sound will no longer be heard? (Spatial Blend should not be equal to 0 for this property to take effect.)*
* Lua
```lua
Space.Host.ExecutingObject.Audio.MaxDistance = 10.0
```
* Lua
```lua
--the below script will make a slider set the Maximum Distance
--[Add "slider" and "audio" references to the Scripting Runtime component]
slider = Space.Host.GetReference("slider").UISlider
audio = Space.Host.GetReference("audio").Audio
OVC = function()
audio.MaxDistance = (slider.Value * 40) + 60 --(from 60 to 100)
end
slider.OnValueChanged(OVC)
```
##### AudioClip[β](#audioclip "Direct link to AudioClip")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **AudioClip** `get` `set`
*The audio clip that is or will be played by this Audio Source.*
* Lua
```lua
Space.Host.ExecutingObject.Audio.AudioClip = AResource
```
* Lua
```lua
-- In this example, there are 3 audio clips in Scripting Runtime Resources
hostObject = Space.Host.ExecutingObject;
local nextTrack = 0;
function changeTrack ()
hostObject.Audio.AudioClip = Space.Resources[nextTrack];
hostObject.Audio.Play();
Space.Log(Space.Resources[nextTrack].Name);
if nextTrack == 2 then -- replace 2 with n-1, where n is the amount of audio clips you have added to Resources
nextTrack = 0;
else
nextTrack = nextTrack + 1;
end
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(changeTrack);
-- Now, every time the object is clicked, the next audio clip is played.
-- What's more, the list is looped (the index resets back to 0 when it gets to the end of the list)!
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Audio.GameObject
```
---
### SBoxCollider
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------- |
| SVector [**Center** ](/scripting/client-scripting-api-reference/components/sboxcollider.md#center)`get` `set` |
| SVector [**Size** ](/scripting/client-scripting-api-reference/components/sboxcollider.md#size)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sboxcollider.md#enabled)`get` `set` |
| bool [**IsTrigger** ](/scripting/client-scripting-api-reference/components/sboxcollider.md#istrigger)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Center[β](#center "Direct link to Center")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Center** `get` `set`
*The position of the center of the Box Collider.*
* Lua
```lua
Center = Space.Host.ExecutingObject.BoxCollider.Center
```
* Lua
```lua
--clicking this object moves it's Box Collider's center one unit upwards
thisObject = Space.Host.ExecutingObject
OnClick = function()
center = thisObject.BoxCollider.Center
thisObject.BoxCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Size[β](#size "Direct link to Size")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Size** `get` `set`
*The size of the box.*
* Lua
```lua
Size= Space.Host.ExecutingObject.BoxCollider.Size
```
* Lua
```lua
--clicking this object increases it's Box Collider's size by one unit
thisObject = Space.Host.ExecutingObject
OnClick = function()
size = thisObject.BoxCollider.Size
thisObject.BoxCollider.Size = Vector.New(size.X + 1,size.Y + 1, size.Z + 1)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enabled Colliders will collide with other Colliders, disabled Colliders won't.*
* Lua
```lua
Space.Host.ExecutingObject.BoxCollider.Enabled = false
```
* Lua
```lua
--clicking this object toggles it's Box Collider On/Off
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.BoxCollider.Enabled = not thisObject.BoxCollider.Enabled
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### IsTrigger[β](#istrigger "Direct link to IsTrigger")
bool **IsTrigger** `get` `set`
*Is the collider a trigger?*
* Lua
```lua
Space.Host.ExecutingObject.BoxCollider.Enabled = true
```
* Lua
```lua
--clicking this object toggles it's Box Collider between being a Collider and Trigger Collider
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.BoxCollider.IsTrigger = not thisObject.BoxCollider.IsTrigger
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.BoxCollider.GameObject
```
---
### SBrowserSurface
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetURL** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#seturl)(string url) |
| void [**Back** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#back)() |
| void [**Forward** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#forward)() |
| void [**Reload** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#reload)() |
| void [**RegisterFunction** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#registerfunction)(string name, Closure function) |
| void [**CallFunction** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#callfunction)(string name, string argument) |
| void [**OnURLChanged** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#onurlchanged)(Closure e) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------- |
| bool [**Networked** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#networked)`get` `set` |
| bool [**Muted** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#muted)`get` `set` |
| bool [**CanGoBack** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#cangoback)`get` |
| bool [**CanGoForward** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#cangoforward)`get` |
| bool [**EnableInput** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#enableinput)`get` `set` |
| float [**Zoom** ](/scripting/client-scripting-api-reference/components/sbrowsersurface.md#zoom)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### SetURL[β](#seturl "Direct link to SetURL")
void **SetURL** (string url)
*Sets the URL for the browser frame, and navigates to it.*
| Parameter | Type | Description |
| --------- | ------ | ------------------------------------------------------------------------- |
| url | string | A standard URL recognized by Chromium, such as . |
* Lua
```lua
Space.Host.ExecutingObject.Browser.SetURL('https://www.youtube.com')
```
* Lua
```lua
--the below scipt makes this object set Browser URL according to what's written in text field
--(Example: Set URL button)
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")
OnClick = function()
webBrowser.Browser.SetURL(urlField.UIInputField.Text)
end
urlField.UIInputField.Text = "https://www.youtube.com"
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to set URL"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Back[β](#back "Direct link to Back")
void **Back** ()
*Equivalent to hitting the 'back' button within the browser.*
* Lua
```lua
Space.Host.ExecutingObject.Browser.Back()
```
* Lua
```lua
--the below scipt makes this object a clickable that navigates Back
--(Example: Browser navigation )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser
OnClick = function()
browser.Back()
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Forward[β](#forward "Direct link to Forward")
void **Forward** ()
*Equivalent to hitting the 'forward' button within the browser.*
* Lua
```lua
Space.Host.ExecutingObject.Browser.Forward()
```
* Lua
```lua
--the below scipt makes this object a clickable that navigates Forward
--(Example: Browser navigation )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser
OnClick = function()
browser.Forward()
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Reload[β](#reload "Direct link to Reload")
void **Reload** ()
*Refreshes and reloads the current webpage.*
* Lua
```lua
Space.Host.ExecutingObject.Browser.Reload()
```
* Lua
```lua
--the below scipt makes this object a clickable that reloads the page
--(Example: Browser navigation )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser
OnClick = function()
browser.Reload()
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
```
##### RegisterFunction[β](#registerfunction "Direct link to RegisterFunction")
void **RegisterFunction** (string name, Closure function)
*Allows a JavaScript function that exists in the browser to be called by our code.*
| Parameter | Type | Description |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| name | string | The name of the JavaScript function we want to register. The function name should start with "**sinespace\_\_".** |
* Lua
```lua
Space.Host.ExecutingObject.Browser.RegisterFunction("sinespace__TestFunction", )
```
##### CallFunction[β](#callfunction "Direct link to CallFunction")
void **CallFunction** (string name, string argument)
*Calls a JS function in the browser with a single argument. The function name must begin with the characters "sinespace\_".*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Browser.CallFunction()
```
##### OnURLChanged[β](#onurlchanged "Direct link to OnURLChanged")
void **OnURLChanged** (Closure e)
*Binds a function to be called whenever the URL of the Browser Surface changes*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Browser.OnURLChanged(aFunction)
```
* Lua
```lua
--the below scipt makes this object clear the an InputField whenever URL changes
--(Example: URL Bar)
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")
OnURLChanged ()
urlField.UIInputField.Text = " "
end
webBrowser.Browser.OnURLChanged(OnURLChanged)
```
#### Properties[β](#properties "Direct link to Properties")
##### Networked[β](#networked "Direct link to Networked")
bool **Networked** `get` `set`
*Should changes to this browser be streamed to other clients within the area?.*
* Lua
```lua
Space.Host.ExecutingObject.Browser.Networked = true
```
* Lua
```lua
--the below scipt makes this object toggle Networking on it's parent browser
--(Example: browser controls)
--[Required: This object needs its parent to have the browser component]
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if thisGameObject.Parent.Browser.Networked then
thisGameObject.Parent.Browser.Networked = false
Space.Log("Browser will not be networked")
else
thisGameObject.Parent.Browser.Networked = true
Space.Log("Browser will be networked")
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to toggle Networking on Browser"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Muted[β](#muted "Direct link to Muted")
bool **Muted** `get` `set`
*Whether this Browser Surface is muted or not.*
* Lua
```lua
Space.Host.ExecutingObject.Browser.Muted=true
```
* Lua
```lua
--the below scipt makes this object a clickable that mutes/unmutes a browser surface
--(Example: Browser Mute button )
--[Required: This object's parent needs to be an object with BrowserSurface component in it]
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if thisGameObject.Parent.Browser.Muted then
thisGameObject.Parent.Browser.Muted = false
Space.Log("Browser unmuted")
else
thisGameObject.Parent.Browser.Muted = true
Space.Log("Browser muted")
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Mute/Unmute Browser"
thisGameObject.Clickable.OnClick(OnClick)
```
##### CanGoBack[β](#cangoback "Direct link to CanGoBack")
bool **CanGoBack** `get`
*Returns whether this Browser Surface can navigate back*
* Lua
```lua
CanGoBack = Space.Host.ExecutingObject.Browser.CanGoBack
```
* Lua
```lua
--the below scipt makes this Browser object show/hide it's Forward and Back
--buttons according to wether the actions are possible or not
--(Example: browser navigation )
--[Required: This object needs the forward and back objects added to the references section in scripting runtime]
thisGameObject = Space.Host.ExecutingObject
forwardButton = Space.Host.GetReference("Forward Button")
backButton = Space.Host.GetReference("Back Button")
OnUpdate = function()
if thisGameObject.Browser.CanGoBack then
backButton.Active = true
else backButton.Active = false
end
if thisGameObject.Browser.CanGoForward then
forwardButton.Active = true
else forwardButton.Active = false
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### CanGoForward[β](#cangoforward "Direct link to CanGoForward")
bool **CanGoForward** `get`
*Returns whether this Browser Surface can navigate forward*
* Lua
```lua
CanGoForward = Space.Host.ExecutingObject.Browser.CanGoForward
```
* Lua
```lua
--the below scipt makes this Browser object show/hide it's Forward and Back
--buttons according to wether the actions are possible or not
--(Example: browser navigation )
--[Required: This object needs the forward and back objects added to the references section in scripting runtime]
thisGameObject = Space.Host.ExecutingObject
forwardButton = Space.Host.GetReference("Forward Button")
backButton = Space.Host.GetReference("Back Button")
OnUpdate = function()
if thisGameObject.Browser.CanGoBack then
backButton.Active = true
else backButton.Active = false
end
if thisGameObject.Browser.CanGoForward then
forwardButton.Active = true
else forwardButton.Active = false
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### EnableInput[β](#enableinput "Direct link to EnableInput")
bool **EnableInput** `get` `set`
*Whether this Browser Surface has Input enabled or not (interactable)*
* Lua
```lua
Space.Host.ExecutingObject.Browser.EnableInput = false
```
* Lua
```lua
--the below scipt makes this object a clickable that toggle Enable Input a browser surface
--(Example: Brower Enable Input toggle button )
--[Required: Browser surface object needs to be added as a reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
browser = Space.Host.GetReference("Browser Surface Object").Browser
OnClick = function()
if browser.EnableInput then
browser.EnableInput = false
Space.Log("Browser input disabled")
else
browser.EnableInput = true
Space.Log("Browser input enabled")
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Enable/Disable browser Input"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Zoom[β](#zoom "Direct link to Zoom")
float **Zoom** `get` `set`
*Set the Zoom of the browser surface (Pixel Scaling). Positive values zoom in, negative values zoom out.*
* Lua
```lua
Space.Host.ExecutingObject.Browser.Zoom = 2
```
* Lua
```lua
--the below scipt make a slider control the zoom in of a browser surface
--(Example: browser zoom controls)
--[Required: This object needs a Browser and slider objects to be added as reference to references section in Scripting Runtime component]
slider = Space.Host.GetReference("Slider").UISlider
browser = Space.Host.GetReference("Browser")
browser.Browser.SetURL("https://www.yahoo.com")
OnValueChanged = function()
browser.Browser.Zoom = slider.NormalizedValue * 5
end
slider.OnValueChanged(OnValueChanged)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Browser.GameObject
```
---
### SCamera
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------- |
| void [**TakePhoto** ](/scripting/client-scripting-api-reference/components/scamera.md#takephoto)() |
| SResource [**TakeSnapshot** ](/scripting/client-scripting-api-reference/components/scamera.md#takesnapshot)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------- |
| bool [**HDR** ](/scripting/client-scripting-api-reference/components/scamera.md#hdr)`get` `set` |
| int [**PixelWidth** ](/scripting/client-scripting-api-reference/components/scamera.md#pixelwidth)`get` |
| int [**PixelHeight** ](/scripting/client-scripting-api-reference/components/scamera.md#pixelheight)`get` |
| SVector [**Velocity** ](/scripting/client-scripting-api-reference/components/scamera.md#velocity)`get` |
| bool [**UseOcclusionCulling** ](/scripting/client-scripting-api-reference/components/scamera.md#useocclusionculling)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/scamera.md#enabled)`get` `set` |
| float [**FieldOfView** ](/scripting/client-scripting-api-reference/components/scamera.md#fieldofview)`get` `set` |
| bool [**Orthographic** ](/scripting/client-scripting-api-reference/components/scamera.md#orthographic)`get` `set` |
| float [**OrthographicSize** ](/scripting/client-scripting-api-reference/components/scamera.md#orthographicsize)`get` `set` |
| float [**NearClip** ](/scripting/client-scripting-api-reference/components/scamera.md#nearclip)`get` `set` |
| float [**FarClip** ](/scripting/client-scripting-api-reference/components/scamera.md#farclip)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### TakePhoto[β](#takephoto "Direct link to TakePhoto")
void **TakePhoto** ()
*Triggers the Photo window in the UI, with the output of this camera. Perfect for photo booths.*
* Lua
```lua
Space.Host.ExecutingObject.Camera.TakePhoto()
```
##### TakeSnapshot[β](#takesnapshot "Direct link to TakeSnapshot")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **TakeSnapshot** ()
*Captures a texture from the camera, and saves it in a SResource*
* Lua
```lua
Space.Host.ExecutingObject.Camera.TakeSnapshot()
```
#### Properties[β](#properties "Direct link to Properties")
##### HDR[β](#hdr "Direct link to HDR")
bool **HDR** `get` `set`
*Can this camera write HDR values? (i.e. values brighter than 1.0)*
* Lua
```lua
Space.Host.ExecutingObject.Camera.HDR = true
```
##### PixelWidth[β](#pixelwidth "Direct link to PixelWidth")
int **PixelWidth** `get`
*The width of this Camera's texture, in pixels*
* Lua
```lua
cameraWidthPixels = Space.Host.ExecutingObject.Camera.PixelWidth
```
##### PixelHeight[β](#pixelheight "Direct link to PixelHeight")
int **PixelHeight** `get`
*The height of this Camera's texture in pixels*
* Lua
```lua
cameraHeightPixels = Space.Host.ExecutingObject.Camera.PixelHeight
```
##### Velocity[β](#velocity "Direct link to Velocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Velocity** `get`
World space speed of this camera, typically used for motion blur.
* Lua
```lua
cameraVelocity = Space.Host.ExecutingObject.Camera.Velocity
```
##### UseOcclusionCulling[β](#useocclusionculling "Direct link to UseOcclusionCulling")
bool **UseOcclusionCulling** `get` `set`
*Is Occlusion Culling enabled on this camera?*
* Lua
```lua
Space.Host.ExecutingObject.Camera.UseOcclusionCulling = true
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is this camera enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Camera.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Camera component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Camera
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### FieldOfView[β](#fieldofview "Direct link to FieldOfView")
float **FieldOfView** `get` `set`
*The field of view of the camera, in typical scenarios, Sinespace uses a value of 52; however Unity will default to 60.*
* Lua
```lua
Space.Host.ExecutingObject.Camera.FieldOfView = 70
```
##### Orthographic[β](#orthographic "Direct link to Orthographic")
bool **Orthographic** `get` `set`
*Does this camera render without perspective?*
* Lua
```lua
Space.Host.ExecutingObject.Camera.Orthographic = true
```
##### OrthographicSize[β](#orthographicsize "Direct link to OrthographicSize")
float **OrthographicSize** `get` `set`
*The width of the camera when in Orthographic mode. Height will be adjusted based on aspect ratio of the Render Texture*
* Lua
```lua
Space.Host.ExecutingObject.Camera.OrthographicSize = 5.0
```
##### NearClip[β](#nearclip "Direct link to NearClip")
float **NearClip** `get` `set`
*How close can an object be to the camera plane before it is not rendered?*
* Lua
```lua
Space.Host.ExecutingObject.Camera.NearClip = 2.0
```
##### FarClip[β](#farclip "Direct link to FarClip")
float **FarClip** `get` `set`
*How far is an object from the camera plane before it is not rendered?*
* Lua
```lua
Space.Host.ExecutingObject.Camera.FarClip = 6.0
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Camera.GameObject
```
---
### SCanvasGroup
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| float [**Alpha** ](/scripting/client-scripting-api-reference/components/scanvasgroup.md#alpha)`get` `set` |
| bool [**BlocksRaycasts** ](/scripting/client-scripting-api-reference/components/scanvasgroup.md#blocksraycasts)`get` `set` |
| bool [**IgnoreParentGroups** ](/scripting/client-scripting-api-reference/components/scanvasgroup.md#ignoreparentgroups)`get` `set` |
| bool [**Interactable** ](/scripting/client-scripting-api-reference/components/scanvasgroup.md#interactable)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Alpha[β](#alpha "Direct link to Alpha")
float **Alpha** `get` `set`
S*et the alpha of the group.*
* Lua
```lua
Space.Host.CanvasGroup.Alpha = 1.0
```
##### BlocksRaycasts[β](#blocksraycasts "Direct link to BlocksRaycasts")
bool **BlocksRaycasts** `get` `set`
*Does this group block raycasting (allow collision)?*
* Lua
```lua
Space.Host.CanvasGroup.BlocksRaycasts = true
```
##### IgnoreParentGroups[β](#ignoreparentgroups "Direct link to IgnoreParentGroups")
bool **IgnoreParentGroups** `get` `set`
*Should the group ignore parent groups?*
* Lua
```lua
Space.Host.CanvasGroup.IgnoreParentGroups = true
```
##### Interactable[β](#interactable "Direct link to Interactable")
bool **Interactable** `get` `set`
*Is the group interactable (are the elements beneath the group enabled)?*
* Lua
```lua
Space.Host.CanvasGroup.Interactable = true
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.CanvasGroup.GameObject
```
---
### SCapsuleCollider
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------- |
| SVector [**Center** ](/scripting/client-scripting-api-reference/components/scapsulecollider.md#center)`get` `set` |
| int [**Direction** ](/scripting/client-scripting-api-reference/components/scapsulecollider.md#direction)`get` `set` |
| float [**Height** ](/scripting/client-scripting-api-reference/components/scapsulecollider.md#height)`get` `set` |
| float [**Radius** ](/scripting/client-scripting-api-reference/components/scapsulecollider.md#radius)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/scapsulecollider.md#enabled)`get` `set` |
| bool [**IsTrigger** ](/scripting/client-scripting-api-reference/components/scapsulecollider.md#istrigger)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Center[β](#center "Direct link to Center")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Center** `get` `set`
*The center of the capsule, measured in the object's local space.*
* Lua
```lua
Center = Space.Host.ExecutingObject.CapsuleCollider.Center
```
* Lua
```lua
--clicking this object moves it's Capsule Collider's center one unit upwards
thisObject = Space.Host.ExecutingObject
OnClick = function()
center = thisObject.CapsuleCollider.Center
thisObject.CapsuleCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Direction[β](#direction "Direct link to Direction")
int **Direction** `get` `set`
*The direction of the capsule.*
* Lua
```lua
Direction = Space.Host.ExecutingObject.CapsuleCollider.Direction
```
* Lua
```lua
--clicking this object increases it's Capsule Collider's direction by one unit
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.CapsuleCollider.Direction
thisObject.CapsuleCollider.Direction = thisObject.CapsuleCollider.Direction + 1
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Height[β](#height "Direct link to Height")
float **Height** `get set`
*The height of the capsule measured in the object's local space.*
* Lua
```lua
Space.Host.ExecutingObject.CapsuleCollider.Height = 5.0
```
* Lua
```lua
--clicking this object increases it's Capsule Collider's height by one unit
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.CapsuleCollider.Height
thisObject.CapsuleCollider.Height= thisObject.CapsuleCollider.Height+ 1.0
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Radius[β](#radius "Direct link to Radius")
float **Radius** `get` `set`
*The radius of the capsule.*
* Lua
```lua
Radius = Space.Host.ExecutingObject.CapsuleCollider.Radius
```
* Lua
```lua
--clicking this object increments it's Capsule Collider's radius by one unit
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.CapsuleCollider.Radius = thisObject.CapsuleCollider.Radius + 1
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enabled Colliders will collide with other Colliders, disabled Colliders won't.*
* Lua
```lua
Space.Host.ExecutingObject.CapsuleCollider.Enabled = false
```
* Lua
```lua
--clicking this object toggles it's Capsule Collider On/Off
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.CapsuleCollider.Enabled = not thisObject.CapsuleCollider.Enabled
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### IsTrigger[β](#istrigger "Direct link to IsTrigger")
bool **IsTrigger** `get` `set`
*Is the collider a trigger?*
* Lua
```lua
Space.Host.ExecutingObject.CapsuleCollider.IsTrigger = false
```
* Lua
```lua
--clicking this object toggles it's Capsule Collider between being a Collider vs Trigger Collider
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.CapsuleCollider.IsTrigger = not thisObject.CapsuleCollider.IsTrigger
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.CapsuleCollider.GameObject
```
---
### SCharacterController
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SVector [**ClosestPointOnBounds** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#closestpointonbounds)(SVector position) |
| SVector [**ClosestPoint** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#closestpointonbounds)(SVector position) |
| bool [**SimpleMove** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#simplemove)(SVector speed) |
| int [**Move** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#move)(SVector motion) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------ |
| SVector [**Center** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#center)`get` `set` |
| bool [**DetectCollisions** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#detectcollisions)`get` `set` |
| bool [**EnableOverlapRecovery** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#enableoverlaprecovery)`get` `set` |
| float [**Height** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#height)`get` `set` |
| float [**MinMoveDistance** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#minmovedistance)`get` `set` |
| float [**Radius** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#radius)`get` `set` |
| float [**SkinWidth** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#skinwidth)`get` `set` |
| float [**SlopeLimit** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#slopelimit)`get` `set` |
| float [**StepOffset** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#stepoffset)`get` `set` |
| SVector [**Velocity** ](/scripting/client-scripting-api-reference/components/scharactercontroller.md#velocity)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### ClosestPointOnBounds[β](#closestpointonbounds "Direct link to ClosestPointOnBounds")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **ClosestPointOnBounds** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*The closest point to the bounding box of the attached collider. This can be used to calculate hit points when applying explosion damage.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
closestPoint = Space.Host.ExecutingObject.CharacterController.ClosestPointOnBounds(Vector.New(0,0,0))
```
##### ClosestPoint[β](#closestpoint "Direct link to ClosestPoint")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **ClosestPoint** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*The point on the collider that is closest to the specified location.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
closestPoint = Space.Host.ExecutingObject.CharacterController.ClosestPoint = Vector.New(0,0,0)
```
##### SimpleMove[β](#simplemove "Direct link to SimpleMove")
bool **SimpleMove** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) speed)
*Moves the character with speed. Velocity along the y-axis is ignored. Speed is in units/s. Gravity is automatically applied.*
*Returns if the character is grounded.*
*It is recommended that you make only one call to Move or SimpleMove per frame.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isGrounded = Space.Host.ExecutingObject.CharacterController.SimpleMove = Vector.New(100,0,0)
```
##### Move[β](#move "Direct link to Move")
int **Move** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) motion)
*Supplies the movement of a* [*SGameObject*](/scripting/client-scripting-api-reference/types/sgameobject.md) *with an attached SCharacterController component.*
*The SCharacterController.Move motion moves the* [*SGameObject*](/scripting/client-scripting-api-reference/types/sgameobject.md) *in the given direction. The given direction requires absolute movement delta values. A collision constrains the Move from taking place.*
*Returns an int indicating the direction of a collision: None (0), Sides (1), Above (2), and Below (3). SCharacterController.Move does not use gravity.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
collisionDirection = Space.Host.ExecutingObject.CharacterController.Move = Vector.New(100,0,0)
```
#### Properties[β](#properties "Direct link to Properties")
##### Center[β](#center "Direct link to Center")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Center** `get` `set`
*Returns Center Vector value of the Character Controller.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.Center = Vector.New(0,0,0)
```
##### DetectCollisions[β](#detectcollisions "Direct link to DetectCollisions")
bool **DetectCollisions** `get` `set`
*Determines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled).*
*This method does not affect collisions detected during the character controller's movement but rather decides whether an incoming collider will be blocked by the controller's collider. For example, a box collider in the Scene will block the movement of the controller, but the box may still fall through the controller if detectCollisions is false. This property is useful to disable the character controller temporarily. For example, you might want to mount a character into a car and disable collision detection until it exits the car again.*
* Lua
```lua
Space.Host.CharacterController.DetectCollisions= false
```
* Lua
```lua
--clicking this object will toggle a Character Controller's Detect Collisions property
thisObject = Space.Host.ExecutingObject
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController --add Reference to Scripting Runtime
function OnClickFunction()
ccontroller.DetectCollisions = not ccontroller.DetectCollisions
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### EnableOverlapRecovery[β](#enableoverlaprecovery "Direct link to EnableOverlapRecovery")
bool **EnableOverlapRecovery** `get` `set`
*Enables or disables overlap recovery. Enables or disables overlap recovery. Used to depenetrate character controllers from static objects when an overlap is detected.*
*Overlap recovery can be used to depenetrate character controllers (CCTs) from static objects when an overlap is detected. This can happen in three main cases:*
*- when the CCT is directly spawned or teleported in another object*
*- when the CCT algorithm fails due to limited FPU accuracy*
*- when the "up vector" is modified, making the rotated CCT shape overlap surrounding objects*
*When activated, the CCT module will automatically try to resolve the penetration, and move the CCT to a safe place where it does*
*not overlap other objects anymore. This only concerns static objects, dynamic objects are ignored by overlap recovery.*
*When overlap recovery is not activated, it is possible for the CCTs to go through static objects. By default, overlap recovery is enabled.*
*Overlap recovery currently works with all geometries except heightfields.*
* Lua
```lua
Space.Host.CharacterController.EnableOverlapRecovery= false
```
* Lua
```lua
--clicking this object will toggle a Character Controller's Enable Overlap Recovery property
thisObject = Space.Host.ExecutingObject
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController --add Reference to Scripting Runtime
function OnClickFunction()
ccontroller.EnableOverlapRecovery = not ccontroller.EnableOverlapRecovery
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Height[β](#height "Direct link to Height")
float **Height** `get` `set`
*The height of the character's capsule.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.Height = 4
```
* Lua
```lua
--the below script will make a slider change a Character Controller Height property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController
OVC = function()
ccontroller.Height = (slider.Value * 10.0) -- from 0.0 to 10.0
end
slider.OnValueChanged(OVC)
```
##### MinMoveDistance[β](#minmovedistance "Direct link to MinMoveDistance")
float **MinMoveDistance** `get` `set`
*Gets or sets the minimum move distance of the character controller.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.MinMoveDistance = 3
```
* Lua
```lua
--this script will make a slider change a Character Controller Min Move Distance property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController
OVC = function()
ccontroller.MinMoveDistance= (slider.Value * 10.0) -- from 0.0 to 10.0
end
slider.OnValueChanged(OVC)
```
##### Radius[β](#radius "Direct link to Radius")
float **Radius** `get` `set`
*The radius of the character's capsule.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.Radius = 5
```
* Lua
```lua
--this script will make a slider change a Character Controller Radius property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController
OVC = function()
ccontroller.Radius= (slider.Value * 10.0) -- from 0.0 to 10.0
end
slider.OnValueChanged(OVC)
```
##### SkinWidth[β](#skinwidth "Direct link to SkinWidth")
float **SkinWidth** `get` `set`
*The character's collision skin width.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.SkinWidth = 4
```
* Lua
```lua
--this script will make a slider change a Character Controller SkinWidth property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController
OVC = function()
ccontroller.SkinWidth= (slider.Value * 10.0) -- from 0.0 to 10.0
end
slider.OnValueChanged(OVC)
```
##### SlopeLimit[β](#slopelimit "Direct link to SlopeLimit")
float **SlopeLimit** `get` `set`
*The character controllers slope limit in degrees.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.SlopeLimit= 2
```
* Lua
```lua
--this script will make a slider change a Character Controller Slope Limit property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController
OVC = function()
ccontroller.SlopeLimit= (slider.Value * 180.0) -- from 0.0 to 180.0
end
slider.OnValueChanged(OVC)
```
##### StepOffset[β](#stepoffset "Direct link to StepOffset")
float **StepOffset** `get` `set`
*The character controllers step offset in meters.*
* Lua
```lua
Space.Host.ExecutingObject.CharacterController.StepOffset= 2
```
* Lua
```lua
--this script will make a slider change a Character Controller Step Offset property
--[Add "theslider" and "thecharactercontroller" to the Object References section in Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
ccontroller = Space.Host.GetReference("thecharactercontroller").CharacterController
OVC = function()
ccontroller.StepOffset= (slider.Value * 10.0) -- from 0.0 to 10.0
end
slider.OnValueChanged(OVC)
```
##### Velocity[β](#velocity "Direct link to Velocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Velocity** `get`
*The current relative velocity of the Character.*
* Lua
```lua
currentRelativeVelocity = Space.Host.ExecutingObject.CharacterController.Velocity
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.CharacterController.GameObject
```
---
### SClickable
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**AddExtraAction** ](/scripting/client-scripting-api-reference/components/sclickable.md#addextraaction)(string name, string tooltip, Closure e) |
| void [**ClearActions** ](/scripting/client-scripting-api-reference/components/sclickable.md#clearactions)() |
| void [**OnClick** ](/scripting/client-scripting-api-reference/components/sclickable.md#onclick)(Closure e) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------ |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sclickable.md#enabled)`get` `set` |
| string [**Tooltip** ](/scripting/client-scripting-api-reference/components/sclickable.md#tooltip)`get` `set` |
| SGameObject **GameObject** `get` |
#### Functions[β](#functions "Direct link to Functions")
##### AddExtraAction[β](#addextraaction "Direct link to AddExtraAction")
void **AddExtraAction** (string name, string tooltip, Closure e)
*Add a new action for the object to perform when clicked. Can be useful for providing miltuple choice of an action on click.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Clickable.AddExtraAction ("ButtonName", "Tooltip Text Here", AFunction)
```
##### ClearActions[β](#clearactions "Direct link to ClearActions")
void **ClearActions** ()
*Removes all actions from the clickable GameObject.*
* Lua
```lua
Space.Host.ExecutingObject.Clickable.ClearActions()
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject
hostObject.AddClickable()
function ClickMe ()
Space.Log("I was clicked!")
end
function ClickAndClear ()
Space.Log("No more actions!")
hostObject.Clickable.ClearActions ()
end
hostObject.Clickable.AddExtraAction ("LogButton", "Prints I was clicked! to the console", ClickMe)
hostObject.Clickable.AddExtraAction ("ClearButton", "Clears all actions", ClickAndClear)
-- Now, when the latter option is chosen, the script clears the Clickable component of all actions.
```
##### OnClick[β](#onclick "Direct link to OnClick")
void **OnClick** (Closure e)
*When clicked, the GameObject performs the required action.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Clickable.OnClick(AFunction)
```
* Lua
```lua
hostObject = Space.Host.ExecutingObject
hostObject.AddClickable()
deltaPos = Vector.New(0,0,1)
function MakeMeMove ()
hostObject.WorldPosition = hostObject.WorldPosition + deltaPos
end
hostObject.Clickable.OnClick (MakeMeMove);
-- Now, every time an object is clicked, it moves by 1 in the positive Z direction.
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enable or disable the clickable component from a GameObject.*
* Lua
```lua
Space.Host.ExecutingObject.Clickable.Enabled = false
```
* Lua
```lua
--Clicking the object will disable the component, making it only clickable once
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
thisGameObject.Clickable.Enabled = false
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to activate"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Tooltip[β](#tooltip "Direct link to Tooltip")
string **Tooltip** `get` `set`
*A hint that pops up when the mouse is hovering over the GameObject.*
* Lua
```lua
Space.Host.ExecutingObject.Clickable.Tooltip = "test"
```
* Lua
```lua
--Clicking the object will toggle between two different tooltips
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if thisGameObject.Clickable.Tooltip == "Turn On" then
thisGameObject.Clickable.Tooltip = "Turn Off"
else
thisGameObject.Clickable.Tooltip = "Turn On"
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Turn On"
thisGameObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
SGameObject **GameObject** `get`
*Returns a reference to the GameObject of this component.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Clickable.GameObject
```
---
### SCloth
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------------------ |
| float [**BendingStiffness** ](/scripting/client-scripting-api-reference/components/scloth.md#bendingstiffness)`get` `set` |
| float [**CollisionMassScale** ](/scripting/client-scripting-api-reference/components/scloth.md#collisionmassscale)`get` `set` |
| bool [**EnableContinuousCollision** ](/scripting/client-scripting-api-reference/components/scloth.md#enablecontinuouscollision)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/scloth.md#enabled)`get` `set` |
| SVector [**ExternalAcceleration** ](/scripting/client-scripting-api-reference/components/scloth.md#externalacceleration)`get` `set` |
| float [**Friction** ](/scripting/client-scripting-api-reference/components/scloth.md#friction)`get` `set` |
| SVector [**RandomAcceleration** ](/scripting/client-scripting-api-reference/components/scloth.md#randomacceleration)`get` `set` |
| float [**StretchingStiffness** ](/scripting/client-scripting-api-reference/components/scloth.md#stretchingstiffness)`get` `set` |
| bool [**UseGravity** ](/scripting/client-scripting-api-reference/components/scloth.md#usegravity)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/scloth.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### BendingStiffness[β](#bendingstiffness "Direct link to BendingStiffness")
float **BendingStiffness** `get` `set`
*Bending stiffness of cloth.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.BendingStiffness = 0.5
```
##### CollisionMassScale[β](#collisionmassscale "Direct link to CollisionMassScale")
float **CollisionMassScale** `get` `set`
*Increase the mass of colliding particles.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.CollisionMassScale = 0.5
```
##### EnableContinuousCollision[β](#enablecontinuouscollision "Direct link to EnableContinuousCollision")
bool **EnableContinuousCollision** `get` `set`
*Enable continuous collision to improve collision stability.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.EnableContinuousCollision = true
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enable or disable components.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Cloth component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Cloth
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### ExternalAcceleration[β](#externalacceleration "Direct link to ExternalAcceleration")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **ExternalAcceleration** `get` `set`
*A constant external acceleration applied to the cloth.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.ExternalAcceleration = Vector.New(2,4,5)
```
##### Friction[β](#friction "Direct link to Friction")
float **Friction** `get` `set`
*Return the friction of the cloth when colliding with the character.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.Friction = 0.8
```
##### RandomAcceleration[β](#randomacceleration "Direct link to RandomAcceleration")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **RandomAcceleration** `get` `set`
*A constant external acceleration applied to the cloth.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.RandomAcceleration = Vector.New(2,4,5)
```
##### StretchingStiffness[β](#stretchingstiffness "Direct link to StretchingStiffness")
float **StretchingStiffness** `get` `set`
*Stretching stiffness of the cloth.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.StretchingStiffness = 0.6
```
##### UseGravity[β](#usegravity "Direct link to UseGravity")
bool **UseGravity** `get` `set`
*Stretching stiffness of the cloth.*
* Lua
```lua
Space.Host.ExecutingObject.Cloth.UseGravity = true
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Cloth.GameObject
```
---
### SCollider
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/scollider.md#enabled)`get` `set` |
| bool [**IsTrigger** ](/scripting/client-scripting-api-reference/components/scollider.md#istrigger)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/scollider.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enable or disable the collider.*
* Lua
```lua
Space.Host.ExecutingObject.Collider.Enabled= false
```
* Lua
```lua
--clicking this object toggles it's Collider On/Off
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.Collider.Enabled = not thisObject.Collider.Enabled
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### IsTrigger[β](#istrigger "Direct link to IsTrigger")
bool **IsTrigger** `get` `set`
*Set Collider as a trigger.*
* Lua
```lua
Space.Host.ExecutingObject.Collider.IsTrigger = true
```
* Lua
```lua
--clicking this object toggles it's collider between being a Collider vs Trigger Collider
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.Collider.IsTrigger = not thisObject.Collider.IsTrigger
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Collider.GameObject
```
---
### SContentSizeFitter
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetLayoutHorizontal** ](/scripting/client-scripting-api-reference/components/scontentsizefitter.md#setlayouthorizontal)() |
| void [**SetLayoutVertical** ](/scripting/client-scripting-api-reference/components/scontentsizefitter.md#setlayoutvertical)() |
| void [**RefreshLayout** ](/scripting/client-scripting-api-reference/components/scontentsizefitter.md#refreshlayout)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enable** ](/scripting/client-scripting-api-reference/components/scontentsizefitter.md#enable)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/scontentsizefitter.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SetLayoutHorizontal[β](#setlayouthorizontal "Direct link to SetLayoutHorizontal")
void **SetLayoutHorizontal** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.ContentSizeFitter.SetLayoutHorizontal()
```
##### SetLayoutVertical[β](#setlayoutvertical "Direct link to SetLayoutVertical")
void **SetLayoutVertical** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.ContentSizeFitter.SetLayoutVertical()
```
##### RefreshLayout[β](#refreshlayout "Direct link to RefreshLayout")
void **RefreshLayout** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.ContentSizeFitter.RefreshLayout()
```
#### Properties[β](#properties "Direct link to Properties")
##### Enable[β](#enable "Direct link to Enable")
bool **Enable** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.ContentSizeFitter.Enable = true
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.ContentSizeFitter.GameObject
```
---
### SEmbeddedVideo
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------- |
| void [**OnStateChange** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#onstatechange)(Closure e) |
| void [**Play** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#play)() |
| void [**Stop** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#stop)() |
| void [**Pause** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#pause)() |
| void [**Resume** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#resume)() |
| void [**SynchorizeUrl** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#synchorizeurl)() |
| void [**ClearRenderTexture** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#clearrendertexture)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| SEmbeddedVideoState [**State** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#state)`get` |
| string [**URL** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#url)`get` `set` |
| SAudioSource [**AudioSource** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#audiosource)`get` `set` |
| SResource [**OutputTexture** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#outputtexture)`get` |
| SResource [**Texture** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#texture)`get` |
| double [**Time** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#time)`get` `set` |
| long [**Position** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#position)`get` |
| string [**UniqueName** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#uniquename)`get` |
| double [**VideoLength** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#videolength)`get` |
| bool [**Loop** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#loop)`get` `set` |
| int [**FrameCount** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#framecount)`get` |
| bool [**IsPlaying** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#isplaying)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sembeddedvideo.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### OnStateChange[β](#onstatechange "Direct link to OnStateChange")
void **OnStateChange** (Closure e)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function stateChangeFunction(EmbeddedVideo, oldState, newState)
--what happens on state change
end
Space.Host.ExecutingObject.EmbeddedVideo.OnStageChange(stateChangeFunction)
```
* Lua
```lua
--get embedded video component on your video player
video = Space.Scene.Find("VidepPlayer").EmbeddedVideo
function GetClosure()
return function (a,b,c)
log(a.URL..b..c)
end
end
video.OnStateChange(GetClosure())
video.Pause()
```
##### Play[β](#play "Direct link to Play")
void **Play** ()
*If URL is set, plays the video*
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.Play()
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*Stops the playback*
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.Stop()
```
##### Pause[β](#pause "Direct link to Pause")
void **Pause** ()
*Pauses currently played video*
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.Pause()
```
##### Resume[β](#resume "Direct link to Resume")
void **Resume** ()
*If the video is currently paused, it will resume playback*
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.Resume()
```
##### SynchorizeUrl[β](#synchorizeurl "Direct link to SynchorizeUrl")
void **SynchorizeUrl** ()
*Synchorize current video* URL
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.SynchorizeUrl()
```
##### ClearRenderTexture[β](#clearrendertexture "Direct link to ClearRenderTexture")
void **ClearRenderTexture** ()
*Clears the Render Texture*
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.ClearRenderTexture()
```
#### Properties[β](#properties "Direct link to Properties")
##### State[β](#state "Direct link to State")
[SEmbeddedVideoState](/scripting/client-scripting-api-reference/components/sembeddedvideo.md) **State** `get`
*The state player is currently in. You can track state changes through StateChangeEvent.*
* Lua
```lua
CurrentVideoState = Space.Host.ExecutingObject.EmbeddedVideo.State
```
##### URL[β](#url "Direct link to URL")
string **URL** `get` `set`
*Current URL set for this Player.*
* Lua
```lua
CurrentURL = Space.Host.ExecutingObject.EmbeddedVideo.URL
```
##### AudioSource[β](#audiosource "Direct link to AudioSource")
[SAudioSource](/scripting/client-scripting-api-reference/components/saudiosource.md) **AudioSource** `get` `set`
*Current AudioSource*
* Lua
```lua
CurrentAudioSource = Space.Host.ExecutingObject.EmbeddedVideo.AudioSource
```
##### OutputTexture[β](#outputtexture "Direct link to OutputTexture")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **OutputTexture** `get`
*Property Description*
* Lua
```lua
OutputTexture = Space.Host.ExecutingObject.EmbeddedVideo.OutputTexture
```
##### Texture[β](#texture "Direct link to Texture")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Texture** `get`
*Texture which the player uses to display the video.*
* Lua
```lua
Texture = Space.Host.ExecutingObject.EmbeddedVideo.Texture
```
##### Time[β](#time "Direct link to Time")
double **Time** `get` `set`
*Current player time. Can be set to move the 'playhead' to the specific position.*
* Lua
```lua
Time = Space.Host.ExecutingObject.EmbeddedVideo.Time
```
##### Position[β](#position "Direct link to Position")
long **Position** `get`
*Current Video Frame Position*
* Lua
```lua
Position = Space.Host.ExecutingObject.EmbeddedVideo.Position
```
##### UniqueName[β](#uniquename "Direct link to UniqueName")
string **UniqueName** `get`
*Property Description*
* Lua
```lua
UniqueName = Space.Host.ExecutingObject.EmbeddedVideo.UniqueName
```
##### VideoLength[β](#videolength "Direct link to VideoLength")
double **VideoLength** `get`
*Get the length of the video*
* Lua
```lua
VideoLength = Space.Host.ExecutingObject.EmbeddedVideo.VideoLength
```
##### Loop[β](#loop "Direct link to Loop")
bool **Loop** `get` `set`
*Whether video is set to loop or not*
* Lua
```lua
Space.Host.ExecutingObject.EmbeddedVideo.Loop = true
```
##### FrameCount[β](#framecount "Direct link to FrameCount")
int **FrameCount** `get`
*Returns the frame count of the video*
* Lua
```lua
FrameCount = Space.Host.ExecutingObject.EmbeddedVideo.FrameCount
```
##### IsPlaying[β](#isplaying "Direct link to IsPlaying")
bool **IsPlaying** `get`
*Returns whether the video is playing or not*
* Lua
```lua
IsPlaying = Space.Host.ExecutingObject.EmbeddedVideo.IsPlaying
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.EmbeddedVideo.GameObject
```
---
### SEventCalendar
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------- |
| void [**SwitchEventType** ](/scripting/client-scripting-api-reference/components/seventcalendar.md#switcheventtype)(int typeNumber) |
| void [**ChangeRange** ](/scripting/client-scripting-api-reference/components/seventcalendar.md#changerange)(int range) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------- |
| int [**Range** ](/scripting/client-scripting-api-reference/components/seventcalendar.md#range)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/seventcalendar.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SwitchEventType[β](#switcheventtype "Direct link to SwitchEventType")
void **SwitchEventType** (int typeNumber)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.EventCalendar.SwitchEventType(1)
```
##### ChangeRange[β](#changerange "Direct link to ChangeRange")
void **ChangeRange** (int range)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.EventCalendar.ChangeRange(3)
```
#### Properties[β](#properties "Direct link to Properties")
##### Range[β](#range "Direct link to Range")
int **Range** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.EventCalendar.Range = 3
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.EventCalendar.GameObject
```
---
### SFurniture
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------- |
| void [**StoreCustomData** ](/scripting/client-scripting-api-reference/components/sfurniture.md#storecustomdata)(string key, string value) |
| string [**GetCustomData** ](/scripting/client-scripting-api-reference/components/sfurniture.md#getcustomdata)(string key) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------- |
| int [**InventoryItemID** ](/scripting/client-scripting-api-reference/components/sfurniture.md#inventoryitemid)`get` |
| SRoomFloor [**Floor** ](/scripting/client-scripting-api-reference/components/sfurniture.md#floor)`get` |
| SCollider [**MainCollider** ](/scripting/client-scripting-api-reference/components/sfurniture.md#maincollider)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sfurniture.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### StoreCustomData[β](#storecustomdata "Direct link to StoreCustomData")
void **StoreCustomData** (string key, string value)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Furniture.StoreCustomData("AKey", "AValue")
```
##### GetCustomData[β](#getcustomdata "Direct link to GetCustomData")
string **GetCustomData** (string key)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
theValue = Space.Host.ExecutingObject.Furniture.GetCustomData("AKey")
```
#### Properties[β](#properties "Direct link to Properties")
##### InventoryItemID[β](#inventoryitemid "Direct link to InventoryItemID")
int **InventoryItemID** `get`
*Return the inventory ID of furniture.*
* Lua
```lua
inventoryID = Space.Host.ExecutingObject.Furniture.InventoryItemID
```
##### Floor[β](#floor "Direct link to Floor")
[SRoomFloor](/scripting/client-scripting-api-reference/components/sroomfloor.md) **Floor** `get`
*Return an SRoomFloor component of the floor this furniture is placed on.*
* Lua
```lua
sRoomFloor = Space.Host.ExecutingObject.Furniture.Floor
```
##### MainCollider[β](#maincollider "Direct link to MainCollider")
[SCollider](/scripting/client-scripting-api-reference/components/scollider.md) **MainCollider** `get`
*Property Description*
* Lua
```lua
collider = Space.Host.ExecutingObject.Furniture.MainCollider
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Furniture.GameObject
```
---
### SGraphicRaycaster
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------- |
| SUIRaycastResult [**Raycast** ](/scripting/client-scripting-api-reference/components/sgraphicraycaster.md#raycast)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| int [**SortOrderPriority** ](/scripting/client-scripting-api-reference/components/sgraphicraycaster.md#sortorderpriority)`get` |
| int [**RenderOrderPriority** ](/scripting/client-scripting-api-reference/components/sgraphicraycaster.md#renderorderpriority)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sgraphicraycaster.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Raycast[β](#raycast "Direct link to Raycast")
[SUIRaycastResult](/scripting/client-scripting-api-reference/types/suiraycastresult.md) **Raycast** ()
*Perform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
raycastResult = Space.Host.ExecutingObject.GraphicRaycaster.Raycast()
```
* Lua
```lua
local trans = Space.Host.ExecutingObject
local canvas = Space.Host.GetReference("Canvas")
local gr = canvas.GraphicRaycaster
function Update()
local raycast = gr.Raycast()
Space.Log(raycast.ToString())
end
trans.OnUpdate(Update)
```
#### Properties[β](#properties "Direct link to Properties")
##### SortOrderPriority[β](#sortorderpriority "Direct link to SortOrderPriority")
int **SortOrderPriority** `get`
*Priority of the raycaster based upon render orderPriority of the raycaster based upon sort order.*
* Lua
```lua
Space.Host.ExecutingObject.GraphicRaycaster.SortOrderPriority= 1
```
##### RenderOrderPriority[β](#renderorderpriority "Direct link to RenderOrderPriority")
int **RenderOrderPriority** `get`
*Priority of the raycaster based upon render order.*
* Lua
```lua
Space.Host.ExecutingObject.GraphicRaycaster.RenderOrderPriority = 1
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.GraphicRaycaster.GameObject
```
---
### SHingeJoint
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| SRigidbody [**ConnectedBody** ](/scripting/client-scripting-api-reference/components/shingejoint.md#connectedbody)`get` `set` |
| SVector [**Axis** ](/scripting/client-scripting-api-reference/components/shingejoint.md#axis)`get` `set` |
| SVector [**Anchor** ](/scripting/client-scripting-api-reference/components/shingejoint.md#anchor)`get` `set` |
| SVector [**ConnectedAnchor** ](/scripting/client-scripting-api-reference/components/shingejoint.md#connectedanchor)`get` `set` |
| bool [**AutoConfigureConnectedAnchor** ](/scripting/client-scripting-api-reference/components/shingejoint.md#autoconfigureconnectedanchor)`get` `set` |
| float [**BreakForce** ](/scripting/client-scripting-api-reference/components/shingejoint.md#breakforce)`get` `set` |
| float [**BreakTorque** ](/scripting/client-scripting-api-reference/components/shingejoint.md#breaktorque)`get` `set` |
| bool [**EnableCollision** ](/scripting/client-scripting-api-reference/components/shingejoint.md#enablecollision)`get` `set` |
| bool [**EnablePreprocessing** ](/scripting/client-scripting-api-reference/components/shingejoint.md#enablepreprocessing)`get` `set` |
| SVector [**CurrentForce** ](/scripting/client-scripting-api-reference/components/shingejoint.md#currentforce)`get` |
| SVector [**CurrentTorque** ](/scripting/client-scripting-api-reference/components/shingejoint.md#currenttorque)`get` |
| float [**MassScale** ](/scripting/client-scripting-api-reference/components/shingejoint.md#massscale)`get` `set` |
| float [**ConnectedMassScale** ](/scripting/client-scripting-api-reference/components/shingejoint.md#connectedmassscale)`get` `set` |
| SJointMotor [**Motor** ](/scripting/client-scripting-api-reference/components/shingejoint.md#motor)`get` `set` |
| SJointLimits [**Limits** ](/scripting/client-scripting-api-reference/components/shingejoint.md#limits)`get` `set` |
| SJointSpring [**Spring** ](/scripting/client-scripting-api-reference/components/shingejoint.md#spring)`get` `set` |
| bool [**UseMotor** ](/scripting/client-scripting-api-reference/components/shingejoint.md#usemotor)`get` `set` |
| bool [**UseLimits** ](/scripting/client-scripting-api-reference/components/shingejoint.md#uselimits)`get` `set` |
| bool [**UseSpring** ](/scripting/client-scripting-api-reference/components/shingejoint.md#usespring)`get` `set` |
| float [**Velocity** ](/scripting/client-scripting-api-reference/components/shingejoint.md#velocity)`get` |
| float [**Angle** ](/scripting/client-scripting-api-reference/components/shingejoint.md#angle)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/shingejoint.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### ConnectedBody[β](#connectedbody "Direct link to ConnectedBody")
[SRigidbody](/scripting/client-scripting-api-reference/components/srigidbody.md) **ConnectedBody** `get` `set`
*Set joint to a rigidbody. If not set, the joint connects to the world.*
* Lua
```lua
connectedRigidBody = Space.Host.ExecutingObject.HingeJoint.ConnectedBody
```
##### Axis[β](#axis "Direct link to Axis")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Axis** `get` `set`
*The direction of the axis around which the body swings. The direction is defined in local space.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.Axis = Vector.New(0,1,0)
```
##### Anchor[β](#anchor "Direct link to Anchor")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Anchor** `get` `set`
*The position of the axis around which the body swings. The position is defined in local space.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.Anchor = Vector.New(0, 0.5 , 0)
```
##### ConnectedAnchor[β](#connectedanchor "Direct link to ConnectedAnchor")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **ConnectedAnchor** `get` `set`
*Manual configuration of the connected anchor position.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.ConnectedAnchor = Vector.New(1,1,1)
```
##### AutoConfigureConnectedAnchor[β](#autoconfigureconnectedanchor "Direct link to AutoConfigureConnectedAnchor")
bool **AutoConfigureConnectedAnchor** `get` `set`
*If this is enabled, then the Connected Anchor position will be calculated automatically to match the global position of the anchor property. This is the default behavior. If this is disabled, you can configure the position of the connected anchor manually.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.AutoConfigureConnectedAnchor = false
```
##### BreakForce[β](#breakforce "Direct link to BreakForce")
float **BreakForce** `get` `set`
*Apply the force to break the joint.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.BreakForce = 20
```
##### BreakTorque[β](#breaktorque "Direct link to BreakTorque")
float **BreakTorque** `get` `set`
*Apply the torque to break the joint.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.BreakTorque = 1
```
##### EnableCollision[β](#enablecollision "Direct link to EnableCollision")
bool **EnableCollision** `get` `set`
*When checked, this enables collisions between bodies connected with a joint.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.EnableCollision = true
```
##### EnablePreprocessing[β](#enablepreprocessing "Direct link to EnablePreprocessing")
bool **EnablePreprocessing** `get` `set`
*Disabling preprocessing helps to stabilize impossible-to-fulfil configurations.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.EnablePreprocessing = true
```
##### CurrentForce[β](#currentforce "Direct link to CurrentForce")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **CurrentForce** `get`
*The force applied by the solver to satisfy all constraints.*
* Lua
```lua
vectorForce = Space.Host.ExecutingObject.HingeJoint.CurrentForce
```
##### CurrentTorque[β](#currenttorque "Direct link to CurrentTorque")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **CurrentTorque** `get`
*The torque applied by the solver to satisfy all constraints.*
* Lua
```lua
vectorTorque = Space.Host.ExecutingObject.HingeJoint.CurrentTorque
```
##### MassScale[β](#massscale "Direct link to MassScale")
float **MassScale** `get` `set`
*The scale to apply to the inverse mass and inertia tensor of the body*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.MassScale = 2
```
##### ConnectedMassScale[β](#connectedmassscale "Direct link to ConnectedMassScale")
float **ConnectedMassScale** `get` `set`
*The scale to apply to the inverse mass and inertia tensor of the connected body*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.ConnectedMassScale = 2
```
##### Motor[β](#motor "Direct link to Motor")
[SJointMotor](/scripting/client-scripting-api-reference/types/sjointmotor.md) **Motor** `get` `set`
*The motor makes the object spin around.*
* Lua
```lua
jointMotor = Space.Host.ExecutingObject.HingeJoint.Motor
```
##### Limits[β](#limits "Direct link to Limits")
[SJointLimits](/scripting/client-scripting-api-reference/types/sjointlimits.md) **Limits** `get` `set`
*The motor makes the object spin around.*
* Lua
```lua
jointLimits = Space.Host.ExecutingObject.HingeJoint.Limits
```
##### Spring[β](#spring "Direct link to Spring")
[SJointSpring](/scripting/client-scripting-api-reference/types/sjointspring.md) **Spring** `get` `set`
*The motor makes the object spin around.*
* Lua
```lua
jointSpring = Space.Host.ExecutingObject.HingeJoint.Spring
```
##### UseMotor[β](#usemotor "Direct link to UseMotor")
bool **UseMotor** `get` `set`
*The motor makes the object spin around.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.UseMotor = true
```
##### UseLimits[β](#uselimits "Direct link to UseLimits")
bool **UseLimits** `get` `set`
*If enabled, the angle of the hinge will be restricted within the Min & Max values.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.UseLimits = true
```
##### UseSpring[β](#usespring "Direct link to UseSpring")
bool **UseSpring** `get` `set`
*Spring makes the Rigidbody reach for a specific angle compared to its connected body.*
* Lua
```lua
Space.Host.ExecutingObject.HingeJoint.UseSpring = true
```
##### Velocity[β](#velocity "Direct link to Velocity")
float **Velocity** `get`
*The angular velocity of the joint in degrees per second.*
* Lua
```lua
floatVelocity = Space.Host.ExecutingObject.HingeJoint.Velocity
```
##### Angle[β](#angle "Direct link to Angle")
float **Angle** `get`
*The current angle in degrees of the joint relative to its rest position.*
* Lua
```lua
floatAngle = Space.Host.ExecutingObject.HingeJoint.Angle
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.HingeJoint.GameObject
```
---
### SLight
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/slight.md#enabled)`get` `set` |
| float [**Range** ](/scripting/client-scripting-api-reference/components/slight.md#range)`get` `set` |
| float [**SpotAngle** ](/scripting/client-scripting-api-reference/components/slight.md#spotangle)`get` `set` |
| float [**Intensity** ](/scripting/client-scripting-api-reference/components/slight.md#intensity)`get` `set` |
| SVector [**Color** ](/scripting/client-scripting-api-reference/components/slight.md#color)`get` `set` |
| SLightType [**Type** ](/scripting/client-scripting-api-reference/components/slight.md#type)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/slight.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enable/Disable this light.*
* Lua
```lua
Space.Host.ExecutingObject.Light.Enabled = false
```
* Lua
```lua
--the below script will make the object Enable/Disable it's Light component
--[Add "light" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
light = Space.Host.GetReference("light").Light
OnClick = function()
light.Enabled = not light.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Range[β](#range "Direct link to Range")
float **Range** `get` `set`
*Get/Set the effective range of the light source.*
* Lua
```lua
Space.Host.ExecutingObject.Light.Range = 8.0
```
* Lua
```lua
--the below script will make a slider set the Light's range
--[Add "slider" and "light" references to the Scripting Runtime component]
light = Space.Host.GetReference("light").Light
slider = Space.Host.GetReference("slider").UISlider
OVC = function()
light.Range = (slider.Value * 100) --(from 0 to 100)
end
slider.OnValueChanged(OVC)
```
##### SpotAngle[β](#spotangle "Direct link to SpotAngle")
float **SpotAngle** `get` `set`
*The angle of the light's spotlight cone in degrees.*
* Lua
```lua
Space.Host.ExecutingObject.Light.SpotAngle = 50
```
* Lua
```lua
--the below script will make a slider set the Light's Spot Angle
--[Add "slider" and "light" references to the Scripting Runtime component]
light = Space.Host.GetReference("light").Light
slider = Space.Host.GetReference("slider").UISlider
light.Type = 2 --it has to be Spot type
OVC = function()
light.SpotAngle = (slider.Value * 178) + 1 --(from 1 to 179)
end
slider.OnValueChanged(OVC)
```
##### Intensity[β](#intensity "Direct link to Intensity")
float **Intensity** `get` `set`
*Property Description*
* Lua
```lua
LightIntensity = Space.Host.ExecutingObject.Light.Intensity
```
* Lua
```lua
--the below script will make a slider set the Light's Intensity
--[Add "slider" and "light" references to the Scripting Runtime component]
light = Space.Host.GetReference("light").Light
slider = Space.Host.GetReference("slider").UISlider
OVC = function()
light.Intensity = (slider.Value * 8) --(from 0 to 8)
end
slider.OnValueChanged(OVC)
```
##### Color[β](#color "Direct link to Color")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Color** `get` `set`
Get/Set the color of the light.
* Lua
```lua
Space.Host.ExecutingObject.Light.Color = Color.Red
```
* Lua
```lua
--clicking the object will open a color picker that changes Light's color
----[Add "light" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
light = Space.Host.GetReference("light").Light
OnChange = function(SColor)
light.Color = SColor
end
OnSelect = function(SColor)
light.Color = SColor
end
OnCancel = function()
end
OnClick = function()
Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, Color.Red)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Type[β](#type "Direct link to Type")
int **Type** `get` `set`
Get/Set the type of light this source is. 0 = Directional, 1 = Point, 2 = Spot, 3 = Area.
* Lua
```lua
Space.Host.ExecutingObject.Light.Type = 0
```
* Lua
```lua
--Clicking the object toggles between the 4 different light types
--[Add "light" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
light = Space.Host.GetReference("light").Light
OnClick = function()
if light.Type == 3 then
light.Type = 0
else light.Type = light.Type + 1
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Light.GameObject
```
---
### SLineRenderer
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetPosition** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#setposition)(int index, SVector position) |
| SVector [**GetPosition** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#getposition)(int index) |
| void [**SetPositions** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#setpositions)(SVector\[] positions) |
| SVector\[] [**GetPositions** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#getpositions)() |
| void [**SetWidth** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#setwidth)(float start, float end) |
| void [**SetColors** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#setcolors)(SColor start, SColor end) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#enabled)`get` `set` |
| bool [**ReceiveShadows** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#receiveshadows)`get` `set` |
| bool [**IsVisible** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#isvisible)`get` |
| bool [**CastShadows** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#castshadows)`get` `set` |
| bool [**MotionVectors** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#motionvectors)`get` `set` |
| bool [**UseLightProbes** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#uselightprobes)`get` `set` |
| float [**StartWidth** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#startwidth)`get` `set` |
| float [**EndWidth** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#endwidth)`get` `set` |
| float [**WidthMultiplier** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#widthmultiplier)`get` `set` |
| SColor [**StartColor** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#startcolor)`get` `set` |
| SColor [**EndColor** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#endcolor)`get` `set` |
| int [**PositionCount** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#positioncount)`get` `set` |
| bool [**UseWorldSpace** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#useworldspace)`get` `set` |
| bool [**Loop** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#loop)`get` `set` |
| int [**NumCornerVertices** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#numcornervertices)`get` `set` |
| int [**NumCapVertices** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#numcapvertices)`get` `set` |
| int [**TextureMode** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#texturemode)`get` `set` |
| int [**Alignment** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#alignment)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/slinerenderer.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SetPosition[β](#setposition "Direct link to SetPosition")
void **SetPosition** (int index, [SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*Set the position of a vertex in the line.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.SetPosition(1,Vector.New(0,0,0))
```
* Lua
```lua
--this object will continuously render a line between two different game objects
refObject1 = Space.Host.GetReference("object1") --Add in References section of Scripting Runtime Component
refObject2 = Space.Host.GetReference("object2") --Add in References section of Scripting Runtime Component
thisObject = Space.Host.ExecutingObject
function OnUpdateFunction()
thisObject.LineRenderer.PositionCount = 2 --this is necessary
thisObject.LineRenderer.SetPosition(1,refObject1.WorldPosition)
thisObject.LineRenderer.SetPosition(2,refObject2.WorldPosition)
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### GetPosition[β](#getposition "Direct link to GetPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetPosition** (int index)
*Get the position of a vertex in the line*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
vectorPosition = Space.Host.ExecutingObject.LineRenderer.GetPosition(1)
```
##### SetPositions[β](#setpositions "Direct link to SetPositions")
void **SetPositions** ([SVector](/scripting/client-scripting-api-reference/types/svector.md)\[] positions)
*Set the positions of all vertices in the line.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.SetPositions({Vector.New(0,0,0) , Vector.New(1,1,1)})
```
* Lua
```lua
--this object will continuously render a line between two different game objects
refObject1 = Space.Host.GetReference("object1") --Add in References section of Scripting Runtime Component
refObject2 = Space.Host.GetReference("object2") --Add in References section of Scripting Runtime Component
thisObject = Space.Host.ExecutingObject
function OnUpdateFunction()
thisObject.LineRenderer.PositionCount = 2 --this is necessary
thisObject.LineRenderer.SetPositions({refObject1.WorldPosition,refObject2.WorldPosition})
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### GetPositions[β](#getpositions "Direct link to GetPositions")
[SVector](/scripting/client-scripting-api-reference/types/svector.md)\[] **GetPositions** ()
*Get the positions of all vertices in the line.*
* Lua
```lua
tableVectorPositions = Space.Host.ExecutingObject.LineRenderer.GetPositions()
```
##### SetWidth[β](#setwidth "Direct link to SetWidth")
void **SetWidth** (float start, float end)
*Set width at start and end*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.SetWidth(5,7)
```
* Lua
```lua
--the below script will make a slider set both the Line Renderer's Start Width and End Width
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
OVC = function()
local width = (refSlider.UISlider.Value * 5) -- from 0 to 5
refLineRenderer.LineRenderer.SetWidth(width,width)
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### SetColors[β](#setcolors "Direct link to SetColors")
void **SetColors** ([SColor](/scripting/client-scripting-api-reference/types/scolor.md) start, [SColor](/scripting/client-scripting-api-reference/types/scolor.md) end)
*Set color at start and end (Line shader necessary)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.SetColors(Color.Red, Color.Blue)
```
* Lua
```lua
--clicking the object will open a color picker that changes both Line Renderer's Start Color and End Color
thisGameObject = Space.Host.ExecutingObject
originalStartColor = thisGameObject.LineRenderer.StartColor
originalEndColor = thisGameObject.LineRenderer.EndColor
OnChange = function(SColor)
thisGameObject.LineRenderer.SetColors(SColor,SColor)
end
OnSelect = function(SColor)
thisGameObject.LineRenderer.SetColors(SColor,SColor)
end
OnCancel = function()
thisGameObject.LineRenderer.SetColors(originalStartColor,originalEndColor)
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalStartColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Makes the renderer visible if enabled.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.Enabled = false
```
* Lua
```lua
--clicking this object toggles it's LineRenderer component On/Off
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.LineRenderer.Enabled = not thisObject.LineRenderer.Enabled
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### ReceiveShadows[β](#receiveshadows "Direct link to ReceiveShadows")
bool **ReceiveShadows** `get` `set`
*Enable this option to make the line display any shadows that are cast upon it.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.ReceiveShadows = false
```
* Lua
```lua
--clicking this object toggles it's Recieve Shadows options
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.LineRenderer.ReceiveShadows = not thisObject.LineRenderer.ReceiveShadows
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### IsVisible[β](#isvisible "Direct link to IsVisible")
bool **IsVisible** `get`
*To check if this renderer is visible.*
* Lua
```lua
isVisible = Space.Host.ExecutingObject.LineRenderer.IsVisible
```
##### CastShadows[β](#castshadows "Direct link to CastShadows")
bool **CastShadows** `get` `set`
*Specify if and how the line casts shadows when a suitable Light shine on it.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.CastShadows = true
```
##### MotionVectors[β](#motionvectors "Direct link to MotionVectors")
bool **MotionVectors** `get` `set`
*Specifies whether this renderer has a per-object motion vector pass. If set to true, this object will have a per-object motion vector pass rendered*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.MotionVectors = true
```
* Lua
```lua
--clicking this object toggles it's Line Renderer's Motion Vectors (Per Object Motion or Force no motion)
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.LineRenderer.MotionVectors = not thisObject.LineRenderer.MotionVectors
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### UseLightProbes[β](#uselightprobes "Direct link to UseLightProbes")
bool **UseLightProbes** `get` `set`
*The light probe interpolation type.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.UseLightProbes = true
```
* Lua
```lua
--clicking this object toggles it's Light Probe between Off and Blend Mode
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.LineRenderer.UseLightProbes = not thisObject.LineRenderer.UseLightProbes
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### StartWidth[β](#startwidth "Direct link to StartWidth")
float **StartWidth** `get` `set`
*Set the width at the start of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.StartWidth = 1
```
* Lua
```lua
--the below script will make a slider change the Line Renderers start width
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
refSlider.UISlider.Value = refLineRenderer.LineRenderer.StartWidth / 2 --initial position of slider
OVC = function()
refLineRenderer.LineRenderer.StartWidth = (refSlider.UISlider.Value * 2) -- from 0 to 2
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### EndWidth[β](#endwidth "Direct link to EndWidth")
float **EndWidth** `get` `set`
*Set the width at the end of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.EndWidth = 2
```
* Lua
```lua
--the below script will make a slider change the Line Renderer's End Width
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
refSlider.UISlider.Value = refLineRenderer.LineRenderer.EndWidth / 2 --initial position of slider
OVC = function()
refLineRenderer.LineRenderer.EndWidth = (refSlider.UISlider.Value * 2) -- from 0 to 2
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### WidthMultiplier[β](#widthmultiplier "Direct link to WidthMultiplier")
float **WidthMultiplier** `get` `set`
*Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the final width of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.WidthMultiplier = 1.2
```
* Lua
```lua
--the below script will make a slider change the Line Renderer's Width Multiplier
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
refSlider.UISlider.Value = refLineRenderer.LineRenderer.WidthMultiplier / 5 --initial position of slider
OVC = function()
refLineRenderer.LineRenderer.WidthMultiplier = (refSlider.UISlider.Value * 5) -- from 0 to 5
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### StartColor[β](#startcolor "Direct link to StartColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **StartColor** `get` `set`
*Set the color at the start of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.StartColor = Color.Red
```
* Lua
```lua
--clicking the object will open a color picker that changes the Line Renderer's Start Color
thisGameObject = Space.Host.ExecutingObject
originalColor = thisGameObject.LineRenderer.StartColor
OnChange = function(SColor)
thisGameObject.LineRenderer.StartColor = SColor
end
OnSelect = function(SColor)
thisGameObject.LineRenderer.StartColor = SColor
end
OnCancel = function()
thisGameObject.LineRenderer.StartColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### EndColor[β](#endcolor "Direct link to EndColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **EndColor** `get` `set`
*Set the color at the end of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.EndColor = Color.Blue
```
* Lua
```lua
--clicking the object will open a color picker that changes the Line Renderer's End Color
thisGameObject = Space.Host.ExecutingObject
originalColor = thisGameObject.LineRenderer.EndColor
OnChange = function(SColor)
thisGameObject.LineRenderer.EndColor = SColor
end
OnSelect = function(SColor)
thisGameObject.LineRenderer.EndColor = SColor
end
OnCancel = function()
thisGameObject.LineRenderer.EndColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### PositionCount[β](#positioncount "Direct link to PositionCount")
int **PositionCount** `get` `set`
*Set/get the number of vertices.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.PositionCount = 10
```
* Lua
```lua
--the below script will make a slider change the Line Renderer's Position Count
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
refSlider.UISlider.Value = refLineRenderer.LineRenderer.PositionCount / 20 --initial position of slider
OVC = function()
refLineRenderer.LineRenderer.PositionCount = refSlider.UISlider.Value * 20 -- from 0 to 20
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### UseWorldSpace[β](#useworldspace "Direct link to UseWorldSpace")
bool **UseWorldSpace** `get` `set`
*If enabled, the points are considered as world space coordinates. If disabled, they are local to the transform of the GameObject to which this component is attached.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.UseWorldSpace = true
```
* Lua
```lua
--clicking this object toggles it's Use World Space option
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.LineRenderer.UseWorldSpace = not thisObject.LineRenderer.UseWorldSpace
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Loop[β](#loop "Direct link to Loop")
bool **Loop** `get` `set`
*Enable this to connect the first and last positions of the line, and form a closed loop.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.Loop = true
```
* Lua
```lua
--clicking this object toggles it's Loop option
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
thisObject.LineRenderer.Loop = not thisObject.LineRenderer.Loop
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### NumCornerVertices[β](#numcornervertices "Direct link to NumCornerVertices")
int **NumCornerVertices** `get` `set`
*Set this to a value greater than 0, to get rounded corners between each segment of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.NumCornerVertices = 2
```
* Lua
```lua
--the below script will make a slider change the Line Renderer's Corner Vertices
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
refSlider.UISlider.Value = refLineRenderer.LineRenderer.NumCornerVertices / 10 --initial position of slider
OVC = function()
refLineRenderer.LineRenderer.NumCornerVertices = refSlider.UISlider.Value * 10 -- from 0 to 10
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### NumCapVertices[β](#numcapvertices "Direct link to NumCapVertices")
int **NumCapVertices** `get` `set`
*Set this to a value greater than 0, to get rounded corners on each end of the line.*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.NumCapVertices = 2
```
* Lua
```lua
--the below script will make a slider change the Line Renderer's End Cap Vertices
thisGameObject = Space.Host.ExecutingObject
refSlider = Space.Host.GetReference("Slider") --Add Reference to Scripting Runtime Component
refLineRenderer = Space.Host.GetReference("LineRenderer") --Add Reference to Scripting Runtime Component
refSlider.UISlider.Value = refLineRenderer.LineRenderer.NumCapVertices / 20 --initial position of slider
OVC = function()
refLineRenderer.LineRenderer.NumCapVertices = refSlider.UISlider.Value * 20 -- from 0 to 10
end
refSlider.UISlider.OnValueChanged(OVC)
```
##### TextureMode[β](#texturemode "Direct link to TextureMode")
int **TextureMode** `get` `set`
*Control how the Texture is applied to the line. (0-3)*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.TextureMode = 2
```
* Lua
```lua
--clicking this object toggles between it's 4 Texture Modes
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.LineRenderer.TextureMode == 3 then
thisObject.LineRenderer.TextureMode = 0
else
thisObject.LineRenderer.TextureMode = thisObject.LineRenderer.TextureMode + 1
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Alignment[β](#alignment "Direct link to Alignment")
int **Alignment** `get` `set`
*Set the direction that the line faces. (0 or 1)*
* Lua
```lua
Space.Host.ExecutingObject.LineRenderer.Alignment = 1
```
* Lua
```lua
--clicking this object toggles it's Alignment option between View (0) and Transform Z (1)
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.LineRenderer.Alignment == 0 then
thisObject.LineRenderer.Alignment = 1
else thisObject.LineRenderer.Alignment = 0
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.LineRenderer.GameObject
```
---
### SMeshRenderer
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**IsVisible** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#isvisible)`get` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#enabled)`get` `set` |
| SMaterial [**Material** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#material)`get` `set` |
| SMaterial [**SharedMaterial** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#sharedmaterial)`get` `set` |
| SMaterial\[] [**Materials** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#materials)`get` `set` |
| SMaterial\[] [**SharedMaterials** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#sharedmaterials)`get` `set` |
| SVector [**BoundsMax** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#boundsmax)`get` |
| SVector [**BoundsMin** ](/scripting/client-scripting-api-reference/components/smeshrenderer.md#boundsmin)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### IsVisible[β](#isvisible "Direct link to IsVisible")
bool **IsVisible** `get`
*Returns true if the renderer is visible on any camera. Note that the object is considered visible when it needs to be rendered in the Scene. For example, it might not actually be visible by any camera but still need to be rendered for shadows. When running in the editor, the Scene view cameras will also cause this value to be true.*
* Lua
```lua
isVisible = Space.Host.ExecutingObject.MeshRenderer.IsVisible
```
* Lua
```lua
--this object will move forward only if visible on a camera
thisObject = Space.Host.ExecutingObject
function OnUpdateFunction()
if thisObject.MeshRenderer.IsVisible then
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * Space.DeltaTime * 0.2)
end
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Makes the rendered 3D object visible if enabled.*
* Lua
```lua
Space.Host.ExecutingObject.MeshRenderer.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Mesh Renderer component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.MeshRenderer
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Material[β](#material "Direct link to Material")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **Material** `get` `set`
*Returns the first instantiated Material assigned to the renderer.*
*Modifying material will change the material for this object only.*
*If the material is used by any other renderers, this will clone the shared material and start using it from now on.*
* Lua
```lua
Space.Host.ExecutingObject.MeshRenderer.Material.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
```
* Lua
```lua
--clicking this object will toggle it's material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.MeshRenderer.Material.GetColor("_Color") == Color.Black then
thisObject.MeshRenderer.Material.SetColor("_Color", Color.Red)
else
thisObject.MeshRenderer.Material.SetColor("_Color", Color.Black)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### SharedMaterial[β](#sharedmaterial "Direct link to SharedMaterial")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **SharedMaterial** `get` `set`
*The shared material of this object.*
*Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.*
*It is not recommended to modify materials returned by sharedMaterial. If you want to modify the material of a renderer use material instead.*
* Lua
```lua
Space.Host.ExecutingObject.MeshRenderer.SharedMaterial.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
```
* Lua
```lua
--clicking this object will toggle it's shared material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.MeshRenderer.SharedMaterial.GetColor("_Color") == Color.Black then
thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Red)
else
thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Black)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Materials[β](#materials "Direct link to Materials")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md)\[] **Materials** `get` `set`
*Returns all the instantiated materials of this object.*
*This is an array of all materials used by the renderer. Unity supports a single object using multiple materials; in this case materials contains all the materials. sharedMaterial and material properties return the first used material if there is more than one.*
*Modifying any material in materials will change the appearance of only that object.*
*Note that like all arrays returned by Unity, this returns a copy of materials array. If you want to change some materials in it, get the value, change an entry and set materials back.*
* Lua
```lua
mats = Space.Host.ExecutingObject.MeshRenderer.Materials
```
##### SharedMaterials[β](#sharedmaterials "Direct link to SharedMaterials")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md)\[] **SharedMaterials** `get` `set`
*The shared material of this object.*
*Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.*
*It is not recommended to modify materials returned by sharedMaterial. If you want to modify the material of a renderer use material instead.*
* Lua
```lua
Space.Host.ExecutingObject.MeshRenderer.SharedMaterial.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
```
* Lua
```lua
--clicking this object will toggle it's shared material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.MeshRenderer.SharedMaterial.GetColor("_Color") == Color.Black then
thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Red)
else
thisObject.MeshRenderer.SharedMaterial.SetColor("_Color", Color.Black)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### BoundsMax[β](#boundsmax "Direct link to BoundsMax")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **BoundsMax** `get`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.MeshRenderer.BoundsMax = Vector.New(1,1,1)
```
##### BoundsMin[β](#boundsmin "Direct link to BoundsMin")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **BoundsMin** `get`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.MeshRenderer.BoundsMin = Vector.New(0,0,0)
```
---
### SModularVehicle
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**ForceSetOwner** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#forcesetowner)(int newOwner, int vehicleId) |
| void [**ForceActivate** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#forceactivate)() |
| void [**ForceDeactivate** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#forcedeactivate)() |
| void [**SuppressTimeout** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#suppresstimeout)() |
| void [**OverrideOnClick** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#overrideonclick)(Closure onClick) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------------- |
| float [**VerticalInput** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#verticalinput)`get` `set` |
| float [**HorizontalInput** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#horizontalinput)`get` `set` |
| float [**StrafeInput** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#strafeinput)`get` `set` |
| float [**DepthInput** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#depthinput)`get` `set` |
| bool [**IgnoreUserInput** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#ignoreuserinput)`get` `set` |
| SAvatar [**Driver** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#driver)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/smodularvehicle.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### ForceSetOwner[β](#forcesetowner "Direct link to ForceSetOwner")
void **ForceSetOwner** (int newOwner, int vehicleId)
*Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner canβt drive on this vehicle.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)
```
##### ForceActivate[β](#forceactivate "Direct link to ForceActivate")
void **ForceActivate** ()
*Force player drive on this vehicle*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.ForceActivate()
```
##### ForceDeactivate[β](#forcedeactivate "Direct link to ForceDeactivate")
void **ForceDeactivate** ()
*Force player out of the vehicle*.
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()
```
##### SuppressTimeout[β](#suppresstimeout "Direct link to SuppressTimeout")
void **SuppressTimeout** ()
*Disable the vehicle automatic respawn*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()
```
##### OverrideOnClick[β](#overrideonclick "Direct link to OverrideOnClick")
void **OverrideOnClick** (Closure onClick)
*Add onClick method to this vehicle,onClick have to be a closure.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### VerticalInput[β](#verticalinput "Direct link to VerticalInput")
float **VerticalInput** `get` `set`
*Force vertical offset value, it would be added to vertical control and never set to zero.*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5
```
##### HorizontalInput[β](#horizontalinput "Direct link to HorizontalInput")
float **HorizontalInput** `get` `set`
*Force horizontal offset value, it would be added to horizontal control and never set to zero.*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5
```
##### StrafeInput[β](#strafeinput "Direct link to StrafeInput")
float **StrafeInput** `get` `set`
*Force strafe offset value,it would be added to strafe control and never set to zero.*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5
```
##### DepthInput[β](#depthinput "Direct link to DepthInput")
float **DepthInput** `get` `set`
*Force depth offset value, it would be added to depth control and never set to zero.*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5
```
##### IgnoreUserInput[β](#ignoreuserinput "Direct link to IgnoreUserInput")
bool **IgnoreUserInput** `get` `set`
*If this option is enabled, user input would be ignored until disable this.*
* Lua
```lua
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true
```
##### Driver[β](#driver "Direct link to Driver")
[SAvatar](/scripting/client-scripting-api-reference/types/savatar.md) **Driver** `get`
*Get the player avatar component.*
* Lua
```lua
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns the GameObject of this Vehicle component.*
* Lua
```lua
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject
```
---
### SNavMeshAgent
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------- |
| float [**GetAreaCost** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#getareacost)(int areaIndex) |
| void [**Move** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#move)(SVector movement) |
| void [**Resume** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#resume)() |
| void [**SetAreaCost** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#setareacost)(int areaIndex, float cost) |
| void [**Stop** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#stop)() |
| void [**SetDestination** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#setdestination)(SVector position) |
| void [**Warp** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#wrap)(SVector position) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#enabled)`get` `set` |
| float [**Accelleration** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#accelleration)`get` `set` |
| float [**AngularSpeed** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#angularspeed)`get` `set` |
| int [**AreaMask** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#areamask)`get` `set` |
| bool [**AutoRepath** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#autorepath)`get` `set` |
| bool [**AutoBraking** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#autobraking)`get` `set` |
| bool [**AutoTraverseOffMeshLink** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#autotraverseoffmeshlink)`get` `set` |
| int [**AvoidancePriority** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#avoidancepriority)`get` `set` |
| float [**BaseOffset** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#baseoffset)`get` `set` |
| SVector [**DesiredVelocity** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#desiredvelocity)`get` |
| SVector [**Destination** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#destination)`get` `set` |
| bool [**HasPath** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#haspath)`get` |
| float [**Height** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#height)`get` `set` |
| bool [**IsOnNavMesh** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#isonnavmesh)`get` |
| bool [**IsOnOffMeshLink** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#isonoffmeshlink)`get` |
| bool [**IsPathStale** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#ispathstale)`get` |
| SVector [**NextPosition** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#nextposition)`get` `set` |
| SVector [**PathEndPosition** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#pathendposition)`get` |
| bool [**PathPending** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#pathpending)`get` |
| float [**Radius** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#radius)`get` `set` |
| float [**RemainingDistance** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#remainingdistance)`get` |
| float [**Speed** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#speed)`get` `set` |
| SVector [**SteeringTarget** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#steeringtarget)`get` |
| float [**StoppingDistance** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#stoppingdistance)`get` `set` |
| bool [**UpdatePosition** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#updateposition)`get` `set` |
| bool [**UpdateRotation** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#updaterotation)`get` `set` |
| SVector [**Velocity** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#velocity)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/snavmeshagent.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetAreaCost[β](#getareacost "Direct link to GetAreaCost")
float **GetAreaCost** (int areaIndex)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
floatCost = Space.Host.ExecutingObject.NavMeshAgent.GetAreaCost(1)
```
##### Move[β](#move "Direct link to Move")
void **Move** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) movement)
*Apply relative movement to current position.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Move(Vector.New(2,0,0))
```
##### Resume[β](#resume "Direct link to Resume")
void **Resume** ()
*Resume the NavMesh agent.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Resume()
```
* Lua
```lua
agentobject = Space.Scene.Find("Cube")
agent = agentobject.NavMeshAgent
if agent == nil then
agent = Space.Scene.Find("Cube").AddNavMeshAgent()
end
counts = 0
--stop first, then resume.
function StopAndResume()
counts = counts +1
if counts > 10 then
agent.Stop()
end
if counts > 50 then
agent.Resume()
end
end
agentobject.SubscribeToEvents()
agentobject.OnUpdate(StopAndResume)
agent.Destination = Space.Scene.Find("TargetTransform").WorldPosition
--set destination.
```
##### SetAreaCost[β](#setareacost "Direct link to SetAreaCost")
void **SetAreaCost** (int areaIndex, float cost)
*Sets the cost for traversing over areas of the area type.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.SetAreaCost(1, 10.0)
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*To stop the NavMesh agent.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Stop()
```
##### SetDestination[β](#setdestination "Direct link to SetDestination")
void **SetDestination** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*Set or update the destination.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.SetDestination(Vector.New(10,0,0))
```
##### Warp[β](#warp "Direct link to Warp")
void **Warp** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*Warp to the position you want, also you can set agent's world position and vector to make this act as Move(SVector position).*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Warp(Vector.New(10,0,0))
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enable or disable this component.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Nav Mesh Agent component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.NavMeshAgent
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Accelleration[β](#accelleration "Direct link to Accelleration")
float **Accelleration** `get` `set`
*The maximum acceleration of an agent as it follows a path.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Accelleration = 60
```
##### AngularSpeed[β](#angularspeed "Direct link to AngularSpeed")
float **AngularSpeed** `get` `set`
*Maximum turning speed in while following a path.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.AngularSpeed = 60
```
##### AreaMask[β](#areamask "Direct link to AreaMask")
int **AreaMask** `get` `set`
*Specifies which NavMesh area is passable.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.AreaMask = 3
```
##### AutoRepath[β](#autorepath "Direct link to AutoRepath")
bool **AutoRepath** `get` `set`
*Set the agent attempt to acquire a new path if the existing path becomes invalid.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.AutoRepath = false
```
##### AutoBraking[β](#autobraking "Direct link to AutoBraking")
bool **AutoBraking** `get` `set`
*Set the agent brake automatically to avoid overshooting the destination point.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.AutoBraking = false
```
##### AutoTraverseOffMeshLink[β](#autotraverseoffmeshlink "Direct link to AutoTraverseOffMeshLink")
bool **AutoTraverseOffMeshLink** `get` `set`
*Set the agent move across OffMeshLinks automatically.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.AutoTraverseOffMeshLink = false
```
##### AvoidancePriority[β](#avoidancepriority "Direct link to AvoidancePriority")
int **AvoidancePriority** `get` `set`
*The avoidance priority level.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.AvoidancePriority = 10
```
##### BaseOffset[β](#baseoffset "Direct link to BaseOffset")
float **BaseOffset** `get` `set`
*The relative vertical displacement of the GameObject.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.BaseOffset = 3
```
##### DesiredVelocity[β](#desiredvelocity "Direct link to DesiredVelocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **DesiredVelocity** `get`
*The desired velocity of the agent including any potential contribution from avoidance.*
* Lua
```lua
vectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.DesiredVelocity
```
##### Destination[β](#destination "Direct link to Destination")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Destination** `get` `set`
*The desired velocity of the agent including any potential contribution from avoidance.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Destination = Vector.New(10,0,0)
```
##### HasPath[β](#haspath "Direct link to HasPath")
bool **HasPath** `get`
*Does the agent currently have a path?*
* Lua
```lua
hasPath = Space.Host.ExecutingObject.NavMeshAgent.HasPath
```
##### Height[β](#height "Direct link to Height")
float **Height** `get` `set`
*The height of the agent for purposes of passing under obstacles, etc.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Height = 5
```
##### IsOnNavMesh[β](#isonnavmesh "Direct link to IsOnNavMesh")
bool **IsOnNavMesh** `get`
*Is the agent currently bound to the navmesh?*
* Lua
```lua
isOn = Space.Host.ExecutingObject.NavMeshAgent.IsOnNavMesh
```
##### IsOnOffMeshLink[β](#isonoffmeshlink "Direct link to IsOnOffMeshLink")
bool **IsOnOffMeshLink** `get`
*Is the agent currently positioned on an OffMeshLink?*
* Lua
```lua
isOnOff = Space.Host.ExecutingObject.NavMeshAgent.IsOnOffMeshLink
```
##### IsPathStale[β](#ispathstale "Direct link to IsPathStale")
bool **IsPathStale** `get`
*Is the current path stale?*
* Lua
```lua
isStale = Space.Host.ExecutingObject.NavMeshAgent.IsPathStale
```
##### NextPosition[β](#nextposition "Direct link to NextPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **NextPosition** `get` `set`
*Get or set the simulation position of the navmesh agent.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.NextPosition = Vector.New(10, 0, 0)
```
##### PathEndPosition[β](#pathendposition "Direct link to PathEndPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **PathEndPosition** `get`
*End positon of navigation.*
* Lua
```lua
vectorPathEndPos = Space.Host.ExecutingObject.NavMeshAgent.PathEndPosition
```
##### PathPending[β](#pathpending "Direct link to PathPending")
bool **PathPending** `get`
*Is a path in the process of being computed but not yet ready?*
* Lua
```lua
isPending = Space.Host.ExecutingObject.NavMeshAgent.PathPending
```
##### Radius[β](#radius "Direct link to Radius")
float **Radius** `get` `set`
*The avoidance radius for the agent.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Radius = 5
```
##### RemainingDistance[β](#remainingdistance "Direct link to RemainingDistance")
float **RemainingDistance** `get`
*The distance between the agent's position and the destination on the current path.*
* Lua
```lua
vectorDist = Space.Host.ExecutingObject.NavMeshAgent.RemainingDistance
```
##### Speed[β](#speed "Direct link to Speed")
float **Speed** `get` `set`
*Maximum movement speed when following a path.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.Speed = 20
```
##### SteeringTarget[β](#steeringtarget "Direct link to SteeringTarget")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **SteeringTarget** `get`
*Get the current steering target along the path.*
* Lua
```lua
vectorSteeringTarget = Space.Host.ExecutingObject.NavMeshAgent.SteeringTarget
```
##### StoppingDistance[β](#stoppingdistance "Direct link to StoppingDistance")
float **StoppingDistance** `get` `set`
*Stop within this distance from the target position.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.StoppingDistance = 2
```
##### UpdatePosition[β](#updateposition "Direct link to UpdatePosition")
bool **UpdatePosition** `get` `set`
*Get or set whether the transform position is synchronized with the simulated agent position.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.UpdatePosition = true
```
##### UpdateRotation[β](#updaterotation "Direct link to UpdateRotation")
bool **UpdateRotation** `get` `set`
*Should the agent update the transform orientation?*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshAgent.UpdateRotation = true
```
##### Velocity[β](#velocity "Direct link to Velocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Velocity** `get`
*access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually.*
* Lua
```lua
vectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.Velocity
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.NavMeshAgent.GameObject
```
---
### SNavMeshObstacle
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**CarveOnlyStationary** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#carveonlystationary)`get` `set` |
| bool [**Carving** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#carving)`get` `set` |
| SVector [**Center** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#center)`get` `set` |
| float [**Height** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#height)`get` `set` |
| SVector [**Size** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#size)`get` `set` |
| float [**Radius** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#radius)`get` `set` |
| int [**Shape** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#shape)`get` `set` |
| float [**MoveThreshold** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#movethreshold)`get` `set` |
| float [**TimeToStationary** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#timetostationary)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### CarveOnlyStationary[β](#carveonlystationary "Direct link to CarveOnlyStationary")
bool **CarveOnlyStationary** `get` `set`
*When enabled, the obstacle is carved only when it is stationary. (Only can enabled after carve was ticked).*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.CarveOnlyStationary = true
```
##### Carving[β](#carving "Direct link to Carving")
bool **Carving** `get` `set`
*When the Carve checkbox gets ticked, the Nav Mesh Obstacle creates a hole in the NavMesh.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.Carving = true
```
##### Center[β](#center "Direct link to Center")
SVector **Center** `get` `set`
*Center of the obstacle geometry relative to the transform position.*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.Center = Vector.New(0,0,0)
```
##### Height[β](#height "Direct link to Height")
float **Height** `get` `set`
*Height of the capsule. (Property of Capsule shape).*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.Height = 40
```
##### Size[β](#size "Direct link to Size")
SVector **Size** `get` `set`
*Size of the box. (Property of Box shape).*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.Size = Vector.New(5,10,15)
```
##### Radius[β](#radius "Direct link to Radius")
float **Radius** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.Radius = 10
```
##### Shape[β](#shape "Direct link to Shape")
int **Shape** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.Shape = 1
```
##### MoveThreshold[β](#movethreshold "Direct link to MoveThreshold")
float **MoveThreshold** `get` `set`
*Use this property to set the threshold distance for updating a moving carved hole. (Only can take effect after carve was ticked)*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.MoveThreshold = 5
```
##### TimeToStationary[β](#timetostationary "Direct link to TimeToStationary")
float **TimeToStationary** `get` `set`
*The time to wait until the obstacle is treated as stationary. (Only can take effect after carve was ticked).*
* Lua
```lua
Space.Host.ExecutingObject.NavMeshObstacle.TimeToStationary = 5.0
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.NavMeshObstacle.GameObject
```
---
### SNetworking
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------- |
| void [**SendEvent** ](/scripting/client-scripting-api-reference/components/snetworking.md#sendevent)(string eventName) |
| void [**ReceiveEvent** ](/scripting/client-scripting-api-reference/components/snetworking.md#receiveevent)(string eventName) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/snetworking.md#enabled)`get` `set` |
| bool [**Instanced** ](/scripting/client-scripting-api-reference/components/snetworking.md#instanced)`get` |
| string [**NetworkName** ](/scripting/client-scripting-api-reference/components/snetworking.md#networkname)`get` `set` |
| bool [**Ready** ](/scripting/client-scripting-api-reference/components/snetworking.md#ready)`get` |
| int [**EventCount** ](/scripting/client-scripting-api-reference/components/snetworking.md#eventcount)`get` |
| string\[] [**EventNames** ](/scripting/client-scripting-api-reference/components/snetworking.md#eventnames)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/snetworking.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SendEvent[β](#sendevent "Direct link to SendEvent")
void **SendEvent** (string eventName)
*Send a networking event event that will be received by other components in the scene with the same network name.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Networking.SendEvent("Light On")
```
##### ReceiveEvent[β](#receiveevent "Direct link to ReceiveEvent")
void **ReceiveEvent** (string eventName)
*Invoke an event on the networking component. Normally not necessary to do manually, as this happens automatically when receiving a matching event over the network, but may be useful to initialize a state.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Networking.ReceiveEvent("Light On")
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the simple networking component is Enabled or not*
* Lua
```lua
Space.Host.ExecutingObject.Networking.Enabled = true
```
##### Instanced[β](#instanced "Direct link to Instanced")
bool **Instanced** `get`
*Returns whether this networking component is instanced or not.*
* Lua
```lua
isInstanced = Space.Host.ExecutingObject.Networking.Instanced
```
##### NetworkName[β](#networkname "Direct link to NetworkName")
string **NetworkName** `get` `set`
*Returns or sets the name of the network. Network name must be at least 20 characters long without trailing or leading spaces.*
* Lua
```lua
Space.Host.ExecutingObject.Networking.NetworkName = "Example Network Name 1"
```
##### Ready[β](#ready "Direct link to Ready")
bool **Ready** `get`
*Return whether the networking component is ready to send or not (is initialized).*
* Lua
```lua
isReady = Space.Host.ExecutingObject.Networking.Ready
```
##### EventCount[β](#eventcount "Direct link to EventCount")
int **EventCount** `get`
*Return the number of events this component is waiting to receive.*
* Lua
```lua
count = Space.Host.ExecutingObject.Networking.EventCount
```
##### EventNames[β](#eventnames "Direct link to EventNames")
string\[] **EventNames** `get`
*Return a list of names of events that this component will receive.*
* Lua
```lua
tableOfNames = Space.Host.ExecutingObject.Networking.EventNames
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Networking.GameObject
```
---
### SParticleSystem
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Play** ](sparticlesystem#play)(bool withChildren) void [**Play** ](sparticlesystem#play)() |
| void [**Stop** ](sparticlesystem#stop)(bool withChildren) void [**Stop** ](sparticlesystem#stop)() |
| void [**Pause** ](sparticlesystem#pause)(bool withChildren) void [**Pause** ](sparticlesystem#pause)() |
| void [**Clear** ](sparticlesystem#clear)(bool withChildren) void [**Clear** ](sparticlesystem#clear)() |
| bool [**IsAlive** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#isalive)(bool withChildren) |
| void [**Emit** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#emit)(int count) |
| void [**Simulate** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#simulate)(float time) |
| void [**SetTriggerParticles** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#settriggerparticles)(SParticleSystemTriggerEventType type, SParticle\[] sp) |
| SParticle\[] [**GetTriggerParticles** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#gettriggerparticles)(SParticleSystemTriggerEventType type) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| float [**StartDelay** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startdelay)`get` `set` | Start delay in seconds. Use this to delay when playback starts on the system. |
| bool [**IsPlaying** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#isplaying)`get` | Determines whether the Particle System is playing. |
| bool [**IsEmitting** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#isemitting)`get` | Determines whether the Particle System is emitting particles. A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped. |
| bool [**IsStopped** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#isstopped)`get` | Determines whether the Particle System is stopped. |
| bool [**IsPaused** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#ispaused)`get` | Determines whether the Particle System is paused. |
| bool [**Loop** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#loop)`get` `set` | Specifies whether the Particle System is looping. If you disable looping on a playing Particle System, it stops at the end of the current loop. |
| bool [**PlayOnAwake** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#playonawake)`get` `set` | If set to true, the Particle System will automatically start playing on startup. Note that this setting is shared between all Particle Systems in the current particle effect. |
| float [**Time** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#time)`get` `set` | Playback position in seconds. Use this to read current playback time or to seek to a new playback time. |
| float [**Duration** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#duration)`get` | The duration of the Particle System in seconds. |
| float [**PlaybackSpeed** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#playbackspeed)`get` `set` | The playback speed of the Particle System. 1 is normal playback speed. |
| int [**ParticleCount** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#particlecount)`get` | The current number of particles. |
| bool [**EnableEmission** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#enableemission)`get` `set` | When set to false, the Particle System will not emit particles. |
| float [**EmissionRate** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#emissionrate)`get` `set` | The rate of particle emission. |
| float [**EmissionRateOverTime** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#emissionrateovertime)`get` `set` | The rate at which the emitter spawns new particles over time. |
| float [**EmissionRateOverDistance** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#emissionrateoverdistance)`get` `set` | The rate at which the emitter spawns new particles over distance. The emitter only spawns new particles when it moves. |
| float [**StartSpeed** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startspeed)`get` `set` | The initial speed of particles when the Particle System first spawns them. |
| float [**StartSize** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startsize)`get` `set` | The initial size of particles when the Particle System first spawns them. |
| SColor [**StartColor** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startcolor)`get` `set` | The initial color of particles when the Particle System first spawns them. |
| float [**StartRotation** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startrotation)`get` `set` | The initial rotation of particles when emitted. When using curves, this value acts as a scale on the curve. Note that the value should be given in radians. |
| SVector [**StartRotation3D** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startrotation3d)`get` `set` | The initial 3D rotation of particles when emitted. When using curves, this value acts as a scale on the curves. Note that the values are Euler angles and should be given in radians. |
| float [**StartLifetime** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#startlifetime)`get` `set` | The total lifetime in seconds that particles will have when emitted. When using curves, this value acts as a scale on the curve. This value is set in the particle when it is created by the Particle System. |
| float [**GravityModifier** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#gravitymodifier)`get` `set` | A scale that this Particle System applies to gravity. |
| int [**MaxParticles** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#maxparticles)`get` `set` | The maximum number of particles to emit. |
| uint [**RandomSeed** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#randomseed)`get` `set` | Override the random seed used for the Particle System emission. |
| bool [**UseAutoRandomSeed** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#useautorandomseed)`get` `set` | Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. If set to true, the Particle System will generate a new random seed each time it is played. If set to false, ParticleSystem.randomSeed will be used instead, allowing for a constant seed (useful if you want your particles to play in exactly the same way each time) or user-defined random value (for example, you may want to cycle through an array of seeds). |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sparticlesystem.md#gameobject)`get` | |
#### Functions[β](#functions "Direct link to Functions")
##### Play[β](#play "Direct link to Play")
void **Play** (bool withChildren) void **Play** ()
*Sets the Particle Systems into play mode and enables emitting (if it has been disabled).*
*If the Particle System has been paused, then this resumes playing from the previous time. If the Particle System has stopped, then the system starts from time 0, and, if it is relevant, the startDelay is applied. Parameter withChildren: Plays all child Particle Systems as well.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Play()
--or
Space.Host.ExecutingObject.ParticleSystem.Play(true)
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** (bool withChildren) void **Stop** ()
*Stops playing the Particle System. Parameter withChildren: Plays all child Particle Systems as well.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Stop()
--or
Space.Host.ExecutingObject.ParticleSystem.Stop(true)
```
##### Pause[β](#pause "Direct link to Pause")
void **Pause** (bool withChildren) void **Pause** ()
*Pauses the system so no new particles are emitted and the existing particles are not updated. Parameter: withChildren: Pauses all child Particle Systems as well.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Pause()
--or
Space.Host.ExecutingObject.ParticleSystem.Pause(true)
```
##### Clear[β](#clear "Direct link to Clear")
void **Clear** (bool withChildren) void **Clear** ()
*Remove all particles in the Particle System.*
*This method also removes the particles from any linked sub-emitters. Use the withChildren parameter to remove particles from child Particle Systems that are not sub-emitters of the system.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Clear()
--or
Space.Host.ExecutingObject.ParticleSystem.Clear(true)
```
##### IsAlive[β](#isalive "Direct link to IsAlive")
bool **IsAlive** (bool withChildren)
*Returns True if the Particle System contains live particles or is still creating new particles. False if the Particle System has stopped emitting particles and all particles are dead. Parameter withChildren: checks all child Particle Systems as well.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isAlive = Space.Host.ExecutingObject.ParticleSystem.IsAlive()
--or
isAlive = Space.Host.ExecutingObject.ParticleSystem.IsAlive(true)
```
##### Emit[β](#emit "Direct link to Emit")
void **Emit** (int count)
*Emit 'count' particles immediately.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Emit(100)
```
##### Simulate[β](#simulate "Direct link to Simulate")
void **Simulate** (float time)
*Fast-forwards the Particle System by simulating particles over 'time' seconds, then pauses it.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Simulate(5.0)
```
##### SetTriggerParticles[β](#settriggerparticles "Direct link to SetTriggerParticles")
void **SetTriggerParticles** (int type, [SParticle](/scripting/client-scripting-api-reference/types/sparticle.md)\[] sp)
*Write modified particles back to the Particle System, during a call to OnParticleTrigger. type - Type of trigger to return particles for. sp -- Particle array*
| Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| type | int | *Type of trigger to return particles for.* *1 = Inside* *2 = Outside* *3 = Enter* *4 = Exit* |
| sp | [SParticle](/scripting/client-scripting-api-reference/types/sparticle.md)\[] | A table of SParticle |
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.SetTriggerParticles(0,ParticlesArray)
```
##### GetTriggerParticles[β](#gettriggerparticles "Direct link to GetTriggerParticles")
[SParticle](/scripting/client-scripting-api-reference/types/sparticle.md)\[] **GetTriggerParticles** (int type)
*Get the particles that met the condition in the particle trigger module. his method is typically called from MonoBehaviour.OnParticleTrigger in response to a trigger callback.*
| Parameter | Type | Description |
| --------- | ---- | ---------------------------------------------------------------------------------------------------------------- |
| type | int | *Type of trigger to return particles for.* *1 = Inside* *2 = Outside* *3 = Enter* *4 = Exit* |
* Lua
```lua
ParticlesArray = Space.Host.ExecutingObject.ParticleSystem.GetTriggerParticles(0)
```
#### Properties[β](#properties "Direct link to Properties")
##### StartDelay[β](#startdelay "Direct link to StartDelay")
float **StartDelay** `get` `set`
*Start delay in seconds. Use this to delay when playback starts on the system.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartDelay = 5
```
##### IsPlaying[β](#isplaying "Direct link to IsPlaying")
bool **IsPlaying** `get`
*Determines whether the Particle System is playing.*
* Lua
```lua
isPlaying = Space.Host.ExecutingObject.ParticleSystem.IsPlaying
```
##### IsEmitting[β](#isemitting "Direct link to IsEmitting")
bool **IsEmitting** `get`
*Determines whether the Particle System is emitting particles. A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped.*
* Lua
```lua
isEmitting = Space.Host.ExecutingObject.ParticleSystem.IsEmitting
```
##### IsStopped[β](#isstopped "Direct link to IsStopped")
bool **IsStopped** `get`
*Determines whether the Particle System is stopped.*
* Lua
```lua
isStopped = Space.Host.ExecutingObject.ParticleSystem.IsStopped
```
##### IsPaused[β](#ispaused "Direct link to IsPaused")
bool **IsPaused** `get`
*Determines whether the Particle System is paused.*
* Lua
```lua
isPaused = Space.Host.ExecutingObject.ParticleSystem.IsPaused
```
##### Loop[β](#loop "Direct link to Loop")
bool **Loop** `get` `set`
*Specifies whether the Particle System is looping. If you disable looping on a playing Particle System, it stops at the end of the current loop.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Loop = true
```
##### PlayOnAwake[β](#playonawake "Direct link to PlayOnAwake")
bool **PlayOnAwake** `get` `set`
*If set to true, the Particle System will automatically start playing on startup. Note that this setting is shared between all Particle Systems in the current particle effect.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.PlayOnAwake
```
##### Time[β](#time "Direct link to Time")
float **Time** `get` `set`
*Playback position in seconds. Use this to read current playback time or to seek to a new playback time.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.Time = 5.0
```
##### Duration[β](#duration "Direct link to Duration")
float **Duration** `get`
*The duration of the Particle System in seconds.*
* Lua
```lua
duration = Space.Host.ExecutingObject.ParticleSystem.Duration
```
##### PlaybackSpeed[β](#playbackspeed "Direct link to PlaybackSpeed")
float **PlaybackSpeed** `get` `set`
*The playback speed of the Particle System. 1 is normal playback speed.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.PlaybackSpeed = 1.5
```
##### ParticleCount[β](#particlecount "Direct link to ParticleCount")
int **ParticleCount** `get`
*The current number of particles.*
* Lua
```lua
count = Space.Host.ExecutingObject.ParticleSystem.ParticleCount
```
##### EnableEmission[β](#enableemission "Direct link to EnableEmission")
bool **EnableEmission** `get` `set`
*When set to false, the Particle System will not emit particles.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.EnableEmission = true
```
##### EmissionRate[β](#emissionrate "Direct link to EmissionRate")
float **EmissionRate** `get` `set`
*The rate of particle emission.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.EmissionRate = 10
```
##### EmissionRateOverTime[β](#emissionrateovertime "Direct link to EmissionRateOverTime")
float **EmissionRateOverTime** `get` `set`
*The rate at which the emitter spawns new particles over time.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.EmissionRateOverTime = 10
```
##### EmissionRateOverDistance[β](#emissionrateoverdistance "Direct link to EmissionRateOverDistance")
float **EmissionRateOverDistance** `get` `set`
*The rate at which the emitter spawns new particles over distance. The emitter only spawns new particles when it moves.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.EmissionRateOverDistance = 10
```
##### StartSpeed[β](#startspeed "Direct link to StartSpeed")
float **StartSpeed** `get` `set`
*The initial speed of particles when the Particle System first spawns them.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartSpeed = 10
```
##### StartSize[β](#startsize "Direct link to StartSize")
float **StartSize** `get` `set`
*The initial size of particles when the Particle System first spawns them.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartSize = 1.2
```
##### StartColor[β](#startcolor "Direct link to StartColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **StartColor** `get` `set`
*The initial color of particles when the Particle System first spawns them.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartColor = Color.Red
```
##### StartRotation[β](#startrotation "Direct link to StartRotation")
float **StartRotation** `get` `set`
*The initial rotation of particles when emitted. When using curves, this value acts as a scale on the curve. Note that the value should be given in radians.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartRotation = 20.5
```
##### StartRotation3D[β](#startrotation3d "Direct link to StartRotation3D")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **StartRotation3D** `get` `set`
*The initial 3D rotation of particles when emitted. When using curves, this value acts as a scale on the curves. Note that the values are Euler angles and should be given in radians.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartRotation3D = Vector.New(0,20,20)
```
##### StartLifetime[β](#startlifetime "Direct link to StartLifetime")
float **StartLifetime** `get` `set`
*The total lifetime in seconds that particles will have when emitted. When using curves, this value acts as a scale on the curve. This value is set in the particle when it is created by the Particle System.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.StartLifetime = 20
```
##### GravityModifier[β](#gravitymodifier "Direct link to GravityModifier")
float **GravityModifier** `get` `set`
*A scale that this Particle System applies to gravity.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.GravityModifier = 1.2
```
##### MaxParticles[β](#maxparticles "Direct link to MaxParticles")
int **MaxParticles** `get` `set`
*The maximum number of particles to emit.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.MaxParticles = 500
```
##### RandomSeed[β](#randomseed "Direct link to RandomSeed")
uint **RandomSeed** `get` `set`
*Override the random seed used for the Particle System emission.*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.RandomSeed = 23423423
```
* Lua
```lua
spawningparticles = Space.Scene.Find("Particles")
--get particle object and get the particle system component on it.
particles=spawningparticles.ParticleSystem
--set random seed.
particles.UseAutoRandomSeed = false
particles.RandomSeed = 123456
```
##### UseAutoRandomSeed[β](#useautorandomseed "Direct link to UseAutoRandomSeed")
bool **UseAutoRandomSeed** `get` `set`
*Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. If set to true, the Particle System will generate a new random seed each time it is played. If set to false, ParticleSystem.randomSeed will be used instead, allowing for a constant seed (useful if you want your particles to play in exactly the same way each time) or user-defined random value (for example, you may want to cycle through an array of seeds).*
* Lua
```lua
Space.Host.ExecutingObject.ParticleSystem.UseAutoRandomSeed = true
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.ParticleSystem.GameObject
```
---
### SPlayableDirector
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------ |
| void [**Play** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#play)() |
| void [**Stop** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#stop)() |
| void [**Pause** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#pause)() |
| void [**Resume** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#resume)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------- |
| int [**State** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#state)`get` |
| double [**Time** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#time)`get` `set` |
| double [**InitialTime** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#initialtime)`get` `set` |
| double [**Duration** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#duration)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/splayabledirector.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Play[β](#play "Direct link to Play")
void **Play** ()
*Instantiates a Playable using the provided PlayableAsset and starts playback.*
* Lua
```lua
Space.Host.ExecutingObject.Director.Play()
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*Stop playback of the current Playable and destroys the corresponding graph.*
* Lua
```lua
Space.Host.ExecutingObject.Director.Stop()
```
##### Pause[β](#pause "Direct link to Pause")
void **Pause** ()
*Pause playback of the currently running playable.*
* Lua
```lua
Space.Host.ExecutingObject.Director.Pause()
```
##### Resume[β](#resume "Direct link to Resume")
void **Resume** ()
*Resume playing a paused playable.*
* Lua
```lua
Space.Host.ExecutingObject.Director.Resume()
```
#### Properties[β](#properties "Direct link to Properties")
##### State[β](#state "Direct link to State")
int **State** `get`
*The current playing state of the component.*
* Lua
```lua
intState = Space.Host.ExecutingObject.Director.State
```
##### Time[β](#time "Direct link to Time")
double **Time** `get` `set`
*The component's current time. This value is incremented according to the PlayableDirector.timeUpdateMode when it is playing. You can also change this value manually.*
* Lua
```lua
Space.Host.ExecutingObject.Director.Time = 10
```
##### InitialTime[β](#initialtime "Direct link to InitialTime")
double **InitialTime** `get` `set`
*The time at which the Playable should start when first played.*
* Lua
```lua
Space.Host.ExecutingObject.Director.Time = 2
```
##### Duration[β](#duration "Direct link to Duration")
double **Duration** `get`
*The duration of the Playable in seconds.*
* Lua
```lua
duration = Space.Host.ExecutingObject.Director.Duration
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Director.GameObject
```
---
### SPostProcessVolume
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/spostprocessvolume.md#enabled)`get` `set` |
| bool [**IsGlobal** ](/scripting/client-scripting-api-reference/components/spostprocessvolume.md#isglobal)`get` `set` |
| float? [**BlendDistance** ](/scripting/client-scripting-api-reference/components/spostprocessvolume.md#blenddistance)`get` `set` |
| float?? [**Weight** ](/scripting/client-scripting-api-reference/components/spostprocessvolume.md#weight)`get` `set` |
| float [**Priority** ](/scripting/client-scripting-api-reference/components/spostprocessvolume.md#priority)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/spostprocessvolume.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enable or disable post effect volume.*
* Lua
```lua
Space.Host.ExecutingObject.PostProcessVolume.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Post Process Volume component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.PostProcessVolume
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### IsGlobal[β](#isglobal "Direct link to IsGlobal")
bool **IsGlobal** `get` `set`
*Should this volume be applied to the whole scene?*
* Lua
```lua
Space.Host.ExecutingObject.PostProcessVolume.IsGlobal = true
```
##### BlendDistance[β](#blenddistance "Direct link to BlendDistance")
float? **BlendDistance** `get` `set`
*The outer distance to start blending from. A value of 0 means no blending and the volume overrides will be applied immediately upon entry.*
* Lua
```lua
Space.Host.ExecutingObject.PostProcessVolume.BlendDistance = 0
```
##### Weight[β](#weight "Direct link to Weight")
float?? **Weight** `get` `set`
*The total weight of this volume in the scene. 0 means it won't do anything, 1 means full effect.*
* Lua
```lua
Space.Host.ExecutingObject.PostProcessVolume.Weight = 1
```
##### Priority[β](#priority "Direct link to Priority")
float **Priority** `get` `set`
*The volume priority in the stack. Higher number means higher priority. Negative values are supported.*
* Lua
```lua
Space.Host.ExecutingObject.PostProcessVolume.Priority = 100
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.PostProcessVolume.GameObject
```
---
### SRectTransform
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetParent** ](/scripting/client-scripting-api-reference/components/srecttransform.md#setparent)(SGameObject parent, bool worldPositionStays) |
| void [**SetInsetAndSizeFromParentEdge** ](/scripting/client-scripting-api-reference/components/srecttransform.md#setinsetandsizefromparentedge)(int edge, float inset, float size) |
| void [**SetSizeWithCurrentAnchors** ](/scripting/client-scripting-api-reference/components/srecttransform.md#setsizewithcurrentanchors)(bool vertical, float size) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------- |
| SRect [**Rect** ](/scripting/client-scripting-api-reference/components/srecttransform.md#rect)`get` |
| SVector [**anchorMin** ](/scripting/client-scripting-api-reference/components/srecttransform.md#anchormin)`get` `set` |
| SVector [**anchorMax** ](/scripting/client-scripting-api-reference/components/srecttransform.md#anchormax)`get` `set` |
| SVector [**anchoredPosition3D** ](/scripting/client-scripting-api-reference/components/srecttransform.md#anchoredposition3d)`get` `set` |
| SVector [**anchoredPosition** ](/scripting/client-scripting-api-reference/components/srecttransform.md#anchoredposition)`get` `set` |
| SVector [**sizeDelta** ](/scripting/client-scripting-api-reference/components/srecttransform.md#sizedelta)`get` `set` |
| SVector [**pivot** ](/scripting/client-scripting-api-reference/components/srecttransform.md#pivot)`get` `set` |
| SVector [**offsetMin** ](/scripting/client-scripting-api-reference/components/srecttransform.md#offsetmin)`get` `set` |
| SVector [**offsetMax** ](/scripting/client-scripting-api-reference/components/srecttransform.md#offsetmax)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/srecttransform.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SetParent[β](#setparent "Direct link to SetParent")
void **SetParent** ([SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) parent, bool worldPositionStays)
*Set the parent of the transform.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.SetParent(anotherGameObject)
```
##### SetInsetAndSizeFromParentEdge[β](#setinsetandsizefromparentedge "Direct link to SetInsetAndSizeFromParentEdge")
void **SetInsetAndSizeFromParentEdge** (int edge, float inset, float size)
*Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.SetInsetAndSizeFromParentEdge(2, 3.0, 10.0)
```
##### SetSizeWithCurrentAnchors[β](#setsizewithcurrentanchors "Direct link to SetSizeWithCurrentAnchors")
void **SetSizeWithCurrentAnchors** (bool vertical, float size)
*Makes the RectTransform calculated rect be a given size on the specified axis.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.SetSizeWithCurrentAnchors(true, 10.0)
```
#### Properties[β](#properties "Direct link to Properties")
##### Rect[β](#rect "Direct link to Rect")
[SRect](/scripting/client-scripting-api-reference/types/srect.md) **Rect** `get`
*Property Description*
* Lua
```lua
rect = Space.Host.ExecutingObject.RectTransform.Rect
```
##### anchorMin[β](#anchormin "Direct link to anchorMin")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **anchorMin** `get` `set`
*The normalized position in the parent RectTransform that the lower left corner is anchored to.*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.anchorMin= Vector.New(0.3,0.3,0)
```
##### anchorMax[β](#anchormax "Direct link to anchorMax")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **anchorMax** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.anchorMax= Vector.New(0.7,0.6,0)
```
##### anchoredPosition3D[β](#anchoredposition3d "Direct link to anchoredPosition3D")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **anchoredPosition3D** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.anchoredPosition3D= Vector.New(0.7,0.6,0)
```
##### anchoredPosition[β](#anchoredposition "Direct link to anchoredPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **anchoredPosition** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.anchoredPosition= Vector.New(0.7,0.6,0)
```
##### sizeDelta[β](#sizedelta "Direct link to sizeDelta")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **sizeDelta** `get` `set`
*The size of this RectTransform relative to the distances between the anchors.*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.sizeDelta= Vector.New(90,90,0)
```
##### pivot[β](#pivot "Direct link to pivot")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **pivot** `get` `set`
*The normalized position in this RectTransform that it rotates around.*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.pivot= Vector.New(0.4,0.4,0)
```
##### offsetMin[β](#offsetmin "Direct link to offsetMin")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **offsetMin** `get` `set`
*The offset of the lower left corner of the rectangle relative to the lower left anchor.*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.offsetMin= Vector.New(-50,-50,0)
```
##### offsetMax[β](#offsetmax "Direct link to offsetMax")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **offsetMax** `get` `set`
*The offset of the upper right corner of the rectangle relative to the upper right anchor.*
* Lua
```lua
Space.Host.ExecutingObject.RectTransform.offsetMax= Vector.New(50,50,0)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.RectTransform.GameObject
```
---
### SReflectionProbe
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------- |
| void [**RenderProbe** ](/scripting/client-scripting-api-reference/components/sreflectionprobe.md#functionname)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------- |
| SVector [**Center** ](/scripting/client-scripting-api-reference/components/sreflectionprobe.md#center)`get` `set` |
| SVector [**Size** ](/scripting/client-scripting-api-reference/components/sreflectionprobe.md#size)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sreflectionprobe.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### RenderProbe[β](#renderprobe "Direct link to RenderProbe")
void **RenderProbe** ()
*Refreshes the probe's cubemap.*
* Lua
```lua
Space.Host.ExecutingObject.ReflectionProbe.RenderProbe()
```
#### Properties[β](#properties "Direct link to Properties")
##### Center[β](#center "Direct link to Center")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Center** `get` `set`
*The center of the box area in which reflections will be applied to the objects. Measured in the probe's local space.*
* Lua
```lua
vectorCenter = Space.Host.ExecutingObject.ReflectionProbe.Center
```
##### Size[β](#size "Direct link to Size")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Size** `get` `set`
*The size of the box area in which reflections will be applied to the objects. Measured in the probe's local space.*
* Lua
```lua
vectorSize = Space.Host.ExecutingObject.ReflectionProbe.Size
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.ReflectionProbe.GameObject
```
---
### SRenderer
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------- |
| bool [**IsVisible** ](/scripting/client-scripting-api-reference/components/srenderer.md#isvisible)`get` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/srenderer.md#enabled)`get` `set` |
| SMaterial [**Material** ](/scripting/client-scripting-api-reference/components/srenderer.md#material)`get` `set` |
| SMaterial [**SharedMaterial** ](/scripting/client-scripting-api-reference/components/srenderer.md#sharedmaterial)`get` `set` |
| SMaterial\[] [**Materials** ](/scripting/client-scripting-api-reference/components/srenderer.md#materials)`get` `set` |
| SMaterial\[] [**SharedMaterials** ](/scripting/client-scripting-api-reference/components/srenderer.md#sharedmaterials)`get` `set` |
| SVector [**BoundsMax** ](/scripting/client-scripting-api-reference/components/srenderer.md#boundsmax)`get` |
| SVector [**BoundsMin** ](/scripting/client-scripting-api-reference/components/srenderer.md#boundsmin)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/srenderer.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### IsVisible[β](#isvisible "Direct link to IsVisible")
bool **IsVisible** `get`
*Returns true if the renderer is visible on any camera. Note that the object is considered visible when it needs to be rendered in the Scene. For example, it might not actually be visible by any camera but still need to be rendered for shadows. When running in the editor, the Scene view cameras will also cause this value to be true.*
* Lua
```lua
isVisible = Space.Host.ExecutingObject.Renderer.IsVisible
```
* Lua
```lua
--this object will move forward only if visible on a camera
thisObject = Space.Host.ExecutingObject
function OnUpdateFunction()
if thisObject.Renderer.IsVisible then
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * Space.DeltaTime * 0.2)
end
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Get/Set if the rendered object is visible.*
* Lua
```lua
Space.Host.ExecutingObject.Renderer.Enabled = false
```
* Lua
```lua
--clicking this object will make it disappear/reappear
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
thisGameObject.Renderer.Enabled = not thisGameObject.Renderer.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Material[β](#material "Direct link to Material")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **Material** `get` `set`
*Returns the first instantiated Material assigned to the renderer.*
*Modifying material will change the material for this object only.*
*If the material is used by any other renderers, this will clone the shared material and start using it from now on.*
* Lua
```lua
Space.Host.ExecutingObject.Renderer.Material.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
```
* Lua
```lua
--clicking this object will toggle it's material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.Renderer.Material.GetColor("_Color") == Color.Black then
thisObject.Renderer.Material.SetColor("_Color", Color.Red)
else
thisObject.Renderer.Material.SetColor("_Color", Color.Black)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### SharedMaterial[β](#sharedmaterial "Direct link to SharedMaterial")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **SharedMaterial** `get` `set`
*The shared material of this object.*
*Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too.*
*It is not recommended to modify materials returned by sharedMaterial. If you want to modify the material of a renderer use material instead.*
* Lua
```lua
Space.Host.ExecutingObject.Renderer.SharedMaterial.SetColor("_Color", 1.0, 0.5, 0.5, 1.0)
```
* Lua
```lua
--clicking this object will toggle it's shared material's color between Red and Black color when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if thisObject.Renderer.SharedMaterial.GetColor("_Color") == Color.Black then
thisObject.Renderer.SharedMaterial.SetColor("_Color", Color.Red)
else
thisObject.Renderer.SharedMaterial.SetColor("_Color", Color.Black)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Materials[β](#materials "Direct link to Materials")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md)\[] **Materials** `get` `set`
*Returns all the instantiated materials of this object.*
*This is an array of all materials used by the renderer. Unity supports a single object using multiple materials; in this case materials contains all the materials. sharedMaterial and material properties return the first used material if there is more than one.*
*Modifying any material in materials will change the appearance of only that object.*
*Note that like all arrays returned by Unity, this returns a copy of materials array. If you want to change some materials in it, get the value, change an entry and set materials back.*
* Lua
```lua
mats = Space.Host.ExecutingObject.Renderer.Materials
```
##### SharedMaterials[β](#sharedmaterials "Direct link to SharedMaterials")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md)\[] **SharedMaterials** `get` `set`
*All the shared materials of this object.*
*This is an array of all materials used by the renderer. Unity supports a single object using multiple materials; in this case sharedMaterials contains all the materials. sharedMaterial and material properties return the first used material if there is more than one.*
*Modifying any material in sharedMaterials will change the appearance of all objects using this material, and change material settings that are stored in the project too.*
*It is not recommended to modify materials returned by sharedMaterials. If you want to modify the material of a renderer use material instead.*
*Note that like all arrays returned by Unity, this returns a copy of materials array. If you want to change some materials in it, get the value, change an entry and set materials back.*
* Lua
```lua
sharedMats = Space.Host.ExecutingObject.Renderer.SharedMaterials
```
##### BoundsMax[β](#boundsmax "Direct link to BoundsMax")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **BoundsMax** `get`
*Property Description*
* Lua
```lua
vectorBoundsMax = Space.Host.ExecutingObject.Renderer.BoundsMax
```
##### BoundsMin[β](#boundsmin "Direct link to BoundsMin")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **BoundsMin** `get`
*Property Description*
* Lua
```lua
vectorBoundsMin = Space.Host.ExecutingObject.Renderer.BoundsMin
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Renderer.GameObject
```
---
### SRigidbody
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| void [**AddExplosionForce** ](/scripting/client-scripting-api-reference/components/srigidbody.md#addexplosionforce)(float explosionForce, SVector explosionPosition, float explosionRadius, float upwardsModifier) |
| void [**AddForce** ](/scripting/client-scripting-api-reference/components/srigidbody.md#addforce)(SVector force) |
| void [**AddForceAtPosition** ](/scripting/client-scripting-api-reference/components/srigidbody.md#addforceatposition)(SVector force, SVector position) |
| void [**AddRelativeTorque** ](/scripting/client-scripting-api-reference/components/srigidbody.md#addrelativetorque)(SVector torque) |
| void [**AddTorque** ](/scripting/client-scripting-api-reference/components/srigidbody.md#addtorque)(SVector torque) |
| SVector [**ClosestPointOnBounds** ](/scripting/client-scripting-api-reference/components/srigidbody.md#closestpointonbounds)(SVector input) |
| SVector [**GetPointVelocity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#getpointvelocity)(SVector worldPoint) |
| SVector [**GetRelativePointVelocity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#getrelativepointvelocity)(SVector point) |
| void [**MovePosition** ](/scripting/client-scripting-api-reference/components/srigidbody.md#moveposition)(SVector point) |
| void [**MoveRotation** ](/scripting/client-scripting-api-reference/components/srigidbody.md#moverotation)(SQuaternion rotation) |
| void [**ResetCenterOfMass** ](/scripting/client-scripting-api-reference/components/srigidbody.md#resetcenterofmass)() |
| void [**ResetIntertiaTensor** ](/scripting/client-scripting-api-reference/components/srigidbody.md#resetintertiatensor)() |
| void [**Sleep** ](/scripting/client-scripting-api-reference/components/srigidbody.md#sleep)() |
| void [**WakeUp** ](/scripting/client-scripting-api-reference/components/srigidbody.md#wakeup)() |
| SPhysicsHit\[] [**SweepTestAll** ](/scripting/client-scripting-api-reference/components/srigidbody.md#sweeptestall)(SVector direction, float distance) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------------- |
| float [**AngularDrag** ](/scripting/client-scripting-api-reference/components/srigidbody.md#angulardrag)`get` `set` |
| SVector [**AngularVelocity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#angularvelocity)`get` `set` |
| SVector [**CenterOfMass** ](/scripting/client-scripting-api-reference/components/srigidbody.md#centerofmass)`get` `set` |
| float [**Drag** ](/scripting/client-scripting-api-reference/components/srigidbody.md#drag)`get` `set` |
| bool [**FreezeRotation** ](/scripting/client-scripting-api-reference/components/srigidbody.md#freezerotation)`get` `set` |
| bool [**Kinematic** ](/scripting/client-scripting-api-reference/components/srigidbody.md#kinematic)`get` `set` |
| float [**Mass** ](/scripting/client-scripting-api-reference/components/srigidbody.md#mass)`get` `set` |
| float [**MaxAngularVelocity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#maxangularvelocity)`get` `set` |
| float [**MaxDepenetrationVelocity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#maxdepenetrationvelocity)`get` `set` |
| bool [**UseGravity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#usegravity)`get` `set` |
| SVector [**Velocity** ](/scripting/client-scripting-api-reference/components/srigidbody.md#velocity)`get` `set` |
| SVector [**WorldCenterOfMass** ](/scripting/client-scripting-api-reference/components/srigidbody.md#worldcenterofmass)`get` |
| bool [**Sleeping** ](/scripting/client-scripting-api-reference/components/srigidbody.md#sleeping)`get` |
| float [**Density** ](/scripting/client-scripting-api-reference/components/srigidbody.md#density)`set` |
| SVector [**InertiaTensor** ](/scripting/client-scripting-api-reference/components/srigidbody.md#inertiatensor)`get` `set` |
| SQuaternion [**InertiaTensorRotation** ](/scripting/client-scripting-api-reference/components/srigidbody.md#inertiatensorrotation)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/srigidbody.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### AddExplosionForce[β](#addexplosionforce "Direct link to AddExplosionForce")
void **AddExplosionForce** (float explosionForce, [SVector](/scripting/client-scripting-api-reference/types/svector.md) explosionPosition, float explosionRadius, float upwardsModifier)
*Applies a force to a rigidbody that simulates explosion effects. Other rigidbodies will be affected by the explosion within its radius - the closer they are to the explosionPosition, the stronger the force will be exerted on them.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AddExplosionForce (300, Vector.New(0,0,0), 10, 20)
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
obj.Rigidbody.AddExplosionForce (300, obj.WorldPosition, 10, 20)
-- The explosion will occur at the location of the ExecutingObject.
-- Place other rigidbodies around it to observe the effect!
```
##### AddForce[β](#addforce "Direct link to AddForce")
void **AddForce** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) force)
*Adds a force to the Rigidbody that is continuously exerted on it in the given direction.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AddForce(Vector.New(0,1,0))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
obj.Rigidbody.AddForce (Vector.New(0,100,0));
-- Now the rigidbody is under a continuous force directed upwards (Y direction)
```
##### AddForceAtPosition[β](#addforceatposition "Direct link to AddForceAtPosition")
void **AddForceAtPosition** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) force,[ SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*Adds a force to the Rigidbody at a given position (should be within the range of the rigidbody for a realistic result). Thus, both a torque and force are applied to the object.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AddForceAtPosition(Vector.New(1,1,1), Vector.New(0,1,0))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local applyForceHere = Vector.New(obj.WorldPosition.x-0.5,obj.WorldPosition.y-0.5,obj.WorldPosition.z-0.5)
-- This vector is equivalent to one of the lower corners of a 1x1x1 cube.
obj.Rigidbody.AddForceAtPosition (Vector.New(0,40,0), applyForceHere);
-- The object is experiencing an effect similar to being tipped upwards at the aforementioned corner.
```
##### AddRelativeTorque[β](#addrelativetorque "Direct link to AddRelativeTorque")
void **AddRelativeTorque** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) torque)
*Adds a torque to the rigidbody relative to the local coordinate system.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AddRelativeTorque(Vector.New(0,1,0))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
obj.Rigidbody.AddRelativeTorque (Vector.New(0,100,0));
-- Now the object spins about its own Y axis
```
##### AddTorque[β](#addtorque "Direct link to AddTorque")
void **AddTorque** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) torque)
*Adds a torque to the rigidbody relative to the global coordinate system.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AddTorque(Vector.New(0,1,0))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
obj.Rigidbody.AddTorque (Vector.New(0,100,0));
-- Now the object spins about the global Y axis
```
##### ClosestPointOnBounds[β](#closestpointonbounds "Direct link to ClosestPointOnBounds")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **ClosestPointOnBounds** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) input)
*Returns the closest point on the bounding box of the attached colliders.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.ClosestPointOnBounds(Vector.New(1,1,1))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
Space.Log(obj.Rigidbody.ClosestPointOnBounds (Vector.Zero));
-- prints [x,y,z] to the console, where x,y,z are coordinates of the rigidbody's point that is the closest to the global origin
```
##### GetPointVelocity[β](#getpointvelocity "Direct link to GetPointVelocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetPointVelocity** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) worldPoint)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.GetPointVelocity(Vector.New(0,1,0))
```
##### GetRelativePointVelocity[β](#getrelativepointvelocity "Direct link to GetRelativePointVelocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetRelativePointVelocity** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) point)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.GetRelativePointVelocity(Vector.New(1,1,1))
```
##### MovePosition[β](#moveposition "Direct link to MovePosition")
void **MovePosition** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) point)
*Moves the rigidbody to position.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.MovePosition(Vector.New(1,1,1))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local moveHere = Vector.New(obj.WorldPosition.x+10,obj.WorldPosition.y,obj.WorldPosition.z);
obj.Rigidbody.MovePosition (moveHere);
-- The object has been moved by 10 units in the positive X direction
```
##### MoveRotation[β](#moverotation "Direct link to MoveRotation")
void **MoveRotation** ([SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) rotation)
*Rotates the rigidbody to rotation.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.MoveRotation(Quaternion.New(0,1,0,0))
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local setRotationTo = Quaternion.Euler(60,0,0)
obj.Rigidbody.MoveRotation (setRotationTo);
-- The object's rotation has been set to 60 degrees in the positive X direction and 0 in Y and Z
```
##### ResetCenterOfMass[β](#resetcenterofmass "Direct link to ResetCenterOfMass")
void **ResetCenterOfMass** ()
*Reset the center of mass of the rigidbody.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.ResetCenterOfMass()
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
obj.Rigidbody.CenterOfMass = Vector.New(1,1,1);
Space.Log(obj.Rigidbody.CenterOfMass);
-- prints "[1,1,1]" to the console
obj.Rigidbody.ResetCenterOfMass();
Space.Log(obj.Rigidbody.CenterOfMass);
-- prints "[0,0,0]" to the console
```
##### ResetIntertiaTensor[β](#resetintertiatensor "Direct link to ResetIntertiaTensor")
void **ResetIntertiaTensor** ()
*Reset the inertia tensor value and rotation.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.ResetIntertiaTensor()
```
* Lua
```lua
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
rigid = solid.AddRigidbody()
end
rigid.ResetIntertiaTensor()
--to reset inertia tensor if intertia tensor is set
```
##### Sleep[β](#sleep "Direct link to Sleep")
void **Sleep** ()
*Forces a rigidbody to sleep.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.Sleep()
```
##### WakeUp[β](#wakeup "Direct link to WakeUp")
void **WakeUp** ()
*Forces a rigidbody to wake up.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.WakeUp()
```
##### SweepTestAll[β](#sweeptestall "Direct link to SweepTestAll")
[SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **SweepTestAll** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) direction, float distance)
*Like Rigidbody.SweepTest, but returns all hits.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.SweepTestAll(Vector.New(1,0,0) , 20)
```
* Lua
```lua
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
rigid = solid.AddRigidbody()
end
hits = rigid.SweepTestAll(solid.Forward , 20)
--sweep forward 20 meters, and return all hits.
if hits~=nil and #hits-1 > 0 then
for i = 1,#hits-1 do
Space.Log(hits[i].Object.Name)
end
end
--output all hit gameobject.
```
#### Properties[β](#properties "Direct link to Properties")
##### AngularDrag[β](#angulardrag "Direct link to AngularDrag")
float **AngularDrag** `get` `set`
*The angular drag of the object.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AngularDrag = 0.20
```
##### AngularVelocity[β](#angularvelocity "Direct link to AngularVelocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **AngularVelocity** `get` `set`
*The angular velocity vector of the rigidbody (in radians per second).*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.AngularVelocity = Vector.New(0,1,0)
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
-- Set a new angular velocity vector
obj.Rigidbody.AngularVelocity = Vector.New(0,Space.Math.Pi,0);
-- Now the object is rotating about the Y axis at a speed of 180 degrees per second
-- (or 30 revolutions per minute)
-- Get the current angular velocity vector
Space.Log(obj.Rigidbody.AngularVelocity);
-- prints "[0, 3.141593, 0]" to the console
```
##### CenterOfMass[β](#centerofmass "Direct link to CenterOfMass")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **CenterOfMass** `get` `set`
*The center of mass relative to the local origin.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.CenterOfMass = Vector.New(1,0,0)
```
##### Drag[β](#drag "Direct link to Drag")
float **Drag** `get` `set`
*The drag of the object.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.Drag = 5
```
##### FreezeRotation[β](#freezerotation "Direct link to FreezeRotation")
bool **FreezeRotation** `get` `set`
*Controls whether physics will have any impact on the rotation of the object.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.FreezeRotation = true
```
##### Kinematic[β](#kinematic "Direct link to Kinematic")
bool **Kinematic** `get` `set`
*Controls whether physics will have any impact on the object.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.Kinematic = true
```
##### Mass[β](#mass "Direct link to Mass")
float **Mass** `get` `set`
*The mass of the rigidbody.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.Mass = 0.1
```
##### MaxAngularVelocity[β](#maxangularvelocity "Direct link to MaxAngularVelocity")
float **MaxAngularVelocity** `get` `set`
*The maximum angular velocity of the rigidbody (7 by default). Can be useful to prevent an object from spinning uncontrollably fast.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.MaxAngularVelocity = 1
```
##### MaxDepenetrationVelocity[β](#maxdepenetrationvelocity "Direct link to MaxDepenetrationVelocity")
float **MaxDepenetrationVelocity** `get` `set`
*The maximum depenetration velocity of the rigidbody (1.00000003318135E+32 by default). Can be useful to make colliding objects bounce away in a smoother fashion.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.MaxDepenetrationVelocity = 1
```
##### UseGravity[β](#usegravity "Direct link to UseGravity")
bool **UseGravity** `get` `set`
*Controls whether gravity affects the rigidbody.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.UseGravity = true
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
-- Set UseGravity to False (it is set to True by default)
obj.Rigidbody.UseGravity = false;
-- Now gravity does not affect the rigidbody.
-- Get the UseGravity value (find out if UseGravity is in action)
Space.Log(obj.Rigidbody.UseGravity);
-- prints "False" to the console
```
##### Velocity[β](#velocity "Direct link to Velocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Velocity** `get` `set`
*The velocity vector of the rigidbody. (in units per second).*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.Velocity = Vector.New(0,1,0)
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
-- Set a new velocity vector
obj.Rigidbody.Velocity = Vector.New(0, 0, 1);
-- Now the object is moving in the positive Z direction at a speed of 1 unit per second
-- Get the current velocity vector
Space.Log(obj.Rigidbody.Velocity);
-- prints "[0, 0, 1]" to the console
```
##### WorldCenterOfMass[β](#worldcenterofmass "Direct link to WorldCenterOfMass")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **WorldCenterOfMass** `get`
*The center of mass of the rigidbody relative to the global origin (Read Only).*
* Lua
\`\`\` WorldCenter = Space.Host.ExecutingObject.Rigidbody.WorldCenterOfMass \`\`\`
* Lua
```lua
local obj = Space.Host.ExecutingObject;
-- Get the current center of mass
Space.Log(obj.Rigidbody.WorldCenterOfMass);
-- prints "[x, y, z]" to the console, where x,y,z are global coordinates of the center of mass. If CenterOfMass == [0,0,0], then x,y,z are equal to the global coordinates of the object.
```
##### Sleeping[β](#sleeping "Direct link to Sleeping")
bool **Sleeping** `get`
*Is the rigidbody sleeping?*
* Lua
```lua
isSleeping = Space.Host.ExecutingObject.Rigidbody.Sleeping
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
obj.Rigidbody.Sleep();
Space.Log(obj.Rigidbody.Sleeping);
-- prints "True" to the console
obj.Rigidbody.WakeUp();
Space.Log(obj.Rigidbody.Sleeping);
-- prints "False" to the console
```
##### Density[β](#density "Direct link to Density")
float **Density** `set`
*The density of the object (1 by default). Changing this value will affect the mass of the object (the volume will remain unchanged).*
* Lua
```lua
density = Space.Host.ExecutingObject.Rigidbody.Density
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
Space.Log(obj.Rigidbody.Mass);
-- prints "1" to the console
obj.LocalScale = Vector.New(2,2,2);
obj.Rigidbody.Density = 0.5;
Space.Log(obj.Rigidbody.Mass);
-- prints "4" to the console - the density is 2 times lower, and the object is 8 times bigger, therefore it's 4 times heavier.
```
##### InertiaTensor[β](#inertiatensor "Direct link to InertiaTensor")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **InertiaTensor** `get` `set`
*The diagonal inertia tensor of mass relative to the center of mass. It is defined in x,y,z axis. It is calculate by physics automatically,and if you set value to it, it would override the value.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.IntertiaTensor = Vector.New(0,0,0)
```
* Lua
```lua
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
rigid = solid.AddRigidbody()
end
rigid.InertiaTensor = Vector.New(10,100,1)
rigid.AddTorque(Vector.New(100,100,100))
--set inertia tensor to 10,100,1, and add torque 100 to all axis,and rotate velocity x:y:z would be 10:1:100.
```
##### InertiaTensorRotation[β](#inertiatensorrotation "Direct link to InertiaTensorRotation")
[SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) **InertiaTensorRotation** `get` `set`
*The rotation of the inertia tensor.*
* Lua
```lua
Space.Host.ExecutingObject.Rigidbody.InertiaTensorRotation = Quaternion.New(0,0,0,0)
```
* Lua
```lua
solid = Space.Scene.Find("Solid")
--get rigidbody of inertia frame.
rigid = solid.Rigidbody
if rigid == nil then
rigid = solid.AddRigidbody()
end
rigid.InertiaTensor = Vector.New(10,100,1)
rigid.InertiaTensorRotation = Quaternion.Euler(0,90,0)
rigid.AddTorque(Vector.New(100,100,100))
--set inertia tensor manually and rotate this inertia tensor by 90 degrees in y axis.
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Rigidbody.GameObject
```
---
### SRoomFloor
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------ |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#enabled)`get` `set` |
| string [**Name** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#name)`get` |
| string [**Description** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#description)`get` |
| bool [**IsDefaultFloor** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#isdefaultfloor)`get` |
| SGameObject\[] [**Furniture** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#furniture)`get` |
| int [**Owner** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#owner)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sroomfloor.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Status of enable or disable room floor component*
* Lua
```lua
Space.Host.ExecutingObject.Floor.Enabled = false
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Name of this floor*
* Lua
```lua
Space.Host.ExecutingObject.Floor.Name
```
##### Description[β](#description "Direct link to Description")
string **Description** `get`
*Description of this floor.*
* Lua
```lua
floorDescription = Space.Host.ExecutingObject.Floor.Description
```
##### IsDefaultFloor[β](#isdefaultfloor "Direct link to IsDefaultFloor")
bool **IsDefaultFloor** `get`
*Is this default floor?*
* Lua
```lua
isDefault = Space.Host.ExecutingObject.Floor.IsDefaultFloor
```
##### Furniture[β](#furniture "Direct link to Furniture")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md)\[] **Furniture** `get`
*Get all furniture game objects*
* Lua
```lua
furnitureInFloor = Space.Host.ExecutingObject.Floor.Furniture
```
##### Owner[β](#owner "Direct link to Owner")
int **Owner** `get`
*Return the ID of the user account that owns this room floor, if any.*
* Lua
```lua
ownerID = Space.Host.ExecutingObject.Floor.Owner
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Floor.GameObject
```
---
### SSceneBackgroundMusic
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Play** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#play)() |
| void [**PlayMP3Stream** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#playmp3stream)(string url) |
| void [**PlayVorbisStream** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#playvorbisstream)(string url) |
| void [**Stop** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#stop)() |
| void [**OnTrackChange** ](sscenebackgroundmusic#ontrackchange)(Closure o) void [**OnTrackChange** ](sscenebackgroundmusic#ontrackchange)(Action< STrackInfo > trackInfoCallback) |
| void [**OnUpcomingTrackChange** ](sscenebackgroundmusic#onupcomingtrackchange)(Closure o) void [**OnUpcomingTrackChange** ](sscenebackgroundmusic#onupcomingtrackchange)(Action< STrackInfo > trackInfoCallback) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#enabled)`get` `set` |
| string [**URL** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#url)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Play[β](#play "Direct link to Play")
void **Play** ()
*Plays the radio stream*
* Lua
```lua
Space.Host.ExecutingObject.Radio.Play()
```
* Lua
```lua
--this script will let us click a radio to make it start playing
--(Example: clicking a light switch toggle's a parent light bulb's intensity)
--[Requires a "Shoutcast Streaming" component on the parent of this object]
thisGameObject = Space.Host.ExecutingObject
IsPlaying = false
StartPlaying = function()
thisGameObject.Radio.Play()
IsPlaying = true
end
StopPlaying = function()
thisGameObject.Radio.Stop()
IsPlaying = false
end
OnClick = function()
if IsPlaying then
StopPlaying()
else
StartPlaying()
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Toggle Play/Stop"
thisGameObject.Clickable.OnClick(OnClick)
```
##### PlayMP3Stream[β](#playmp3stream "Direct link to PlayMP3Stream")
void **PlayMP3Stream** (string url)
*Sets the given MP3 stream url as current stream*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Radio.PlayMP3Stream("http://stream.example.org:1234/")
```
##### PlayVorbisStream[β](#playvorbisstream "Direct link to PlayVorbisStream")
void **PlayVorbisStream** (string url)
*Sets the given Vorbis stream url as current stream*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Radio.PlayVorbisStream("http://stream.example.org:1234/")
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*Stops playing the radio stream*
* Lua
```lua
Space.Host.ExecutingObject.Radio.Stop()
```
* Lua
```lua
--this script will let us click a radio to make it start playing
--(Example: clicking a light switch toggle's a parent light bulb's intensity)
--[Requires a "Shoutcast Streaming" component on the parent of this object]
thisGameObject = Space.Host.ExecutingObject
IsPlaying = false
StartPlaying = function()
thisGameObject.Radio.Play()
IsPlaying = true
end
StopPlaying = function()
thisGameObject.Radio.Stop()
IsPlaying = false
end
OnClick = function()
if IsPlaying then
StopPlaying()
else
StartPlaying()
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Toggle Play/Stop"
thisGameObject.Clickable.OnClick(OnClick)
```
##### OnTrackChange[β](#ontrackchange "Direct link to OnTrackChange")
void **OnTrackChange** (Closure o) void **OnTrackChange** (Action<[ STrackInfo](/scripting/client-scripting-api-reference/types/strackinfo.md) > trackInfoCallback)
*Function will be called when track changes.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
otc = function(trackInfo)
end
Space.Host.ExecutingObject.Radio.OnTrackChange(otc)
```
* Lua
```lua
--this script will update a UIText object with the track title on track change
--[this GameObject needs a "Shoutcast Streaming"/"SceneBackgroundMusic" component]
thisObj = Space.Host.ExecutingObject
text = Space.Host.GetReference("Text") -- set in Scripting Runtime references
otc = function(trackInfo)
text.UIText.Text = "Track: " .. trackInfo.Title .. " by " .. trackInfo.Artist
end
thisObj.Radio.OnTrackChange(otc)
```
##### OnUpcomingTrackChange[β](#onupcomingtrackchange "Direct link to OnUpcomingTrackChange")
void **OnUpcomingTrackChange** (Closure o) void **OnUpcomingTrackChange** (Action< [STrackInfo](/scripting/client-scripting-api-reference/types/strackinfo.md) > trackInfoCallback)
*Function will be called when there's an upcoming track change*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
otc = function(trackInfo)
end
Space.Host.ExecutingObject.Radio.OnUpcomingTrackChange(otc)
```
* Lua
```lua
--this script will update a UIText object with the track title on upcoming track change
--[this GameObject needs a "Shoutcast Streaming"/"SceneBackgroundMusic" component]
thisObj = Space.Host.ExecutingObject
text = Space.Host.GetReference("Text") -- set in Scripting Runtime references
outc = function(upcomingTrackInfo)
text.UIText.Text = "Track: " .. upcomingTrackInfo.Title .. " by " .. upcomingTrackInfo.Artist
end
thisObj.Radio.OnUpcomingTrackChange(outc)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is this component Enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Radio.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Scene Background Music component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Radio
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### URL[β](#url "Direct link to URL")
string **URL** `get`
*URL of the current stream*
* Lua
```lua
streamURL = Space.Host.ExecutingObject.Radio.URL
```
* Lua
```lua
--this script will update a UIText object with the current stream URL
--[this GameObject needs a "Shoutcast Streaming"/"SceneBackgroundMusic" component]
thisObj = Space.Host.ExecutingObject
text = Space.Host.GetReference("Text") -- set in Scripting Runtime references
OnUpdate = function()
text.UIText.Text = thisObj.Radio.URL
end
thisObj.OnUpdate(OnUpdate)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Floor.GameObject
```
---
### SScriptingData
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| object [**GetVariable** ](/scripting/client-scripting-api-reference/components/sscriptingdata.md#getvariable)(string name) |
| void [**SetVariable** ](/scripting/client-scripting-api-reference/components/sscriptingdata.md#setvariable)(string name, DynValue property, bool persistent=false) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sscriptingdata.md#enabled)`get` `set` |
| string\[] [**Variables** ](/scripting/client-scripting-api-reference/components/sscriptingdata.md#variables)`get` |
| string [**ComponentName**](/scripting/client-scripting-api-reference/components/sscriptingdata.md#componentname) `get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sscriptingdata.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetVariable[β](#getvariable "Direct link to GetVariable")
object **GetVariable** (string name)
*Return the object of the variable.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Data.GetVariable("variableName")
```
##### SetVariable[β](#setvariable "Direct link to SetVariable")
void **SetVariable** (string name, DynValue property, bool persistent=false)
*Set properties to variable.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.SetVariable("variableName",5,true)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is the ScriptingData component Enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Data.Enabled = false
```
* Lua
```lua
--clicking this object will Enable/Disable it's Scripting Data component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Data
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Variables[β](#variables "Direct link to Variables")
string\[] **Variables** `get`
*Property Description*
* Lua
```lua
variableNames = Space.Host.ExecutingObject.Data.Variables
```
##### ComponentName[β](#componentname "Direct link to ComponentName")
string **ComponentName** `get`
*The name of this component.*
* Lua
```lua
componentName = Space.Host.ExecutingObject.Data.ComponentName
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Data.GameObject
```
---
### SScriptingEvents
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------------- |
| void [**InvokeEvent** ](/scripting/client-scripting-api-reference/components/sscriptingevents.md#invokeevent)(string name) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------ |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sscriptingevents.md#enabled)`get` `set` |
| string\[] [**Events** ](/scripting/client-scripting-api-reference/components/sscriptingevents.md#events)`get` |
| string [**ComponentName**](/scripting/client-scripting-api-reference/components/sscriptingevents.md#componentname) `get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sscriptingevents.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### InvokeEvent[β](#invokeevent "Direct link to InvokeEvent")
void **InvokeEvent** (string name)
*Invoke the event with its name*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Events.InvokeEvent("EventName")
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the scriptingEvents component is enabled or not*
* Lua
```lua
Space.Host.ExecutingObject.Events.Enabled = true
```
##### Events[β](#events "Direct link to Events")
string\[] **Events** `get`
*Returns a list of events*
* Lua
```lua
eventNames = Space.Host.ExecutingObject.Events.Events
```
##### ComponentName[β](#componentname "Direct link to ComponentName")
string **ComponentName** `get`
*The name of this component.*
* Lua
```lua
componentName = Space.Host.ExecutingObject.Events.ComponentName
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Events.GameObject
```
---
### SScriptingResources
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| SResource [**GetResource** ](/scripting/client-scripting-api-reference/components/sscriptingresources.md#getresource)(string name) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sscriptingresources.md#enabled)`get` `set` |
| SResource\[] [**Resources** ](/scripting/client-scripting-api-reference/components/sscriptingresources.md#resources)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sscriptingresources.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetResource[β](#getresource "Direct link to GetResource")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **GetResource** (string name)
*Returns the SResource with the specified name, or else returns nil if not found.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
resource = Space.Host.ExecutingObject.Resources.GetResource("ResourceName")
```
* Lua
```lua
local thisObject=Space.Host.ExecutingObject
local thisObjectResource=thisObject.Resources.GetResource("Test")
if thisObjectResource == nil then
Space.Log("That resource was not found.")
else
Space.Log("That resource exists and can be used.")
end
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Return whether the ScriptingResources component is Enabled or not*
* Lua
```lua
Space.Host.ExecutingObject.Resources.Enabled = true
```
##### Resources[β](#resources "Direct link to Resources")
SResource\[] **Resources** `get`
*Returns an array of all resources contained within this component.*
* Lua
```lua
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject
```
---
### SScriptingRuntime
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SResource [**GetResource** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#getresource)(string name) |
| void [**CallScriptFunction** ](sscriptingruntime#callscriptfunction)(string name, params DynValue\[] arguments) void [**CallScriptFunction** ](sscriptingruntime#callscriptfunction)(string name) |
| void [**Reset** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#reset)() |
| object [**GetPublicVariable** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#getpublicvariable)(string name) |
| void [**SetPublicVariable** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#setpublicvariable)(string name, DynValue property, bool persistent=false) |
| void [**InvokeEvent** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#invokeevent)(string name) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------- |
| SResource\[] [**Resources** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#resources)`get` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#enabled)`get` `set` |
| string [**ComponentName**](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#componentname) `get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sscriptingruntime.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetResource[β](#getresource "Direct link to GetResource")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **GetResource** (string name)
*Get the resource by its name and return it.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
resource = Space.Host.ExecutingObject.Script.GetResource("resource name")
```
##### CallScriptFunction[β](#callscriptfunction "Direct link to CallScriptFunction")
void **CallScriptFunction** (string name, params DynValue\[] arguments) void **CallScriptFunction** (string name)
*Call registered script function with specified arguments.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName")
--or
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName", tableWithArguments)
```
##### Reset[β](#reset "Direct link to Reset")
void **Reset** ()
*Reset event members to their initial values.*
* Lua
```lua
Space.Host.ExecutingObject.Script.Reset()
```
##### GetPublicVariable[β](#getpublicvariable "Direct link to GetPublicVariable")
object **GetPublicVariable** (string name)
*Gets the public variable by its name and return it.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
publicVariable = Space.Host.ExecutingObject.Script.GetPublicVariable("variableName")
```
##### SetPublicVariable[β](#setpublicvariable "Direct link to SetPublicVariable")
void **SetPublicVariable** (string name, DynValue property, bool persistent=false)
*Set the property to public variable with name "name".*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Script.SetPublicVariable("VariableName",5,true)
```
##### InvokeEvent[β](#invokeevent "Direct link to InvokeEvent")
void **InvokeEvent** (string name)
*Invokes the event with the name "name".*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Script.InvokeEvent("EventName")
```
#### Properties[β](#properties "Direct link to Properties")
##### Resources[β](#resources "Direct link to Resources")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md)\[] **Resources** `get`
*Return a list of resource.*
* Lua
```lua
tableResources = Space.Host.ExecutingObject.Script.Resources
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the scripting runtime component is Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.Script.Enabled = true
```
##### ComponentName[β](#componentname "Direct link to ComponentName")
string **ComponentName** `get`
*The name of this component.*
* Lua
```lua
componentName = Space.Host.ExecutingObject.Script.ComponentName
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Script.GameObject
```
---
### SSeat
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------- |
| void [**SitPlayer** ](/scripting/client-scripting-api-reference/components/sseat.md#sitplayer)() |
| void [**UnseatPlayer** ](/scripting/client-scripting-api-reference/components/sseat.md#unseatplayer)() |
| void [**OnStandUp** ](/scripting/client-scripting-api-reference/components/sseat.md#onstandup)(Closure e) |
| void [**OnSit** ](/scripting/client-scripting-api-reference/components/sseat.md#onsit)(Closure e) |
| void [**OnPlayerStandUp** ](/scripting/client-scripting-api-reference/components/sseat.md#onplayerstandup)(Closure e) |
| void [**OnPlayerSit** ](/scripting/client-scripting-api-reference/components/sseat.md#onplayersit)(Closure e) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sseat.md#enabled)`get` `set` |
| bool [**InUse** ](/scripting/client-scripting-api-reference/components/sseat.md#inuse)`get` |
| long [**PlayerSeated** ](/scripting/client-scripting-api-reference/components/sseat.md#playerseated)`get` |
| bool [**UseSlotID** ](/scripting/client-scripting-api-reference/components/sseat.md#useslotid)`get` `set` |
| string [**SlotID** ](/scripting/client-scripting-api-reference/components/sseat.md#slotid)`get` `set` |
| SCollider [**ClickableCollider** ](/scripting/client-scripting-api-reference/components/sseat.md#clickablecollider)`get` `set` |
| SResource [**Animation** ](/scripting/client-scripting-api-reference/components/sseat.md#animation)`get` `set` |
| SResource [**AnimationMale** ](/scripting/client-scripting-api-reference/components/sseat.md#animationmale)`get` `set` |
| SResource [**AnimationFemale** ](/scripting/client-scripting-api-reference/components/sseat.md#animationfemale)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sseat.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SitPlayer[β](#sitplayer "Direct link to SitPlayer")
void **SitPlayer** ()
*Make a player sit.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Seat.SitPlayer()
```
##### UnseatPlayer[β](#unseatplayer "Direct link to UnseatPlayer")
void **UnseatPlayer** ()
*Make a player unseat.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Seat.UnseatPlayer()
```
##### OnStandUp[β](#onstandup "Direct link to OnStandUp")
void **OnStandUp** (Closure e)
*Binds a function to the Seat's On Stand Up event*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
e = function()
Space.Log("On Stand Up event")
end
Space.Host.ExecutingObject.Seat.OnStandUp(e)
```
##### OnSit[β](#onsit "Direct link to OnSit")
void **OnSit** (Closure e)
*Binds a function to the Seat's On Sit event*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
e = function()
Space.Log("On Sit event")
end
Space.Host.ExecutingObject.Seat.OnSit(e)
```
##### OnPlayerStandUp[β](#onplayerstandup "Direct link to OnPlayerStandUp")
void **OnPlayerStandUp** (Closure e)
*Binds a function to the Seat's On Player Stand Up event which is fired only on the Player's client*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
e = function()
Space.Log("On Player Stand Up")
end
Space.Host.ExecutingObject.Seat.OnPlayerStandUp(e)
```
* Lua
```lua
--the below script will teleport the player above the seat after standing up
--so that they do not go back to original position, but rather be standing next to the seat
--(Example: if the seat moves - such as in a vehicle- and we want to stand up next to it)
--[Requires Seat Component in the GameObject running this script]
thisGameObject = Space.Host.ExecutingObject
OnPlayerStandUp = function()
seatPosition = thisGameObject.WorldPosition
teleportPosition = Vector.New(seatPosition.X, seatPosition.Y + 1, seatPosition.Z)
Space.Scene.PlayerAvatar.Teleport(teleportPosition)
end
thisGameObject.Seat.OnPlayerStandUp(OnPlayerStandUp)
```
##### OnPlayerSit[β](#onplayersit "Direct link to OnPlayerSit")
void **OnPlayerSit** (Closure e)
*Binds a function to the Seat's On Player Sit event which is fired only on the Player's client*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
e = function()
Space.Log("On Player Sit event")
end
Space.Host.ExecutingObject.Seat.OnPlayerSit(e)
```
* Lua
```lua
--the below script will check if the player sitting is the owner of the seat
--if they are not, we will remove them from the seat
--(Example: if the seat is a vehicle which the owner wants no one else to use)
--[Requires Seat Component in the GameObject running this script]
--
thisGameObject = Space.Host.ExecutingObject
OnPlayerSit = function()
if Space.Scene.PlayerAvatar.ID ~= thisGameObject.Owner then
thisGameObject.Seat.UnseatPlayer()
Space.Log("You do not have permission to sit in this vehicle")
end
end
thisGameObject.Seat.OnPlayerSit(OnPlayerSit)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the seat component is enabled.*
* Lua
```lua
= seatIsEnabled = Space.Host.ExecutingObject.Seat.Enabled
```
* Lua
```lua
--clicking this object will Enable/Disable it's Seat component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Seat
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### InUse[β](#inuse "Direct link to InUse")
bool **InUse** `get`
*Return that whether the seat is in use.*
* Lua
```lua
seatIsInUse = Space.Host.ExecutingObject.Seat.InUse
```
* Lua
```lua
--this script will play a looping sound only if someone is using the seat
--and will stop the sound if someone is not
--(Example: carnival game )
--[Object must contain a Seat component and AudioSource component]
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if thisGameObject.Seat.InUse then
if not thisGameObject.Audio.IsPlaying then
thisGameObject.Audio.Play()
end
else
if thisGameObject.Audio.IsPlaying then
thisGameObject.Audio.Stop()
end
end
end
thisGameObject.Audio.Loop = true
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### PlayerSeated[β](#playerseated "Direct link to PlayerSeated")
long **PlayerSeated** `get`
*Return the ID of the seating player.*
* Lua
```lua
player = Space.Host.ExecutingObject.Seat.PlayerSeated
```
##### UseSlotID[β](#useslotid "Direct link to UseSlotID")
bool **UseSlotID** `get` `set`
*Return true if uses SlotID*
* Lua
```lua
Space.Host.ExecutingObject.Seat.UseSlotID = false
```
##### SlotID[β](#slotid "Direct link to SlotID")
string **SlotID** `get` `set`
*Return the slot ID of the seat.*
* Lua
```lua
seatSlotID = Space.Host.ExecutingObject.Seat.SlotID
```
##### ClickableCollider[β](#clickablecollider "Direct link to ClickableCollider")
[SCollider](/scripting/client-scripting-api-reference/components/scollider.md) **ClickableCollider** `get` `set`
*Return the clickable collider.*
* Lua
```lua
seatClickableCollider = Space.Host.ExecutingObject.Seat.ClickableCollider
```
##### Animation[β](#animation "Direct link to Animation")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Animation** `get` `set`
*Return the animation clip.*
* Lua
```lua
Space.Host.ExecutingObject.Seat.Animation = Space.GetResource("ResourceName")
```
* Lua
```lua
--the below script will toggle between two seat animations every 30 seconds
--(Example: a couch where the player sitting periodically changes pose)
--[Requires Seat Component in the GameObject running this script]
--[Requires adding 2 animations as "Resources" at the bottom of the Scripting Runtime Component]
thisGameObject = Space.Host.ExecutingObject
anim1 = Space.GetResource("anim1")
anim2 = Space.GetResource("anim2")
thisGameObject.Seat.Animation = anim1
animIndex = 1
AnimationAlternate = function()
while true do
Space.Log(thisGameObject.Seat.Animation)
if animIndex == 1 then
thisGameObject.Seat.Animation = anim2
animIndex = 2
else
thisGameObject.Seat.Animation = anim1
animIndex = 1
end
-- next part unseats then seats the player to reflect animation change (its too fast to notice)
-- we also make sure we are running this part on the specific player sitting (if any), not everyone else
if thisGameObject.Seat.InUse then
if thisGameObject.Seat.PlayerSeated == Space.Scene.PlayerAvatar.ID then
thisGameObject.Seat.UnseatPlayer()
thisGameObject.Seat.SitPlayer()
end
end
Space.Log("yielding")
coroutine.yield(5)
end
end
Space.Host.StartCoroutine(AnimationAlternate)
```
##### AnimationMale[β](#animationmale "Direct link to AnimationMale")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **AnimationMale** `get` `set`
*No Description*
* Lua
```lua
Space.Host.ExecutingObject.Seat.AnimationMale = Space.GetResource("ResourceName")
```
##### AnimationFemale[β](#animationfemale "Direct link to AnimationFemale")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **AnimationFemale** `get` `set`
*No Description*
* Lua
```lua
Space.Host.ExecutingObject.Seat.AnimationFemale = Space.GetResource("ResourceName")
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Seat.GameObject
```
---
### SSkinnedMeshRenderer
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| float [**GetBlendShapeWeight** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#getblendshapeweight)(int index) |
| void [**SetBlendShapeWeight** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#setblendshapeweight)(int index, float value) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------------------------- |
| SResource [**Mesh** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#mesh)`get` `set` |
| bool [**IsVisible** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#isvisible)`get` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#enabled)`get` `set` |
| SMaterial [**Material** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#material)`get` `set` |
| SMaterial [**SharedMaterial** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#sharedmaterial)`get` `set` |
| SMaterial\[] [**Materials** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#materials)`get` `set` |
| SMaterial\[] [**SharedMaterials** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#sharedmaterials)`get` `set` |
| SVector [**BoundsMax** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#boundsmax)`get` |
| SVector [**BoundsMin** ](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md#boundsmin)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetBlendShapeWeight[β](#getblendshapeweight "Direct link to GetBlendShapeWeight")
float **GetBlendShapeWeight** (int index)
*Return the value of BlendShapeWeight.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.GetBlendShapeWeight(0)
```
##### SetBlendShapeWeight[β](#setblendshapeweight "Direct link to SetBlendShapeWeight")
void **SetBlendShapeWeight** (int index, float value)
*Set the value to the BlendShapeWeight.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.SetBlendShapeWeight(0)
```
#### Properties[β](#properties "Direct link to Properties")
##### Mesh[β](#mesh "Direct link to Mesh")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Mesh** `get` `set`
*Return the mesh.*
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.Mesh = Space.GetResource("resourceName")
```
##### IsVisible[β](#isvisible "Direct link to IsVisible")
bool **IsVisible** `get`
*Property Description*
* Lua
```lua
isVisible = Space.Host.ExecutingObject.SkinnedMeshRenderer.IsVisible
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*To check if the SkinnedMeshRenderer component is Enabled or not.*
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable an object's SkinnedMeshRenderer component
--[Add "skinnedmeshrenderer" reference to scripting runtime component]
thisGameObject = Space.Host.ExecutingObject
skinnedmeshrenderer = Space.Host.GetReference("skinnedmeshrenderer").SkinnedMeshRenderer
OnClick = function()
skinnedmeshrenderer.Enabled = not skinnedmeshrenderer.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Material[β](#material "Direct link to Material")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **Material** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.Material = Space.GetResource("ResourceName").AsMaterial
```
##### SharedMaterial[β](#sharedmaterial "Direct link to SharedMaterial")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **SharedMaterial** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.SharedMaterial = Space.GetResource("ResourceName").AsMaterial
```
##### Materials[β](#materials "Direct link to Materials")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md)\[] **Materials** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.Materials = {Space.GetResource("1stResourceName").AsMaterial, Space.GetResource("2ndResourceName").AsMaterial}
```
##### SharedMaterials[β](#sharedmaterials "Direct link to SharedMaterials")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md)\[] **SharedMaterials** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.SkinnedMeshRenderer.SharedMaterials = {Space.GetResource("1stResourceName").AsMaterial, Space.GetResource("2ndResourceName").AsMaterial}
```
##### BoundsMax[β](#boundsmax "Direct link to BoundsMax")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **BoundsMax** `get`
*Property Description*
* Lua
```lua
vectorBoundsMax = Space.Host.ExecutingObject.SkinnedMeshRenderer.BoundsMax
```
##### BoundsMin[β](#boundsmin "Direct link to BoundsMin")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **BoundsMin** `get`
*Property Description*
* Lua
```lua
vectorBoundsMin = Space.Host.ExecutingObject.SkinnedMeshRenderer.BoundsMin
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.SkinnedMeshRenderer.GameObject
```
---
### SSphereCollider
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------- |
| SVector [**Center** ](/scripting/client-scripting-api-reference/components/sspherecollider.md#center)`get` `set` |
| float [**Radius** ](/scripting/client-scripting-api-reference/components/sspherecollider.md#radius)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sspherecollider.md#enabled)`get` `set` |
| bool [**IsTrigger** ](/scripting/client-scripting-api-reference/components/sspherecollider.md#istrigger)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sspherecollider.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Center[β](#center "Direct link to Center")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Center** `get` `set`
*The center of the sphere in the object's local space.*
* Lua
```lua
Center = Space.Host.ExecutingObject.SphereCollider.Center
```
* Lua
```lua
--clicking this object moves it's Sphere Collider's center one unit upwards
thisObject = Space.Host.ExecutingObject
OnClick = function()
center = thisObject.SphereCollider.Center
thisObject.SphereCollider.Center = Vector.New(center.X,center.Y + 1, center.Z)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Radius[β](#radius "Direct link to Radius")
float **Radius** `get` `set`
*The radius of the sphere measured in the object's local space.*
* Lua
```lua
Space.Host.ExecutingObject.SphereCollider.Radius = 2
```
* Lua
```lua
--clicking this object increments it's Sphere Collider's radius by one unit
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.SphereCollider.Radius = thisObject.SphereCollider.Radius + 1
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Enabled Colliders will collide with other Colliders, disabled Colliders won't.*
* Lua
```lua
Space.Host.ExecutingObject.SphereCollider.Enabled = false
```
* Lua
```lua
--clicking this object toggles it's Sphere Collider On/Off
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.SphereCollider.Enabled = not thisObject.SphereCollider.Enabled
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### IsTrigger[β](#istrigger "Direct link to IsTrigger")
bool **IsTrigger** `get` `set`
*Is the collider a trigger?*
* Lua
```lua
Space.Host.ExecutingObject.SphereCollider.Enabled = true
```
* Lua
```lua
--clicking this object toggles it's Sphere Collider between being a Collider vs Trigger Collider
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.SphereCollider.IsTrigger = not thisObject.SphereCollider.IsTrigger
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.SphereCollider.GameObject
```
---
### SStateMachine
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------- |
| void [**NextState** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#nextstate)() |
| void [**PrevState** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#prevstate)() |
| void [**SetState** ](sstatemachine#setstate)(int state) void [**SetState** ](sstatemachine#setstate)(string state) |
| void [**BindToUI** ](sstatemachine#bindtoui)() void [**BindToUI** ](sstatemachine#bindtoui)(SGameObject go) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#enabled)`get` `set` |
| int [**StateCount** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#statecount)`get` |
| string\[] [**StateNames** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#statenames)`get` |
| int [**CurrentState** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#currentstate)`get` |
| string [**CurrentStateName** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#currentstatename)`get` |
| string [**ComponentName**](/scripting/client-scripting-api-reference/components/sstatemachine.md#componentname) `get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sstatemachine.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### NextState[β](#nextstate "Direct link to NextState")
void **NextState** ()
*Enter the next state*
* Lua
```lua
Space.Host.ExecutingObject.StateMachine.NextState()
```
##### PrevState[β](#prevstate "Direct link to PrevState")
void **PrevState** ()
* Lua
```lua
Space.Host.ExecutingObject.StateMachine.PrevState()
```
##### SetState[β](#setstate "Direct link to SetState")
void **SetState** (int state) void **SetState** (string state)
*Enters the state of being set that its order is "state"*
| Parameter | Type | Description |
| --------- | ------ | ------------------------------------------------------------ |
| state | int | The index of the state. First state is 1. |
| state | string | The name of the state as set in the State Machine component. |
* Lua
```lua
Space.Host.ExecutingObject.StateMachine.SetState(2)
--or
Space.Host.ExecutingObject.StateMachine.SetState('A State Name')
```
##### BindToUI[β](#bindtoui "Direct link to BindToUI")
void **BindToUI** () void **BindToUI** ([SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) go)
*The state machine will bind itself to all Toggles, Buttons, Dropdowns and Sliders on the SGameObject it is in or on a specified SGameObject.*
*Binding to Button : Clicking button will call NextState()* *Binding to Toggle: Toggle On sets State to 1, Toggle Off sets state to 2* *Binding to Dropdown: Selecting will set State to that selection's caption text* *Binding to Slider: Moving slider changes State to slider value*
| Parameter | Type | Description |
| --------- | ----------- | ------------------------------------------------------------- |
| go | SGameObject | A specific SGameObject which this State Machine will bind to. |
* Lua
```lua
Space.Host.ExecutingObject.StateMachine.BindToUI()
----or
Space.Host.ExecutingObject.StateMachine.BindToUI(Space.Host.GetReference("a reference"))
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the simple state machine component is Enabled or not*
* Lua
```lua
Space.Host.ExecutingObject.StateMachine.Enabled = false
```
##### StateCount[β](#statecount "Direct link to StateCount")
int **StateCount** `get`
*Total number of States.*
* Lua
```lua
numberOfStates = Space.Host.ExecutingObject.StateMachine.StateCount
```
##### StateNames[β](#statenames "Direct link to StateNames")
string\[] **StateNames** `get`
*A list of the names of all States.*
* Lua
```lua
tableStateNames = Space.Host.ExecutingObject.StateMachine.StateNames
```
##### CurrentState[β](#currentstate "Direct link to CurrentState")
int **CurrentState** `get`
*The index number of the current state.*
* Lua
```lua
currentState = Space.Host.ExecutingObject.StateMachine.CurrentState
```
##### CurrentStateName[β](#currentstatename "Direct link to CurrentStateName")
string **CurrentStateName** `get`
*The name of the current state, or null if no state.*
* Lua
```lua
currentStateName = Space.Host.ExecutingObject.StateMachine.CurrentStateName
```
##### ComponentName[β](#componentname "Direct link to ComponentName")
string **ComponentName** `get`
*The name of this component.*
* Lua
```lua
componentName = Space.Host.ExecutingObject.StateMachine.ComponentName
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*The GameObject this component is attached to. A component is always attached to a GameObject.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.StateMachine.GameObject
```
---
### STerrain
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name | Description |
| -------------------------------------------------------------------- | ------------------------------------------------------------- |
| float [**GetHeight** ](sterrain#getheight)(float x, float y) | Get an interpolated height at a point x,y. |
| float [**GetSteepness** ](sterrain#getsteepness)(float x, float y) | Get the gradient of the terrain at point (x,y). |
| float\[,] [**GetHeights** ](sterrain#getheights)() | Get an array of heightmap samples. |
| void [**SetHeights** ](sterrain#setheights)(float\[,] data) | Set the resolution of the detail map. |
| void [**SetHeight** ](sterrain#setheight)(int x, int y, float value) | Set value to height of \[x,y] |
| SVector [**GetNormal** ](sterrain#getnormal)(float x, float y) | Get an interpolated normal at a given location. |
| SVector [**GetSlope** ](sterrain#getslope)(float x, float y) | Get a normalized and interpolated normal at a given location. |
| SVector [**GetContour** ](sterrain#getcontour)(float x, float y) | Get a contour of interpolated normal at a given location. |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/sterrain.md#enabled)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/sterrain.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetHeight[β](#getheight "Direct link to GetHeight")
float **GetHeight** (float x, float y)
*Get an interpolated height at a point x,y.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
floatHeight = Space.Host.ExecutingObject.Terrain.GetHeight(1,1)
```
##### GetSteepness[β](#getsteepness "Direct link to GetSteepness")
float **GetSteepness** (float x, float y)
*Get the gradient of the terrain at point (x,y).*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
floatSteepness = Space.Host.ExecutingObject.Terrain.GetSteepness(1,1)
```
##### GetHeights[β](#getheights "Direct link to GetHeights")
float\[,] **GetHeights** ()
*Returns a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The array has the dimensions \[height,width] and is indexed as \[y,x].*
* Lua
```lua
tableHeights = Space.Host.ExecutingObject.Terrain.GetHeights()
```
##### SetHeights[β](#setheights "Direct link to SetHeights")
void **SetHeights** (float\[,] data)
*Sets heightmap data using a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The heights array is indexed as \[y,x].*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableHeights = Space.Host.ExecutingObject.Terrain.SetHeights({{1,2},{1,2}})
```
##### SetHeight[β](#setheight "Direct link to SetHeight")
void **SetHeight** (int x, int y, float value)
*Set value to height of \[x,y]*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Terrain.SetHeight(1,1,0.11)
```
##### GetNormal[β](#getnormal "Direct link to GetNormal")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetNormal** (float x, float y)
*Get an interpolated normal at a given location.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
vectorNormal = Space.Host.ExecutingObject.Terrain.GetNormal(1,1)
```
##### GetSlope[β](#getslope "Direct link to GetSlope")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetSlope** (float x, float y)
*Get a normalized and interpolated normal at a given location.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
vectorSlope = Space.Host.ExecutingObject.Terrain.GetSlope(1,1)
```
##### GetContour[β](#getcontour "Direct link to GetContour")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetContour** (float x, float y)
*Get a contour of interpolated normal at a given location.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
vectorContour = Space.Host.ExecutingObject.Terrain.GetContour(1,1)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is the Terrain component enabled?*
* Lua
```lua
Space.Host.ExecutingObject.Terrain.Enabled = false
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*The GameObject that this Terrain component is added to.*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.Terrain.GameObject
```
---
### STrailRenderer
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------- |
| void [**Clear** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#clear)() |
| SVector [**GetPosition** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#getposition)(int index) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#enabled)`get` `set` |
| bool [**ReceiveShadows** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#receiveshadows)`get` `set` |
| bool [**IsVisible** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#isvisible)`get` |
| bool [**CastShadows** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#castshadows)`get` `set` |
| bool [**MotionVectors** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#motionvectors)`get` `set` |
| bool [**UseLightProbes** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#uselightprobes)`get` `set` |
| float [**Time** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#time)`get` `set` |
| float [**StartWidth** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#startwidth)`get` `set` |
| float [**EndWidth** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#endwidth)`get` `set` |
| float [**WidthMultiplier** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#widthmultiplier)`get` `set` |
| SColor [**StartColor** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#startcolor)`get` `set` |
| SColor [**EndColor** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#endcolor)`get` `set` |
| bool [**Autodestruct** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#autodestruct)`get` `set` |
| int [**NumCornerVertices** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#numcornervertices)`get` `set` |
| int [**NumCapVertices** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#numcapvertices)`get` `set` |
| float [**MinVertexDistance** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#minvertexdistance)`get` `set` |
| int [**TextureMode** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#texturemode)`get` `set` |
| int [**Alignment** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#alignment)`get` `set` |
| int [**PositionCount** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#positioncount)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/strailrenderer.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Clear[β](#clear "Direct link to Clear")
void **Clear** ()
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.Clear()
```
##### GetPosition[β](#getposition "Direct link to GetPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GetPosition** (int index)
*Get the position of a vertex in the trail.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
vectorPos = Space.Host.ExecutingObject.TrailRenderer.GetPosition(0)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether this TrailRenderer component is Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.Enabled = true
```
* Lua
```lua
--Clicking the object Enables/Disables the Trail Renderer component on this object
--[Add "trailrenderer" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OnClick = function()
trailrenderer.Enabled = not trailrenderer.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### ReceiveShadows[β](#receiveshadows "Direct link to ReceiveShadows")
bool **ReceiveShadows** `get` `set`
*Does this object receive shadows?*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.ReceiveShadows = true
```
* Lua
```lua
--Make a UIToggle disable/enable the Receive Shadows feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
toggle.IsOn = trailrenderer.ReceiveShadows --make toggle start at correct state
OVC = function()
if toggle.IsOn then
trailrenderer.ReceiveShadows = true
else
trailrenderer.ReceiveShadows = false
end
end
toggle.OnValueChanged(OVC)
```
##### IsVisible[β](#isvisible "Direct link to IsVisible")
bool **IsVisible** `get`
*Is this renderer visible in any camera?*
* Lua
```lua
Space.Log(Space.Host.ExecutingObject.TrailRenderer.IsVisible)
```
##### CastShadows[β](#castshadows "Direct link to CastShadows")
bool **CastShadows** `get` `set`
*Does the trail cast a shadow when a shadow-casting Light shines on it?*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.CastShadows = true
```
* Lua
```lua
--Make a UIToggle disable/enable the Cast Shadows feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
toggle.IsOn = trailrenderer.CastShadows --make toggle start at correct state
OVC = function()
if toggle.IsOn then
trailrenderer.CastShadows = true
else
trailrenderer.CastShadows = false
end
end
toggle.OnValueChanged(OVC)
```
##### MotionVectors[β](#motionvectors "Direct link to MotionVectors")
bool **MotionVectors** `get` `set`
*Set whether to use motion vectors to track this Rendererβs per-pixel, screen-space motion from one frame to the next. You can use this information to apply post-processing effects such as motion blur.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.MotionVectors = true
```
* Lua
```lua
--Make a UIToggle disable/enable the Motion Vectors feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
toggle.IsOn = trailrenderer.MotionVectors --make toggle start at correct state
OVC = function()
if toggle.IsOn then
trailrenderer.MotionVectors = true
else
trailrenderer.MotionVectors = false
end
end
toggle.OnValueChanged(OVC)
```
##### UseLightProbes[β](#uselightprobes "Direct link to UseLightProbes")
bool **UseLightProbes** `get` `set`
*Enable Light Probes on the trail.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.UseLightProbes = true
```
* Lua
```lua
--Make a UIToggle disable/enable the Light Probes feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
toggle.IsOn = trailrenderer.UseLightProbes --make toggle start at correct state
OVC = function()
if toggle.IsOn then
trailrenderer.UseLightProbes = true
else
trailrenderer.UseLightProbes = false
end
end
toggle.OnValueChanged(OVC)
```
##### Time[β](#time "Direct link to Time")
float **Time** `get` `set`
*How long does the trail take to fade out. (seconds)*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.Time = 10
```
* Lua
```lua
--Make a slider change the Trail Renderer's Time
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.Time = slider.Value * 10 --0 to 10
end
slider.OnValueChanged(OVC)
```
##### StartWidth[β](#startwidth "Direct link to StartWidth")
float **StartWidth** `get` `set`
*The width of the trail at the spawning point. A width of 1 corresponds to 1 unit in the game world.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.StartWidth = 1.1
```
* Lua
```lua
--Make a slider change the Trail Renderer's Start Width
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.StartWidth = slider.Value * 10 --0 to 10
end
slider.OnValueChanged(OVC)
```
##### EndWidth[β](#endwidth "Direct link to EndWidth")
float **EndWidth** `get` `set`
*The width of the trail at the end of the trail. A width of 1 corresponds to 1 unit in the game world.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.EndWidth = 0.1
```
* Lua
```lua
--Make a slider change the Trail Renderer's End Width
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.EndWidth = slider.Value * 10 --0 to 10
end
slider.OnValueChanged(OVC)
```
##### WidthMultiplier[β](#widthmultiplier "Direct link to WidthMultiplier")
float **WidthMultiplier** `get` `set`
*Set an overall multiplier that is applied to the TrailRenderer.widthCurve to get the final width of the trail.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.WidthMultiplier = 2
```
* Lua
```lua
--Make a slider change the Trail Renderer's Width Multiplier
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.WidthMultiplier = slider.Value * 10 --0 to 10
end
slider.OnValueChanged(OVC)
```
##### StartColor[β](#startcolor "Direct link to StartColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **StartColor** `get` `set`
*Set the color at the start of the trail.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.StartColor = Color.Black
```
* Lua
```lua
--makes UIButton open a color picker to change TrailRenderer's Start Color
--[Add "button" and "trailrenderer" references to the Scripting Runtime component]
button = Space.Host.GetReference("button").UIButton
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
originalColor = trailrenderer.StartColor
OnChange = function(SColor)
trailrenderer.StartColor = SColor
end
OnSelect = function(SColor)
trailrenderer.StartColor = SColor
end
OnCancel = function()
trailrenderer.StartColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
button.OnClick(OnClick)
```
##### EndColor[β](#endcolor "Direct link to EndColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **EndColor** `get` `set`
*Set the color at the end of the trail.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.EndColor = Color.Red
```
* Lua
```lua
--makes UIButton open a color picker to change TrailRenderer's End Color
--[Add "button" and "trailrenderer" references to the Scripting Runtime component]
button = Space.Host.GetReference("button").UIButton
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
originalColor = trailrenderer.EndColor
OnChange = function(SColor)
trailrenderer.EndColor = SColor
end
OnSelect = function(SColor)
trailrenderer.EndColor = SColor
end
OnCancel = function()
trailrenderer.EndColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
button.OnClick(OnClick)
```
##### Autodestruct[β](#autodestruct "Direct link to Autodestruct")
bool **Autodestruct** `get` `set`
*Does the GameObject of this Trail Renderer auto destruct?*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.Autodestruct = true
```
* Lua
```lua
--Make a UIToggle disable/enable the Autodestruct feature of a Trail Renderer
--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
toggle.IsOn = trailrenderer.Autodestruct --make toggle start at correct state
OVC = function()
if toggle.IsOn then
trailrenderer.Autodestruct = true
else
trailrenderer.Autodestruct = false
end
end
toggle.OnValueChanged(OVC)
```
##### NumCornerVertices[β](#numcornervertices "Direct link to NumCornerVertices")
int **NumCornerVertices** `get` `set`
*Set this to a value greater than 0, to get rounded corners between each segment of the trail.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.NumCornerVertices = 2
```
* Lua
```lua
--Make a slider change the Trail Renderer's Number of Corner Vertices
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.NumCornerVertices = slider.Value * 90 --0 to 90
end
slider.OnValueChanged(OVC)
```
##### NumCapVertices[β](#numcapvertices "Direct link to NumCapVertices")
int **NumCapVertices** `get` `set`
*Set this to a value greater than 0, to get rounded corners on each end of the trail.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.NumCapVertices = 3
```
* Lua
```lua
--Make a slider change the Trail Renderer's Number of End Cap Vertices
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.NumCapVertices = slider.Value * 90 --0 to 90
end
slider.OnValueChanged(OVC)
```
##### MinVertexDistance[β](#minvertexdistance "Direct link to MinVertexDistance")
float **MinVertexDistance** `get` `set`
*Set the minimum distance the trail can travel before a new vertex is added to it. Smaller values with give smoother trails, consisting of more vertices, but costing more performance.*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.MinVertexDistance = 1
```
* Lua
```lua
--Make a slider change the Trail Renderer's Number of Mininum Vertex Distance
--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OVC = function()
trailrenderer.MinVertexDistance = slider.Value * 10 --0 to 10
end
slider.OnValueChanged(OVC)
```
##### TextureMode[β](#texturemode "Direct link to TextureMode")
int **TextureMode** `get` `set`
*Choose whether the U coordinate of the trail texture is tiled or stretched. 0 Stretch, 1 Tile, 2 Distribute Per Segment, 3 Repeat Per Segment*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.TextureMode = 2
```
* Lua
```lua
--Clicking the object toggles between TrailRenderer's 4 different Texture Modes
--[Add "trailrenderer" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OnClick = function()
if trailrenderer.TextureMode == 3 then
trailrenderer.TextureMode = 0
else
trailrenderer.TextureMode = trailrenderer.TextureMode + 1
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Alignment[β](#alignment "Direct link to Alignment")
int **Alignment** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.TrailRenderer.Alignment = 1
```
* Lua
```lua
--Clicking the object toggles between TrailRenderer's View or Transform Z alignment
--[Add "trailrenderer" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderer
OnClick = function()
if trailrenderer.Alignment == 0 then
trailrenderer.Alignment = 1
else
trailrenderer.Alignment = 0
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### PositionCount[β](#positioncount "Direct link to PositionCount")
int **PositionCount** `get`
*Get the number of line segments in the trail.*
* Lua
```lua
numLineSegments = Space.Host.ExecutingObject.TrailRenderer.PositionCount
```
##### GameObject[β](#gameobject "Direct link to GameObject")
SGameObject **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.TrailRenderer.GameObject
```
---
### SUIButton
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------- |
| void [**OnClick** ](/scripting/client-scripting-api-reference/components/suibutton.md#onclick)(Closure callback) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suibutton.md#enabled)`get` `set` |
| bool [**Interactable** ](/scripting/client-scripting-api-reference/components/suibutton.md#interactable)`get` `set` |
| SColor [**NormalColor** ](/scripting/client-scripting-api-reference/components/suibutton.md#normalcolor)`get` `set` |
| SColor [**HighlightedColor** ](/scripting/client-scripting-api-reference/components/suibutton.md#highlightedcolor)`get` `set` |
| SColor [**PressedColor** ](/scripting/client-scripting-api-reference/components/suibutton.md#pressedcolor)`get` `set` |
| SColor [**DisabledColor** ](/scripting/client-scripting-api-reference/components/suibutton.md#disabledcolor)`get` `set` |
| float [**ColorMultiplier** ](/scripting/client-scripting-api-reference/components/suibutton.md#colormultiplier)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suibutton.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### OnClick[β](#onclick "Direct link to OnClick")
void **OnClick** (Closure callback)
*Invoke when a user clicks the button and releases it.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OnClickFunction()
--
end
Space.Host.ExecutingObject.UIButton.OnClick(OnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the button component is Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.Enabled = true
```
* Lua
```lua
--clicking this object will toggle Enable/Disable an object's Button component
thisGameObject = Space.Host.ExecutingObject
button = Space.Host.GetReference("button").UIButton
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
button.Enabled = not button.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Interactable[β](#interactable "Direct link to Interactable")
bool **Interactable** `get` `set`
*Enable Interactable if you want this button to accept input.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.Interactable = true
```
* Lua
```lua
--clicking this object will toggle Interactable status on an object's Button component
thisGameObject = Space.Host.ExecutingObject
button = Space.Host.GetReference("button").UIButton
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
button.Interactable= not button.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### NormalColor[β](#normalcolor "Direct link to NormalColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **NormalColor** `get` `set`
*The normal color of the control.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.NormalColor = Color.Red
```
##### HighlightedColor[β](#highlightedcolor "Direct link to HighlightedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **HighlightedColor** `get` `set`
*The color of the control when it is highlighted.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.NormalColor = Color.Red
```
##### PressedColor[β](#pressedcolor "Direct link to PressedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **PressedColor** `get` `set`
*The color of the control when it is pressed.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.PressedColor = Color.Red
```
##### DisabledColor[β](#disabledcolor "Direct link to DisabledColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **DisabledColor** `get` `set`
*The color of the control when it is disabled.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.PressedColor = Color.Red
```
##### ColorMultiplier[β](#colormultiplier "Direct link to ColorMultiplier")
float **ColorMultiplier** `get` `set`
*This multiplies the tint color for each transition by its value. With this you can create colors greater than 1 to brighten the colors on graphic elements whose base color is less than white.*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.ColorMultiplier = Color.Red
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIButton.GameObject = Color.Red
```
---
### SUICanvas
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**IsRootCanvas** ](/scripting/client-scripting-api-reference/components/suicanvas.md#isrootcanvas)`get` |
| float [**ScaleFactor** ](/scripting/client-scripting-api-reference/components/suicanvas.md#scalefactor)`get` `set` |
| float [**ReferencePixelsPerUnit** ](/scripting/client-scripting-api-reference/components/suicanvas.md#referencepixelsperunit)`get` `set` |
| bool [**PixelPerfect** ](/scripting/client-scripting-api-reference/components/suicanvas.md#pixelperfect)`get` `set` |
| float [**PlaneDistance** ](/scripting/client-scripting-api-reference/components/suicanvas.md#planedistance)`get` `set` |
| int [**SortingOrder** ](/scripting/client-scripting-api-reference/components/suicanvas.md#sortingorder)`get` `set` |
| int [**TargetDisplay** ](/scripting/client-scripting-api-reference/components/suicanvas.md#targetdisplay)`get` `set` |
| float [**NormalizedSortingGridSize** ](/scripting/client-scripting-api-reference/components/suicanvas.md#normalizedsortinggridsize)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suicanvas.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### IsRootCanvas[β](#isrootcanvas "Direct link to IsRootCanvas")
bool **IsRootCanvas** `get`
*The avoidance radius for the agent.*
* Lua
```lua
IsRootCanvas = Space.Host.ExecutingObject.UICanvas.IsRootCanvas
```
##### ScaleFactor[β](#scalefactor "Direct link to ScaleFactor")
float **ScaleFactor** `get` `set`
*Scales all UI elements in the Canvas by this factor.*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.ScaleFactor = 2.0
```
##### ReferencePixelsPerUnit[β](#referencepixelsperunit "Direct link to ReferencePixelsPerUnit")
float **ReferencePixelsPerUnit** `get` `set`
*If a sprite has this "Pixels Per Unit" setting, then one pixel in the sprite will cover one unit in the UI.*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.ReferencePixelsPerUnit = 50.0
```
##### PixelPerfect[β](#pixelperfect "Direct link to PixelPerfect")
bool **PixelPerfect** `get` `set`
*Should the UI be rendered without antialiasing for precision?*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.PixelPerfect = true
```
##### PlaneDistance[β](#planedistance "Direct link to PlaneDistance")
float **PlaneDistance** `get` `set`
*The distance at which the UI plane should be placed in front of the camera.*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.PlaneDistance = 2.0
```
##### SortingOrder[β](#sortingorder "Direct link to SortingOrder")
int **SortingOrder** `get` `set`
*Canvas' order within a sorting layer.*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.SortingOrder = 2.0
```
##### TargetDisplay[β](#targetdisplay "Direct link to TargetDisplay")
int **TargetDisplay** `get` `set`
*For Overlay mode, display index on which the UI canvas will appear.*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.TargetDisplay = 1
```
##### NormalizedSortingGridSize[β](#normalizedsortinggridsize "Direct link to NormalizedSortingGridSize")
float **NormalizedSortingGridSize** `get` `set`
*The normalized grid size that the canvas will split the renderable area into.*
* Lua
```lua
Space.Host.ExecutingObject.UICanvas.NormalizedSortingGridSize = 5.0
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UICanvas.GameObject
```
---
### SUIDropdown
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**RefreshShownValue** ](/scripting/client-scripting-api-reference/components/suidropdown.md#refreshshownvalue)() |
| void [**AddOptions** ](suidropdown#addoptions)(string\[] options) void [**AddOptions** ](suidropdown#addoptions)(Table options) void [**AddOptions** ](suidropdown#addoptions)(SResource\[] optionsSprites) |
| void [**ClearOptions** ](/scripting/client-scripting-api-reference/components/suidropdown.md#clearoptions)() |
| void [**Show** ](/scripting/client-scripting-api-reference/components/suidropdown.md#show)() |
| void [**Hide** ](/scripting/client-scripting-api-reference/components/suidropdown.md#hide)() |
| void [**OnValueChanged** ](/scripting/client-scripting-api-reference/components/suidropdown.md#onvaluechanged)(Closure callback) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Interactable** ](/scripting/client-scripting-api-reference/components/suidropdown.md#interactable)`get` `set` |
| SGameObject [**Template** ](/scripting/client-scripting-api-reference/components/suidropdown.md#template)`get` `set` |
| SUIText [**CaptionText** ](/scripting/client-scripting-api-reference/components/suidropdown.md#captiontext)`get` `set` |
| SUIImage [**CaptionImage** ](/scripting/client-scripting-api-reference/components/suidropdown.md#captionimage)`get` `set` |
| SUIText [**ItemText** ](/scripting/client-scripting-api-reference/components/suidropdown.md#itemtext)`get` `set` |
| SUIImage [**ItemImage** ](/scripting/client-scripting-api-reference/components/suidropdown.md#itemimage)`get` `set` |
| string\[] [**OptionsAsText** ](/scripting/client-scripting-api-reference/components/suidropdown.md#optionsastext)`get` |
| SResource\[] [**OptionsAsSprites** ](/scripting/client-scripting-api-reference/components/suidropdown.md#optionsassprites)`get` |
| int [**Value** ](/scripting/client-scripting-api-reference/components/suidropdown.md#value)`get` `set` |
| SColor [**NormalColor** ](/scripting/client-scripting-api-reference/components/suidropdown.md#normalcolor)`get` `set` |
| SColor [**HighlightedColor** ](/scripting/client-scripting-api-reference/components/suidropdown.md#highlightedcolor)`get` `set` |
| SColor [**PressedColor** ](/scripting/client-scripting-api-reference/components/suidropdown.md#pressedcolor)`get` `set` |
| SColor [**DisabledColor** ](/scripting/client-scripting-api-reference/components/suidropdown.md#disabledcolor)`get` `set` |
| float [**ColorMultiplier** ](/scripting/client-scripting-api-reference/components/suidropdown.md#colormultiplier)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suidropdown.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### RefreshShownValue[β](#refreshshownvalue "Direct link to RefreshShownValue")
void **RefreshShownValue** ()
*Refreshes the text and image (if available) of the currently selected option.If you have modified the list of options, you should call this method afterwards to ensure that the visual state of the dropdown corresponds to the updated options.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.RefreshShownValue()
```
##### AddOptions[β](#addoptions "Direct link to AddOptions")
void **AddOptions** (string\[] options) void **AddOptions** (Table options) void **AddOptions** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md)\[] optionsSprites)
*Add multiple options to the options of the Dropdown.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.AddOptions({"option1","option2","option3"})
```
##### ClearOptions[β](#clearoptions "Direct link to ClearOptions")
void **ClearOptions** ()
*Clear the list of options in the Dropdown.*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.ClearOptions()
```
##### Show[β](#show "Direct link to Show")
void **Show** ()
*Show the dropdown list.*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.Show()
```
##### Hide[β](#hide "Direct link to Hide")
void **Hide** ()
*Hide the dropdown list.*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.Hide()
```
##### OnValueChanged[β](#onvaluechanged "Direct link to OnValueChanged")
void **OnValueChanged** (Closure callback)
*Bind a function to handle the event that is invoked when when a user has clicked one of the options in the dropdown list.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function AFunction()
--
end
Space.Host.ExecutingObject.UIDropdown.OnValueChanged(AFunction)
```
##### SetValueByText[β](#setvaluebytext "Direct link to SetValueByText")
bool **SetValueByText** (string text)
*Attempts to set the dropdown to the first option in the dropdown list that matches the inputted text. Returns true if found, false if no matches found.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.SetValueByText("Value Text")
```
* Lua
```lua
--Populating a UIDropdown and making a selection using value's text
dropDown=Space.Host.GetReference("DropDown").UIDropdown
options = {"Room 1", "Room 2", "Room 3", "Room 4"}
dropDown.AddOptions(options)
dropDown.SetValueByText("Room 3")
```
#### Properties[β](#properties "Direct link to Properties")
##### Interactable[β](#interactable "Direct link to Interactable")
bool **Interactable** `get` `set`
*Is this UIDropdown interactable?*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.Interactable = true
```
* Lua
```lua
--clicking this object will toggle a UIDropdown's interactable status
thisGameObject = Space.Host.ExecutingObject
dropdown = Space.Host.GetReference("dropdown").UIDropdown
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
dropdown.Interactable = not dropdown.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Template[β](#template "Direct link to Template")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Template** `get` `set`
*The Rect Transform of the template for the dropdown list.*
* Lua
```lua
aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.Template = aReferenceToAGameObject
```
##### CaptionText[β](#captiontext "Direct link to CaptionText")
[SUIText](/scripting/client-scripting-api-reference/components/suitext.md) **CaptionText** `get` `set`
*The Text component to hold the text of the currently selected option.*
* Lua
```lua
captionText = Space.Host.ExecutingObject.UIDropdown.CaptionText
captionText.Text = "new caption"
```
##### CaptionImage[β](#captionimage "Direct link to CaptionImage")
[SUIImage](/scripting/client-scripting-api-reference/components/suiimage.md) **CaptionImage** `get` `set`
*The Image component to hold the image of the currently selected option.*
* Lua
```lua
aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIImage
```
##### ItemText[β](#itemtext "Direct link to ItemText")
[SUIText](/scripting/client-scripting-api-reference/components/suitext.md) **ItemText** `get` `set`
*The Text component to hold the text of the item.*
* Lua
```lua
aReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIText
```
##### ItemImage[β](#itemimage "Direct link to ItemImage")
[SUIImage](/scripting/client-scripting-api-reference/components/suiimage.md) **ItemImage** `get` `set`
*The Image component to hold the image of the item.*
* Lua
```lua
iaReferenceToAGameObject = Space.Host.GetReference("reference name")
Space.Host.ExecutingObject.UIDropdown.CaptionImage = aReferenceToAGameObject.UIImage
```
##### OptionsAsText[β](#optionsastext "Direct link to OptionsAsText")
string\[] **OptionsAsText** `get`
*The list of possible options. (Text)*
* Lua
```lua
optionsText = Space.Host.ExecutingObject.UIDropdown.OptionsAsText
```
##### OptionsAsSprites[β](#optionsassprites "Direct link to OptionsAsSprites")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md)\[] **OptionsAsSprites** `get`
*The list of possible options. (Sprites)*
* Lua
```lua
optionsSprites = Space.Host.ExecutingObject.UIDropdown.OptionsAsSprites
```
##### Value[β](#value "Direct link to Value")
int **Value** `get` `set`
*The Value is the index number of the current selection in the Dropdown. 0 is the first option in the Dropdown, 1 is the second, and so on.*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.Value= 2
```
##### NormalColor[β](#normalcolor "Direct link to NormalColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **NormalColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.NormalColor = Color.Red
```
##### HighlightedColor[β](#highlightedcolor "Direct link to HighlightedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **HighlightedColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.HighlightedColor = Color.Red
```
##### PressedColor[β](#pressedcolor "Direct link to PressedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **PressedColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.PressedColor = Color.Red
```
##### DisabledColor[β](#disabledcolor "Direct link to DisabledColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **DisabledColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.DisabledColor = Color.Red
```
##### ColorMultiplier[β](#colormultiplier "Direct link to ColorMultiplier")
float **ColorMultiplier** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.ColorMultiplier = Color.Red
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIDropdown.GameObject = Color.Red
```
---
### SUIImage
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------- |
| SColor [**Color** ](/scripting/client-scripting-api-reference/components/suiimage.md#color)`get` `set` |
| SResource [**Sprite** ](/scripting/client-scripting-api-reference/components/suiimage.md#sprite)`get` `set` |
| bool [**PreserveAspect** ](/scripting/client-scripting-api-reference/components/suiimage.md#preserveaspect)`get` `set` |
| bool [**FillCenter** ](/scripting/client-scripting-api-reference/components/suiimage.md#fillcenter)`get` `set` |
| float [**FillAmount** ](/scripting/client-scripting-api-reference/components/suiimage.md#fillamount)`get` `set` |
| bool [**FillClockwise** ](/scripting/client-scripting-api-reference/components/suiimage.md#fillclockwise)`get` `set` |
| int [**FillOrigin** ](/scripting/client-scripting-api-reference/components/suiimage.md#fillorigin)`get` `set` |
| float [**AlphaHitTestMinimumThreshold** ](/scripting/client-scripting-api-reference/components/suiimage.md#alphahittestminimumthreshold)`get` `set` |
| bool [**HasBorder** ](/scripting/client-scripting-api-reference/components/suiimage.md#hasborder)`get` |
| float [**PixelsPerUnit** ](/scripting/client-scripting-api-reference/components/suiimage.md#pixelsperunit)`get` |
| SMaterial [**Material** ](/scripting/client-scripting-api-reference/components/suiimage.md#material)`get` `set` |
| float [**MinWidth** ](/scripting/client-scripting-api-reference/components/suiimage.md#minwidth)`get` |
| float [**PreferredWidth** ](/scripting/client-scripting-api-reference/components/suiimage.md#preferredwidth)`get` |
| float [**FlexibleWidth** ](/scripting/client-scripting-api-reference/components/suiimage.md#flexiblewidth)`get` |
| float [**MinHeight** ](/scripting/client-scripting-api-reference/components/suiimage.md#minheight)`get` |
| float [**PreferredHeight** ](/scripting/client-scripting-api-reference/components/suiimage.md#preferredheight)`get` |
| float [**FlexibleHeight** ](/scripting/client-scripting-api-reference/components/suiimage.md#flexibleheight)`get` |
| int [**LayoutPriority** ](/scripting/client-scripting-api-reference/components/suiimage.md#layoutpriority)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suiimage.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Color[β](#color "Direct link to Color")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Color** `get` `set`
*Default Color of UIImage*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.Color= Color.Red
```
##### Sprite[β](#sprite "Direct link to Sprite")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Sprite** `get` `set`
*The sprite that is used to render this image.*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.Sprite = Space.GetResource("resource name")
```
##### PreserveAspect[β](#preserveaspect "Direct link to PreserveAspect")
bool **PreserveAspect** `get` `set`
*Whether this image should preserve its Sprite aspect ratio.*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.PreserveAspect = true
```
##### FillCenter[β](#fillcenter "Direct link to FillCenter")
bool **FillCenter** `get` `set`
*Whether or not to render the center*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.FillCenter = true
```
##### FillAmount[β](#fillamount "Direct link to FillAmount")
float **FillAmount** `get` `set`
*Amount of the Image shown*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.FillAmount = 0.5
```
##### FillClockwise[β](#fillclockwise "Direct link to FillClockwise")
bool **FillClockwise** `get` `set`
*Whether the Image should be filled clockwise (true) or counter-clockwise (false).*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.FillClockwise = true
```
##### FillOrigin[β](#fillorigin "Direct link to FillOrigin")
int **FillOrigin** `get` `set`
*Controls the origin point of the Fill process.*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.FillOrigin = 0
```
##### AlphaHitTestMinimumThreshold[β](#alphahittestminimumthreshold "Direct link to AlphaHitTestMinimumThreshold")
float **AlphaHitTestMinimumThreshold** `get` `set`
*The alpha threshold specifies the minimum alpha a pixel must have for the event to considered a "hit" on the Image. Alpha values less than the threshold will cause raycast events to pass through the Image. An value of 1 would cause only fully opaque pixels to register raycast events on the Image. The alpha tested is retrieved from the image sprite only, while the alpha of the Image Graphic.color is disregarded.*
*alphaHitTestMinimumThreshold defaults to 0; all raycast events inside the Image rectangle are considered a hit. In order for greater than 0 to values to work, the sprite used by the Image must have readable pixels. This can be achieved by enabling Read/Write enabled in the advanced Texture Import Settings for the sprite and disabling atlassing for the sprite.*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.AlphaHitTestMinimumThreshold = 0
```
##### HasBorder[β](#hasborder "Direct link to HasBorder")
bool **HasBorder** `get`
*True if the sprite used has borders.*
* Lua
```lua
imgHasBorder = Space.Host.ExecutingObject.UIImage.HasBorder
```
##### PixelsPerUnit[β](#pixelsperunit "Direct link to PixelsPerUnit")
float **PixelsPerUnit** `get`
*Provides information about how fonts are scale to the screen.*
*For dynamic fonts, the value is equivalent to the scale factor of the canvas. For non-dynamic fonts, the value is calculated from the requested text size and the size from the font.*
* Lua
```lua
ppUnit = Space.Host.ExecutingObject.UIImage.PixelsPerUnit
```
##### Material[β](#material "Direct link to Material")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **Material** `get` `set`
*The specified Material used by this Image. The default Material is used instead if one wasn't specified.*
* Lua
```lua
Space.Host.ExecutingObject.UIImage.Material = Space.GetResource("resource name").AsMaterial
```
##### MinWidth[β](#minwidth "Direct link to MinWidth")
float **MinWidth** `get`
*The minimum width this UIImage may be allocated. (Used by the Layout system).*
* Lua
```lua
minWidth = Space.Host.ExecutingObject.UIImage.MinWidth
```
##### PreferredWidth[β](#preferredwidth "Direct link to PreferredWidth")
float **PreferredWidth** `get`
*The preferred width this UIImage should be allocated if there is sufficient space. (Used by the Layout system)*
* Lua
```lua
prefWidth = Space.Host.ExecutingObject.UIImage.PreferredWidth
```
##### FlexibleWidth[β](#flexiblewidth "Direct link to FlexibleWidth")
float **FlexibleWidth** `get`
*The extra relative width this UIImage should be allocated if there is additional available space. (Used by the Layout system)*
* Lua
```lua
flexWidth = Space.Host.ExecutingObject.UIImage.FlexibleWidth
```
##### MinHeight[β](#minheight "Direct link to MinHeight")
float **MinHeight** `get`
*The minimum height this UIImage may be allocated.(Used by the Layout system).*
* Lua
```lua
minHeight = Space.Host.ExecutingObject.UIImage.MinHeight
```
##### PreferredHeight[β](#preferredheight "Direct link to PreferredHeight")
float **PreferredHeight** `get`
*The preferred height this UIImage should be allocated if there is sufficient space. (Used by the Layout system)*
* Lua
```lua
prefHeight = Space.Host.ExecutingObject.UIImage.PreferredHeight
```
##### FlexibleHeight[β](#flexibleheight "Direct link to FlexibleHeight")
float **FlexibleHeight** `get`
*The extra relative height this UIImage should be allocated if there is additional available space. (Used by the Layout system)*
* Lua
```lua
flexHeight = Space.Host.ExecutingObject.UIImage.FlexibleHeight
```
##### LayoutPriority[β](#layoutpriority "Direct link to LayoutPriority")
int **LayoutPriority** `get`
*The layout priority of this UIText component.(Used by the Layout system.)*
* Lua
```lua
layoutPrio = Space.Host.ExecutingObject.UIImage.LayoutPriority
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UIImage.GameObject
```
---
### SUIInputField
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| void [**OnValueChanged** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#onvaluechanged)(Closure callback) |
| void [**OnEndEdit** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#onendedit)(Closure callback) |
| void [**ActivateInputField** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#activateinputfield)() |
| void [**DeactivateInputField** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#deactivateinputfield)() |
| void [**Select** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#select)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------------------------- |
| string [**Text** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#text)`get` `set` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#enabled)`get` `set` |
| bool [**Interactable** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#interactable)`get` `set` |
| bool [**IsFocused** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#isfocused)`get` |
| float [**CaretBlinkRate** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#caretblinkrate)`get` `set` |
| int [**CaretWidth** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#caretwidth)`get` `set` |
| int [**CharacterLimit** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#characterlimit)`get` `set` |
| bool [**ReadOnly** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#readonly)`get` `set` |
| bool [**MultiLine** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#multiline)`get` |
| char [**AsteriskChar** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#asteriskchar)`get` `set` |
| int [**CaretPosition** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#caretposition)`get` `set` |
| int [**SelectionAnchorPosition** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#selectionanchorposition)`get` `set` |
| int [**SelectionFocusPosition** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#selectionfocusposition)`get` `set` |
| float [**MinWidth** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#minwidth)`get` |
| float [**PreferredWidth** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#preferredwidth)`get` |
| float [**FlexibleWidth** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#flexiblewidth)`get` |
| float [**MinHeight** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#minheight)`get` |
| float [**PreferredHeight** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#preferredheight)`get` |
| float [**FlexibleHeight** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#flexibleheight)`get` |
| SColor [**NormalColor** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#normalcolor)`get` `set` |
| SColor [**HighlightedColor** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#highlightedcolor)`get` `set` |
| SColor [**PressedColor** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#pressedcolor)`get` `set` |
| SColor [**DisabledColor** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#disabledcolor)`get` `set` |
| float [**ColorMultiplier** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#colormultiplier)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suiinputfield.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### OnValueChanged[β](#onvaluechanged "Direct link to OnValueChanged")
void **OnValueChanged** (Closure callback)
*Given function will be called when text in Input Field has changed*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OVC()
--
end
Space.Host.ExecutingObject.UIInputField.OnValueChanged(OVC)
```
* Lua
```lua
--This script will make an input field update a text field
--with character count in real-time every time a character is typed/removed
--[Text field and Input fields need to be added as references (scripting runtime)]
thisObject = Space.Host.ExecutingObject
inputField = Space.Host.GetReference("The Input Field").UIInputField
textField = Space.Host.GetReference("The Text Field").UIText
OnValueChanged = function()
textField.Text = "Count= " .. string.len(inputField.Text)
end
thisObject.UIInputField.OnValueChanged(OnValueChanged)
```
##### OnEndEdit[β](#onendedit "Direct link to OnEndEdit")
void **OnEndEdit** (Closure callback)
*Given function will be called when editing has ended*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OEE()
--
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(OEE)
```
* Lua
```lua
--This script will make an input field update a text field
--as soon as someone has finished typing in it
--Text field and Input fields need to be added as references (scripting runtime)
thisObject = Space.Host.ExecutingObject
inputField = Space.Host.GetReference("The Input Field").UIInputField
textField = Space.Host.GetReference("The Text Field").UIText
OnEndEdit = function()
textField.Text = inputField.Text
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(OnEndEdit)
```
##### ActivateInputField[β](#activateinputfield "Direct link to ActivateInputField")
void **ActivateInputField** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.ActivateInputField()
```
##### DeactivateInputField[β](#deactivateinputfield "Direct link to DeactivateInputField")
void **DeactivateInputField** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
```
##### Select[β](#select "Direct link to Select")
void **Select** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
```
#### Properties[β](#properties "Direct link to Properties")
##### Text[β](#text "Direct link to Text")
string **Text** `get` `set`
*The current value of the input field.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.Text= "Hello"
```
* Lua
```lua
--the below script makes this object set Browser URL according to what's written in text field
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")
OnClick = function()
webBrowser.Browser.SetURL = urlField.UIInputField.Text
end
urlField.UIInputField.Text = https://www.youtube.com
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to set URL"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether this Input Field component is Enabled*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.Enabled= true
```
* Lua
```lua
--clicking this object will toggle a UIInputField's Enabled status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
inputfield.Enabled = not inputfield.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Interactable[β](#interactable "Direct link to Interactable")
bool **Interactable** `get` `set`
*Is the Input Field interactable?*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.Interactable= true
```
* Lua
```lua
--clicking this object will toggle a UIInputField's interactable status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
inputfield.Interactable = not inputfield.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### IsFocused[β](#isfocused "Direct link to IsFocused")
bool **IsFocused** `get`
*Does the InputField currently have focus and is able to process events.*
* Lua
```lua
hasFocus = Space.Host.ExecutingObject.UIInputField.IsFocused
```
##### CaretBlinkRate[β](#caretblinkrate "Direct link to CaretBlinkRate")
float **CaretBlinkRate** `get` `set`
*The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.CaretBlinkRate= 3
```
##### CaretWidth[β](#caretwidth "Direct link to CaretWidth")
int **CaretWidth** `get` `set`
*The width of the caret in pixels.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.CaretWidth= 4
```
##### CharacterLimit[β](#characterlimit "Direct link to CharacterLimit")
int **CharacterLimit** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8
```
##### ReadOnly[β](#readonly "Direct link to ReadOnly")
bool **ReadOnly** `get` `set`
*Property Description*
* Lua
```lua
Is the InputField read only?
```
* Lua
```lua
--clicking this object will toggle a UIInputField's ReadOnly status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
inputfield.ReadOnly = not inputfield.ReadOnly
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### MultiLine[β](#multiline "Direct link to MultiLine")
bool **MultiLine** `get`
*If the input field supports multiple lines.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.MultiLine = true
```
##### AsteriskChar[β](#asteriskchar "Direct link to AsteriskChar")
char **AsteriskChar** `get` `set`
*The character used for password fields.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.AsteriskChar= "%"
```
##### CaretPosition[β](#caretposition "Direct link to CaretPosition")
int **CaretPosition** `get` `set`
*Current InputField caret position (also selection tail).*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.CaretPosition= 3
```
##### SelectionAnchorPosition[β](#selectionanchorposition "Direct link to SelectionAnchorPosition")
int **SelectionAnchorPosition** `get` `set`
*The beginning point of the selection.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1
```
##### SelectionFocusPosition[β](#selectionfocusposition "Direct link to SelectionFocusPosition")
int **SelectionFocusPosition** `get` `set`
*The end point of the selection.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4
```
##### MinWidth[β](#minwidth "Direct link to MinWidth")
float **MinWidth** `get`
*The minimum width this UIInputField may be allocated. (Used by the Layout system).*
* Lua
```lua
minWidth = Space.Host.ExecutingObject.UIInputField.MinWidth
```
##### PreferredWidth[β](#preferredwidth "Direct link to PreferredWidth")
float **PreferredWidth** `get`
*The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)*
* Lua
```lua
prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth
```
##### FlexibleWidth[β](#flexiblewidth "Direct link to FlexibleWidth")
float **FlexibleWidth** `get`
*The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system)*
* Lua
```lua
flexWidth = Space.Host.ExecutingObject.UIInputField.FlexibleWidth
```
##### MinHeight[β](#minheight "Direct link to MinHeight")
float **MinHeight** `get`
*The minimum height this UIInputField may be allocated.(Used by the Layout system).*
* Lua
```lua
minHeight = Space.Host.ExecutingObject.UIInputField.MinHeight
```
##### PreferredHeight[β](#preferredheight "Direct link to PreferredHeight")
float **PreferredHeight** `get`
*The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)*
* Lua
```lua
prefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeight
```
##### FlexibleHeight[β](#flexibleheight "Direct link to FlexibleHeight")
float **FlexibleHeight** `get`
*The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system)*
* Lua
```lua
flexHeight = Space.Host.ExecutingObject.UIInputField.FlexibleHeight
```
##### NormalColor[β](#normalcolor "Direct link to NormalColor")
SColor **NormalColor** `get` `set`
*The normal color.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.NormalColor = Color.Red
```
##### HighlightedColor[β](#highlightedcolor "Direct link to HighlightedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **HighlightedColor** `get` `set`
*The color of the control when it is highlighted.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.HighlightedColor = Color.Red
```
##### PressedColor[β](#pressedcolor "Direct link to PressedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **PressedColor** `get` `set`
*The color of the control when it is pressed.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.PressedColor = Color.Red
```
##### DisabledColor[β](#disabledcolor "Direct link to DisabledColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **DisabledColor** `get` `set`
*The color of the control when it is disabled.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.DisabledColor = Color.Red
```
##### ColorMultiplier[β](#colormultiplier "Direct link to ColorMultiplier")
float **ColorMultiplier** `get` `set`
*This multiplies the tint color for each transition by its value.*
* Lua
```lua
Space.Host.ExecutingObject.UIInputField.ColorMultiplier = Color.Red
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
\`\`\` theGameObject = Space.Host.ExecutingObject.UIInputField.GameObject \`\`\`
---
### SUILayout
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suilayout.md#enabled)`get` `set` |
| int [**PaddingLeft** ](/scripting/client-scripting-api-reference/components/suilayout.md#paddingleft)`get` `set` |
| int [**PaddingRight** ](/scripting/client-scripting-api-reference/components/suilayout.md#paddingright)`get` `set` |
| int [**PaddingTop** ](/scripting/client-scripting-api-reference/components/suilayout.md#paddingtop)`get` `set` |
| int [**PaddingBottom** ](/scripting/client-scripting-api-reference/components/suilayout.md#paddingbottom)`get` `set` |
| string [**ChildAlignment** ](/scripting/client-scripting-api-reference/components/suilayout.md#childalignment)`get` `set` |
| float [**Spacing** ](/scripting/client-scripting-api-reference/components/suilayout.md#spacing)`get` `set` |
| bool [**ChildControlHeight** ](/scripting/client-scripting-api-reference/components/suilayout.md#childcontrolheight)`get` `set` |
| bool [**ChildControlWidth** ](/scripting/client-scripting-api-reference/components/suilayout.md#childcontrolwidth)`get` `set` |
| bool [**ChildForceExpandHeight** ](/scripting/client-scripting-api-reference/components/suilayout.md#childforceexpandheight)`get` `set` |
| bool [**ChildForceExpandWidth** ](/scripting/client-scripting-api-reference/components/suilayout.md#childforceexpandwidth)`get` `set` |
| SVector [**GridCellSize** ](/scripting/client-scripting-api-reference/components/suilayout.md#gridcellsize)`get` `set` |
| SVector [**GridSpacing** ](/scripting/client-scripting-api-reference/components/suilayout.md#gridspacing)`get` `set` |
| int [**GridConstraintCount** ](/scripting/client-scripting-api-reference/components/suilayout.md#gridconstraintcount)`get` `set` |
| string [**GridConstraint** ](/scripting/client-scripting-api-reference/components/suilayout.md#gridconstraintcount)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suilayout.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is this UI layout component Enabled?*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.Enabled = false
```
* Lua
```lua
--clicking this object will toggle a Layout's Enabled status
thisGameObject = Space.Host.ExecutingObject
layout = Space.Host.GetReference("layout").UILayout
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
layout.Enabled= not layout.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### PaddingLeft[β](#paddingleft "Direct link to PaddingLeft")
int **PaddingLeft** `get` `set`
*Space reserved for the left edge of the padding during the layout phase.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.PaddingLeft= 2
```
##### PaddingRight[β](#paddingright "Direct link to PaddingRight")
int **PaddingRight** `get` `set`
*Space reserved for the right edge of the padding during the layout phase.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.PaddingRight= 2
```
##### PaddingTop[β](#paddingtop "Direct link to PaddingTop")
int **PaddingTop** `get` `set`
*Space reserved for the top edge of the padding during the layout phase.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.PaddingTop= 2
```
##### PaddingBottom[β](#paddingbottom "Direct link to PaddingBottom")
int **PaddingBottom** `get` `set`
*Space reserved for the bottom edge of the padding during the layout phase.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.PaddingBottom= 2
```
##### ChildAlignment[β](#childalignment "Direct link to ChildAlignment")
string **ChildAlignment** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.ChildAlignment = "1"
```
##### Spacing[β](#spacing "Direct link to Spacing")
float **Spacing** `get` `set`
*The spacing to use between layout elements in the layout group.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.Spacing= 2
```
##### ChildControlHeight[β](#childcontrolheight "Direct link to ChildControlHeight")
bool **ChildControlHeight** `get` `set`
*Returns true if the Layout Group controls the heights of its children. Returns false if children control their own heights.*
*If set to false, the layout group will only affect the positions of the children while leaving the heights untouched. The heights of the children can be set via the respective RectTransforms in this case.*
*If set to true, the heights of the children are automatically driven by the layout group according to their respective minimum, preferred, and flexible heights. This is useful if the heights of the children should change depending on how much space is available. In this case the height of each child cannot be set manually in the RectTransform, but the minimum, preferred and flexible height for each child can be controlled by adding a LayoutElement component to it.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.ChildControlHeight= true
```
##### ChildControlWidth[β](#childcontrolwidth "Direct link to ChildControlWidth")
bool **ChildControlWidth** `get` `set`
*Returns true if the Layout Group controls the widths of its children. Returns false if children control their own widths.*
*If set to false, the layout group will only affect the positions of the children while leaving the widths untouched. The widths of the children can be set via the respective RectTransforms in this case.*
*If set to true, the widths of the children are automatically driven by the layout group according to their respective minimum, preferred, and flexible widths. This is useful if the widths of the children should change depending on how much space is available. In this case the width of each child cannot be set manually in the RectTransform, but the minimum, preferred and flexible width for each child can be controlled by adding a LayoutElement component to it.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.ChildControlWidth= false
```
##### ChildForceExpandHeight[β](#childforceexpandheight "Direct link to ChildForceExpandHeight")
bool **ChildForceExpandHeight** `get` `set`
*Whether to force the children to expand to fill additional available vertical space.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.ChildForceExpandHeight= false
```
##### ChildForceExpandWidth[β](#childforceexpandwidth "Direct link to ChildForceExpandWidth")
bool **ChildForceExpandWidth** `get` `set`
*Whether to force the children to expand to fill additional available horizontal space.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.ChildForceExpandWidth= false
```
##### GridCellSize[β](#gridcellsize "Direct link to GridCellSize")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GridCellSize** `get` `set`
*The size to use for each cell in the grid.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.GridCellSize= Vector.New(1,1,0)
```
##### GridSpacing[β](#gridspacing "Direct link to GridSpacing")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **GridSpacing** `get` `set`
*The spacing to use between layout elements in the grid.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.GridSpacing= Vector.New(1,1,0)
```
##### GridConstraintCount[β](#gridconstraintcount "Direct link to GridConstraintCount")
int **GridConstraintCount** `get` `set`
*How many cells there should be along the constrained axis.*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.GridConstraintCount= 2
```
##### GridConstraint[β](#gridconstraint "Direct link to GridConstraint")
string **GridConstraint** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UILayout.GridConstraint = 1
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UILayout.GridConstraint
```
---
### SUIRawImage
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------- |
| bool [**RaycastTarget** ](/scripting/client-scripting-api-reference/components/suirawimage.md#raycasttarget)`get` `set` |
| bool [**Maskable** ](/scripting/client-scripting-api-reference/components/suirawimage.md#maskable)`get` `set` |
| SResource [**Texture** ](/scripting/client-scripting-api-reference/components/suirawimage.md#texture)`get` `set` |
| SColor [**Color** ](/scripting/client-scripting-api-reference/components/suirawimage.md#color)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suirawimage.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### RaycastTarget[β](#raycasttarget "Direct link to RaycastTarget")
bool **RaycastTarget** `get` `set`
*Enable Raycast Target.*
* Lua
```lua
Space.Host.ExecutingObject.UIRawImage.RaycastTarget = true
```
##### Maskable[β](#maskable "Direct link to Maskable")
bool **Maskable** `get` `set`
*To check if the graphic is maskable.*
* Lua
```lua
Space.Host.ExecutingObject.UIRawImage.Maskable = true
```
##### Texture[β](#texture "Direct link to Texture")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Texture** `get` `set`
*The RawImage's texture.*
* Lua
```lua
Space.Host.ExecutingObject.UIRawImage.Texture = Space.GetResource("Resource Name")
```
##### Color[β](#color "Direct link to Color")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Color** `get` `set`
*Base color of the Graphic.*
* Lua
```lua
Space.Host.ExecutingObject.UIRawImage.Color = Color.Red
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UIRawImage.GameObject
```
---
### SUIScrollbar
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------- |
| void [**OnValueChanged** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#onvaluechanged)(Closure callback) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| -------------------------------------------------------------------------------------------------------------------------------- |
| float [**Size** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#size)`get` `set` |
| float [**Value** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#value)`get` `set` |
| int [**NumberOfSteps** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#numberofsteps)`get` `set` |
| SColor [**NormalColor** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#normalcolor)`get` `set` |
| SColor [**HighlightedColor** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#highlightedcolor)`get` `set` |
| SColor [**PressedColor** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#pressedcolor)`get` `set` |
| SColor [**DisabledColor** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#disabledcolor)`get` `set` |
| float [**ColorMultiplier** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#colormultiplier)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suiscrollbar.md#gameobject)`get` |
##### OnValueChanged[β](#onvaluechanged "Direct link to OnValueChanged")
void **OnValueChanged** (Closure callback)
*Handling for when the scrollbar value is changed.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OCV()
--
end
Space.Host.ExecutingObject.UIScrollbar.OnValueChanged(OCV)
```
#### Properties[β](#properties "Direct link to Properties")
##### Size[β](#size "Direct link to Size")
float **Size** `get` `set`
*The size of the scrollbar handle where 1 means it fills the entire scrollbar.*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.Size = 0.1
```
##### Value[β](#value "Direct link to Value")
float **Value** `get` `set`
*The current value of the scrollbar, between 0 and 1.*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.Value = 0.5
```
##### NumberOfSteps[β](#numberofsteps "Direct link to NumberOfSteps")
int **NumberOfSteps** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.NumberOfSteps = 2
```
##### NormalColor[β](#normalcolor "Direct link to NormalColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **NormalColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.NormalColor = Color.Red
```
##### HighlightedColor[β](#highlightedcolor "Direct link to HighlightedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **HighlightedColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.HighlightedColor = Color.Red
```
##### PressedColor[β](#pressedcolor "Direct link to PressedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **PressedColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.PressedColor = Color.Red
```
##### DisabledColor[β](#disabledcolor "Direct link to DisabledColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **DisabledColor** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.DisabledColor = Color.Red
```
##### ColorMultiplier[β](#colormultiplier "Direct link to ColorMultiplier")
float **ColorMultiplier** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.UIScrollbar.ColorMultiplier = Color.Red
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UIScrollbar.GameObject
```
---
### SUISlider
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| void [**OnValueChanged** ](/scripting/client-scripting-api-reference/components/suislider.md#onvaluechanged)(Closure callback) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suislider.md#enabled)`get` `set` |
| bool [**Interactable** ](/scripting/client-scripting-api-reference/components/suislider.md#interactable)`get` `set` |
| int [**Direction** ](/scripting/client-scripting-api-reference/components/suislider.md#direction)`get` `set` |
| float [**MinValue** ](/scripting/client-scripting-api-reference/components/suislider.md#minvalue)`get` `set` |
| float [**MaxValue** ](/scripting/client-scripting-api-reference/components/suislider.md#maxvalue)`get` `set` |
| bool [**WholeNumbers** ](/scripting/client-scripting-api-reference/components/suislider.md#wholenumbers)`get` `set` |
| float [**Value** ](/scripting/client-scripting-api-reference/components/suislider.md#value)`get` `set` |
| float [**NormalizedValue** ](/scripting/client-scripting-api-reference/components/suislider.md#normalizedvalue)`get` `set` |
| SColor [**NormalColor** ](/scripting/client-scripting-api-reference/components/suislider.md#normalcolor)`get` `set` |
| SColor [**HighlightedColor** ](/scripting/client-scripting-api-reference/components/suislider.md#highlightedcolor)`get` `set` |
| SColor [**PressedColor** ](/scripting/client-scripting-api-reference/components/suislider.md#pressedcolor)`get` `set` |
| SColor [**DisabledColor** ](/scripting/client-scripting-api-reference/components/suislider.md#disabledcolor)`get` `set` |
| float [**ColorMultiplier** ](/scripting/client-scripting-api-reference/components/suislider.md#colormultiplier)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suislider.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### OnValueChanged[β](#onvaluechanged "Direct link to OnValueChanged")
void **OnValueChanged** (Closure callback)
*Callback executed when the value of the slider is changed.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function ValueChanged()
--
end
Space.Host.ExecutingObject.UISlider.OnValueChanged(ValueChanged)
```
* Lua
```lua
--This script will make moving a slider control the Master Volume
--and also update a text field with the current Master Volume
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.MasterVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MasterVolume
end
slider.OnValueChanged(OnValueChanged)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether this Slider component is Enabled or not*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.Enabled = false
```
* Lua
```lua
--clicking this object will toggle a Sliders's Enabled status
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
slider.Enabled = not slider.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Interactable[β](#interactable "Direct link to Interactable")
bool **Interactable** `get` `set`
*Use to enable or disable the ability to interact with the slider.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.Interactable = true
```
* Lua
```lua
--clicking this object will toggle a Sliders's Interactable status
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
slider.Interactable = not slider.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Direction[β](#direction "Direct link to Direction")
int **Direction** `get` `set`
*The direction of the slider (0 to 4). 0 Left To Right, 1 Right To Left, 2 Bottom To Top, 3 Top To Bottom*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.Direction = 1
```
##### MinValue[β](#minvalue "Direct link to MinValue")
float **MinValue** `get` `set`
*The minimum allowed value of the slider.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.MinValue = 10
```
##### MaxValue[β](#maxvalue "Direct link to MaxValue")
float **MaxValue** `get` `set`
*The maximum allowed value of the slider.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.MaxValue = 20
```
##### WholeNumbers[β](#wholenumbers "Direct link to WholeNumbers")
bool **WholeNumbers** `get` `set`
*Should the value only be allowed to be whole numbers?*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.WholeNumbers = true
```
* Lua
```lua
--clicking this object will toggle a Sliders's Whole Numbers status
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
slider.WholeNumbers = not slider.WholeNumbers
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Value[β](#value "Direct link to Value")
float **Value** `get` `set`
*The current value of the slider.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.Value = 20
```
##### NormalizedValue[β](#normalizedvalue "Direct link to NormalizedValue")
float **NormalizedValue** `get` `set`
*The current value of the slider normalized into a value between 0 and 1.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.NormalizedValue = 0.5
```
* Lua
```lua
--This script will make moving a slider control the Master Volume
--and also update a text field with the current Master Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]
slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText
OnValueChanged = function()
Space.UI.MasterVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MasterVolume
end
slider.OnValueChanged(OnValueChanged)
```
##### NormalColor[β](#normalcolor "Direct link to NormalColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **NormalColor** `get` `set`
*The normal color.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.NormalColor = Color.Red
```
##### HighlightedColor[β](#highlightedcolor "Direct link to HighlightedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **HighlightedColor** `get` `set`
*The color of the control when it is highlighted.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.HighlightedColor = Color.Red
```
##### PressedColor[β](#pressedcolor "Direct link to PressedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **PressedColor** `get` `set`
*The color of the control when it is pressed.*
* Lua
\`\`\` Space.Host.ExecutingObject.UISlider.PressedColor = Color.Red \`\`\`
##### DisabledColor[β](#disabledcolor "Direct link to DisabledColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **DisabledColor** `get` `set`
*The color of the control when it is disabled.*
* Lua
```lua
lSpace.Host.ExecutingObject.UISlider.DisabledColor = Color.Red
```
##### ColorMultiplier[β](#colormultiplier "Direct link to ColorMultiplier")
float **ColorMultiplier** `get` `set`
*This multiplies the tint color for each transition by its value.*
* Lua
```lua
Space.Host.ExecutingObject.UISlider.ColorMultiplier = 1.2
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UISlider.GameObject
```
---
### SUIText
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------- |
| bool [**SupportRichText** ](/scripting/client-scripting-api-reference/components/suitext.md#supportrichtext)`get` `set` |
| bool [**ResizeTextForBestFit** ](/scripting/client-scripting-api-reference/components/suitext.md#resizetextforbestfit)`get` `set` |
| int [**ResizeTextMinSize** ](/scripting/client-scripting-api-reference/components/suitext.md#resizetextminsize)`get` `set` |
| int [**ResizeTextMaxSize** ](/scripting/client-scripting-api-reference/components/suitext.md#resizetextmaxsize)`get` `set` |
| bool [**AlignByGeometry** ](/scripting/client-scripting-api-reference/components/suitext.md#alignbygeometry)`get` `set` |
| int [**FontSize** ](/scripting/client-scripting-api-reference/components/suitext.md#fontsize)`get` `set` |
| float [**LineSpacing** ](/scripting/client-scripting-api-reference/components/suitext.md#linespacing)`get` `set` |
| float [**PixelsPerUnit** ](/scripting/client-scripting-api-reference/components/suitext.md#pixelsperunit)`get` |
| float [**MinWidth** ](/scripting/client-scripting-api-reference/components/suitext.md#minwidth)`get` |
| float [**PreferredWidth** ](/scripting/client-scripting-api-reference/components/suitext.md#preferredwidth)`get` |
| float [**FlexibleWidth** ](/scripting/client-scripting-api-reference/components/suitext.md#flexiblewidth)`get` |
| float [**MinHeight** ](/scripting/client-scripting-api-reference/components/suitext.md#minheight)`get` |
| float [**PreferredHeight** ](/scripting/client-scripting-api-reference/components/suitext.md#preferredheight)`get` |
| float [**FlexibleHeight** ](/scripting/client-scripting-api-reference/components/suitext.md#flexibleheight)`get` |
| int [**LayoutPriority** ](/scripting/client-scripting-api-reference/components/suitext.md#layoutpriority)`get` |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suitext.md#enabled)`get` `set` |
| string [**Text** ](/scripting/client-scripting-api-reference/components/suitext.md#text)`get` `set` |
| SColor [**Color** ](/scripting/client-scripting-api-reference/components/suitext.md#color)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suitext.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### SupportRichText[β](#supportrichtext "Direct link to SupportRichText")
bool **SupportRichText** `get` `set`
*Whether this Text will support rich text.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.SupportRichText = true
```
* Lua
```lua
--the below script will make a UIToggle disable/enable Rich Text support in the UIText
--[Add "toggle" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
text = Space.Host.GetReference("text").UIText
text.Text = " Bold Test "
OVC = function()
if toggle.IsOn then
text.SupportRichText = true
else
text.SupportRichText = false
end
end
toggle.OnValueChanged(OVC)
```
##### ResizeTextForBestFit[β](#resizetextforbestfit "Direct link to ResizeTextForBestFit")
bool **ResizeTextForBestFit** `get` `set`
*Should the text be allowed to auto resized.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.ResizeTextForBestFit = false
```
* Lua
```lua
--the below script will make a UIToggle disable/enable the Best Fit feature in the UIText
--[Add "toggle" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
text = Space.Host.GetReference("text").UIText
text.Text = "A very long text a very long text a very long text a very long text"
OVC = function()
if toggle.IsOn then
text.ResizeTextForBestFit = true
else
text.ResizeTextForBestFit = false
end
end
toggle.OnValueChanged(OVC)
```
##### ResizeTextMinSize[β](#resizetextminsize "Direct link to ResizeTextMinSize")
int **ResizeTextMinSize** `get` `set`
*The minimum size the text is allowed to be.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.ResizeTextMinSize = 20
```
* Lua
```lua
--the below script will make a slider change the UIText's Best Fit Min Size
--[Add "slider" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText
text.Text = "Best Fit Min Size"
text.ResizeTextForBestFit = true
OVC = function()
text.ResizeTextMinSize = (slider.Value * 20) + 10 -- from 10 to 30
end
slider.OnValueChanged(OVC)
```
##### ResizeTextMaxSize[β](#resizetextmaxsize "Direct link to ResizeTextMaxSize")
int **ResizeTextMaxSize** `get` `set`
*The maximum size the text is allowed to be.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.ResizeTextMaxSize = 150
```
* Lua
```lua
--the below script will make a slider change the UIText's Best Fit Max Size
--[Add "slider" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText
text.Text = "Best Fit Max Size"
text.ResizeTextForBestFit = true
OVC = function()
text.ResizeTextMaxSize = (slider.Value * 50) + 20 -- from 50 to 70
end
slider.OnValueChanged(OVC)
```
##### AlignByGeometry[β](#alignbygeometry "Direct link to AlignByGeometry")
bool **AlignByGeometry** `get` `set`
*Use the range of glyph geometry to perform horizontal alignment.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.AlignByGeometry = true
```
* Lua
```lua
--the below script will make a UIToggle disable/enable the Align By Geometry feature in the UIText
--[Add "toggle" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
text = Space.Host.GetReference("text").UIText
text.Text = "Align By Geometry"
OVC = function()
if toggle.IsOn then
text.AlignByGeometry = true
else
text.AlignByGeometry = false
end
end
toggle.OnValueChanged(OVC)
```
##### FontSize[β](#fontsize "Direct link to FontSize")
int **FontSize** `get` `set`
*The size that the Font should render at.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.FontSize = 54
```
* Lua
```lua
--the below script will make a slider change the UIText's Font Size
--[Add "slider" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText
text.Text = "Text Size Test"
OVC = function()
text.FontSize = (slider.Value * 40) + 10 -- from 10 to 50
end
slider.OnValueChanged(OVC)
```
##### LineSpacing[β](#linespacing "Direct link to LineSpacing")
float **LineSpacing** `get` `set`
*How much space will be in-between lines of text. This is a multiplier. The line spacing value set will be multiplied by the font's internal line spacing. A value of 1 will produce normal line spacing.*
* Lua
```lua
thisObject = Space.Host.ExecutingObject.UIText.LineSpacing = 2
```
* Lua
```lua
--the below script will make a slider change the UIText's Line Spacing
--[Add "slider" and "text" references to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider
text = Space.Host.GetReference("text").UIText
text.Text = "Line Spacing Line Spacing Line Spacing Line Spacing Line Spacing"
OVC = function()
text.LineSpacing = (slider.Value * 2) -- from 0 to 2
end
slider.OnValueChanged(OVC)
```
##### PixelsPerUnit[β](#pixelsperunit "Direct link to PixelsPerUnit")
float **PixelsPerUnit** `get`
*Provides information about how fonts are scale to the screen.*
*For dynamic fonts, the value is equivalent to the scale factor of the canvas. For non-dynamic fonts, the value is calculated from the requested text size and the size from the font.*
* Lua
```lua
thisObject = Space.Host.ExecutingObject
--get a reference to our object
thisObjectText = thisObject.UIText
--get a reference to the UIText component in our object
Space.Log(thisObjectText.PixelsPerUnit)
--Prints the PixelsPerUnit value of this UIText component to the console
```
##### MinWidth[β](#minwidth "Direct link to MinWidth")
float **MinWidth** `get`
*The minimum width this UIText may be allocated. (Used by the Layout system).*
* Lua
```lua
thisObject = Space.Host.ExecutingObject
--get a reference to our object
thisObjectText = thisObject.UIText
--get a reference to the UIText component in our object
Space.Log(thisObjectText.MinWidth)
--Prints the MinWidth value of this UIText component to the console
```
##### PreferredWidth[β](#preferredwidth "Direct link to PreferredWidth")
float **PreferredWidth** `get`
*The preferred width this UIText should be allocated if there is sufficient space. (Used by the Layout system)*
* Lua
```lua
pWidth = Space.Host.ExecutingObject.UIText.PreferredWidth
```
##### FlexibleWidth[β](#flexiblewidth "Direct link to FlexibleWidth")
float **FlexibleWidth** `get`
*The extra relative width this UIText should be allocated if there is additional available space. (Used by the Layout system)*
* Lua
```lua
FlexibleWidth = Space.Host.ExecutingObject.UIText.FlexibleWidth
```
##### MinHeight[β](#minheight "Direct link to MinHeight")
float **MinHeight** `get`
*The minimum height this UIText may be allocated.(Used by the Layout system).*
* Lua
```lua
minHeight = Space.Host.ExecutingObject.UIText.MinHeight
```
##### PreferredHeight[β](#preferredheight "Direct link to PreferredHeight")
float **PreferredHeight** `get`
*The preferred height this UIText should be allocated if there is sufficient space. (Used by the Layout system)*
* Lua
```lua
pHeight = Space.Host.ExecutingObject.UIText.PreferredHeight
```
##### FlexibleHeight[β](#flexibleheight "Direct link to FlexibleHeight")
float **FlexibleHeight** `get`
*The extra relative height this UIText should be allocated if there is additional available space. (Used by the Layout system.)*
* Lua
```lua
FlexibleHeight = Space.Host.ExecutingObject.UIText.FlexibleHeight
```
##### LayoutPriority[β](#layoutpriority "Direct link to LayoutPriority")
int **LayoutPriority** `get`
*The layout priority of this UIText component.(Used by the Layout system.)*
* Lua
```lua
layoutPriority = Space.Host.ExecutingObject.UIText.LayoutPriority
```
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the UIText component is Enabled or not will decide if it is visually updating or not.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.Enabled = true
```
* Lua
```lua
--this below script will make clicking this object disable/enable a UIText component
thisGameObject = Space.Host.ExecutingObject
text = Space.Host.GetReference("text").UIText
OnClick = function()
if text.Enabled then
text.Enabled = false
else
text.Enabled = true
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "click to hide/show text"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Text[β](#text "Direct link to Text")
string **Text** `get` `set`
*The string value this Text displays.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.Text = "Hello World!"
```
* Lua
```lua
--the below script will make a UIText element with this script
--constantly update itself to show the local time
--(Example: UI Text element that shows local clock)
--[This object needs to be a UI Text object. In Unity, Heirarchy -> Create -> UI -> Text]
--
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
thisGameObject.UIText.Text = Space.LocalTime
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### Color[β](#color "Direct link to Color")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Color** `get` `set`
*Base color of the Graphic.*
* Lua
```lua
Space.Host.ExecutingObject.UIText.Color = Color.Red
```
* Lua
```lua
--This script dynamically changes the text's color of a GameObject with UIText component.
--For example in a text sign over your shop that you want to make more visually stand out
--or perhaps text decoration during a celebration or a text element in your User Interface or HUD.
thisObject = Space.Host.ExecutingObject
--get a reference to our object
thisObjectText = thisObject.UIText
--get a reference to the SUIText component in our object
colors = {Color.Red, Color.Black, Color.White, Color.Blue, Color.Green, Color.Yellow}
--here we are holding 6 predefined colors in a Lua Table which we will go through
function ColorChanger()
while true do
--infinite loop
for i=1,#colors do
--For Loop to cycle through all the table items
thisObjectText.color = colors[i]
--this will set the color based on which item in the table we are now at
coroutine.yield(0.1)
--this will pause for a tenth of a second before we change to the next color
end
end
end
Space.Host.StartCoroutine(ColorChanger)
--this coroutine will now call our ColorChanger() function which is infinitely changing our text colors between a select range.
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UIText.Text
```
---
### SUIToggle
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| void [**OnValueChanged** ](/scripting/client-scripting-api-reference/components/suitoggle.md#onvaluechanged)(Closure callback) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suitoggle.md#enabled)`get` `set` |
| bool [**Interactable** ](/scripting/client-scripting-api-reference/components/suitoggle.md#interactable)`get` `set` |
| bool [**IsOn** ](/scripting/client-scripting-api-reference/components/suitoggle.md#ison)`get` `set` |
| SColor [**NormalColor** ](/scripting/client-scripting-api-reference/components/suitoggle.md#normalcolor)`get` `set` |
| SColor [**HighlightedColor** ](/scripting/client-scripting-api-reference/components/suitoggle.md#highlightedcolor)`get` `set` |
| SColor [**PressedColor** ](/scripting/client-scripting-api-reference/components/suitoggle.md#pressedcolor)`get` `set` |
| SColor [**DisabledColor** ](/scripting/client-scripting-api-reference/components/suitoggle.md#disabledcolor)`get` `set` |
| float [**ColorMultiplier** ](/scripting/client-scripting-api-reference/components/suitoggle.md#colormultiplier)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suitoggle.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### OnValueChanged[β](#onvaluechanged "Direct link to OnValueChanged")
void **OnValueChanged** (Closure callback)
*Binds a function to be triggered when value of the UIToggle changes.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function ovc()
--
end
Space.Host.ExecutingObject.UIToggle.OnValueChanged(ovc)
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Notification Button
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowNotificationButton= true
else
Space.UI.ShowNotificationButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the UIToggle is Enabled*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.Enabled = true
```
* Lua
```lua
--clicking this object will toggle a Toggles's Enabled status
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
toggle.Enabled = not toggle.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Interactable[β](#interactable "Direct link to Interactable")
bool **Interactable** `get` `set`
*Whether the UIToggle is Interactable*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.Interactable = true
```
* Lua
```lua
--clicking this object will toggle a Toggles's Interactable status
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
toggle.Interactable= not toggle.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### IsOn[β](#ison "Direct link to IsOn")
bool **IsOn** `get` `set`
*Whether the UIToggle is toggled On*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.IsOn = true
```
* Lua
```lua
--This script will make a UI Toggle show/hide the Notification Button
--[You need to add an object with UI Toggle as a reference (scripting runtime)]
toggle = Space.Host.GetReference("Toggle").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowNotificationButton= true
else
Space.UI.ShowNotificationButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
```
##### NormalColor[β](#normalcolor "Direct link to NormalColor")
SColor **NormalColor** `get` `set`
*The normal color.*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.NormalColor = Color.Red
```
##### HighlightedColor[β](#highlightedcolor "Direct link to HighlightedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **HighlightedColor** `get` `set`
*The color of the control when it is highlighted.*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.HighlightedColor = Color.Red
```
##### PressedColor[β](#pressedcolor "Direct link to PressedColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **PressedColor** `get` `set`
*The color of the control when it is pressed.*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.PressedColor = Color.Red
```
##### DisabledColor[β](#disabledcolor "Direct link to DisabledColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **DisabledColor** `get` `set`
*The color of the control when it is disabled.*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.DisabledColor = Color.Red
```
##### ColorMultiplier[β](#colormultiplier "Direct link to ColorMultiplier")
float **ColorMultiplier** `get` `set`
*This multiplies the tint color for each transition by its value.*
* Lua
```lua
Space.Host.ExecutingObject.UIToggle.ColorMultiplier = 1.2
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UIToggle.GameObject
```
---
### SUIToolTipHint
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/suitooltiphint.md#enabled)`get` `set` |
| string [**Text** ](/scripting/client-scripting-api-reference/components/suitooltiphint.md#text)`get` `set` |
| SResource [**Texture** ](/scripting/client-scripting-api-reference/components/suitooltiphint.md#texture)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/suitooltiphint.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Get or set whether the tool tip component is Enabled.*
* Lua
```lua
Space.Host.ExecutingObject.UIToolTipHint.Enabled = true
```
##### Text[β](#text "Direct link to Text")
string **Text** `get` `set`
*Get or set the string value this tool tip displays.*
* Lua
```lua
Space.Host.ExecutingObject.UIToolTipHint.Text = "AToolTip"
```
##### Texture[β](#texture "Direct link to Texture")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **Texture** `get` `set`
*Get or set the tooltip's texture.*
* Lua
```lua
Space.Host.ExecutingObject.UIToolTipHint.Texture = Space.GetResource("ResourceName")
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.UIToolTipHint.GameObject
```
---
### SVirtualCamera
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#enabled)`get` `set` |
| float [**FieldOfView** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#fieldofview)`get` `set` |
| float [**Dutch** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#dutch)`get` `set` |
| float [**NearClip** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#nearclip)`get` `set` |
| float [**FarClip** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#farclip)`get` `set` |
| float [**OrthographicSize** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#orthographicsize)`get` `set` |
| int [**Priority** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#priority)`get` `set` |
| SGameObject [**Follow** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#follow)`get` `set` |
| SGameObject [**LookAt** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#lookat)`get` `set` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/svirtualcamera.md#gameobject)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is this virtual camera enabled?*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Virtual Camera component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.VirtualCamera
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### FieldOfView[β](#fieldofview "Direct link to FieldOfView")
float **FieldOfView** `get` `set`
*Field of view of this virtual camera.*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.FieldOfView = 50.0
```
##### Dutch[β](#dutch "Direct link to Dutch")
float **Dutch** `get` `set`
*Dutch of view of this virtual camera. In degrees.*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.Dutch = 50.0
```
##### NearClip[β](#nearclip "Direct link to NearClip")
float **NearClip** `get` `set`
*The near clip plane of this virtual camera.*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.NearClip = 50.0
```
##### FarClip[β](#farclip "Direct link to FarClip")
float **FarClip** `get` `set`
*The far clip plane of this virtual camera.*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.FarClip = 50.0
```
##### OrthographicSize[β](#orthographicsize "Direct link to OrthographicSize")
float **OrthographicSize** `get` `set`
*The orthographic size of this virtual camera.*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.OrthographicSize = 10.0
```
##### Priority[β](#priority "Direct link to Priority")
int **Priority** `get` `set`
*The priority of this virtual camera. Higher priority cameras will be used over lower priority cameras when conflicted.*
* Lua
```lua
Space.Host.ExecutingObject.VirtualCamera.Priority = 500
```
##### Follow[β](#follow "Direct link to Follow")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Follow** `get` `set`
*The object that this virtual camera should be following.*
* Lua
```lua
AReferenceToGameObject = Space.Host.GetReference("Reference Name")
Space.Host.ExecutingObject.VirtualCamera.Follow = AReferenceToGameObject
```
##### LookAt[β](#lookat "Direct link to LookAt")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **LookAt** `get` `set`
*The object that this virtual camera should be looking at.*
* Lua
```lua
AReferenceToGameObject = Space.Host.GetReference("Reference Name")
Space.Host.ExecutingObject.VirtualCamera.LookAt = AReferenceToGameObject
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.VirtualCamera.GameObject
```
---
### SVoiceZone
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------ |
| void [**SetOverrideVoice** ](/scripting/client-scripting-api-reference/components/svoicezone.md#setoverridevoice)(bool enabled) |
| void [**ClearOverrideVoice** ](/scripting/client-scripting-api-reference/components/svoicezone.md#clearoverridevoice)() |
| void [**SetOverrideVideo** ](/scripting/client-scripting-api-reference/components/svoicezone.md#setoverridevideo)(bool enabled) |
| void [**ClearOverrideVideo** ](/scripting/client-scripting-api-reference/components/svoicezone.md#clearoverridevideo)() |
| void [**AddAuthVoiceUser** ](/scripting/client-scripting-api-reference/components/svoicezone.md#addauthvoiceuser)(uint userID) |
| void [**RemoveAuthVoiceUser** ](/scripting/client-scripting-api-reference/components/svoicezone.md#removeauthvoiceuser)(uint userID) |
| void [**AddAuthVideoUser** ](/scripting/client-scripting-api-reference/components/svoicezone.md#addauthvideouser)(uint userID) |
| void [**RemoveAuthVideoUser** ](/scripting/client-scripting-api-reference/components/svoicezone.md#removeauthvideouser)(uint userID) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/components/svoicezone.md#enabled)`get` `set` |
| bool [**AllowVoice** ](/scripting/client-scripting-api-reference/components/svoicezone.md#allowvoice)`get` `set` |
| bool [**AllowVideo** ](/scripting/client-scripting-api-reference/components/svoicezone.md#allowvideo)`get` `set` |
| bool [**ConnectVoiceService** ](/scripting/client-scripting-api-reference/components/svoicezone.md#connectvoiceservice)`get` `set` |
| bool [**ConnectVideoService** ](/scripting/client-scripting-api-reference/components/svoicezone.md#connectvideoservice)`get` `set` |
| int [**Priority** ](/scripting/client-scripting-api-reference/components/svoicezone.md#priority)`get` |
| string [**AreaName** ](/scripting/client-scripting-api-reference/components/svoicezone.md#areaname)`get` |
| bool [**Spatialized** ](/scripting/client-scripting-api-reference/components/svoicezone.md#spatialized)`get` |
| bool [**SpatialDropoff** ](/scripting/client-scripting-api-reference/components/svoicezone.md#spatialdropoff)`get` |
| bool [**SpatialStereo** ](/scripting/client-scripting-api-reference/components/svoicezone.md#spatialstereo)`get` |
| float [**SpatialDistance** ](/scripting/client-scripting-api-reference/components/svoicezone.md#spatialdistance)`get` |
| bool [**Global** ](/scripting/client-scripting-api-reference/components/svoicezone.md#global)`get` |
| uint\[] [**AuthVideoUsers** ](/scripting/client-scripting-api-reference/components/svoicezone.md#authvideousers)`get` |
| uint\[] [**AuthVoiceUsers** ](/scripting/client-scripting-api-reference/components/svoicezone.md#authvoiceusers)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/components/svoicezone.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### SetOverrideVoice[β](#setoverridevoice "Direct link to SetOverrideVoice")
void **SetOverrideVoice** (bool enabled)
*Set voice to override the original voice.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.SetOverrideVoice(true)
```
##### ClearOverrideVoice[β](#clearoverridevoice "Direct link to ClearOverrideVoice")
void **ClearOverrideVoice** ()
*Clear the overriding voice.*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.ClearOverrideVoice()
```
##### SetOverrideVideo[β](#setoverridevideo "Direct link to SetOverrideVideo")
void **SetOverrideVideo** (bool enabled)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.SetOverrideVideo(true)
```
##### ClearOverrideVideo[β](#clearoverridevideo "Direct link to ClearOverrideVideo")
void **ClearOverrideVideo** ()
*Function Description*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.SetOverrideVideo(true)
```
##### AddAuthVoiceUser[β](#addauthvoiceuser "Direct link to AddAuthVoiceUser")
void **AddAuthVoiceUser** (uint userID)
*Add a user to AuthVoiceUser by his ID.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.AddAuthVoiceUser(000000000)
```
##### RemoveAuthVoiceUser[β](#removeauthvoiceuser "Direct link to RemoveAuthVoiceUser")
void **RemoveAuthVoiceUser** (uint userID)
*Remove a user from AuthVoiceUser by his ID.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
lSpace.Host.ExecutingObject.VoiceZone.RemoveAuthVoiceUser(000000000)
```
##### AddAuthVideoUser[β](#addauthvideouser "Direct link to AddAuthVideoUser")
void **AddAuthVideoUser** (uint userID)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.AddAuthVideoUser(000000000)
```
##### RemoveAuthVideoUser[β](#removeauthvideouser "Direct link to RemoveAuthVideoUser")
void **RemoveAuthVideoUser** (uint userID)
*Remove a user from AuthVoiceUser by his ID.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.RemoveAuthVideoUser(000000000)
```
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Whether the Voice Zone component is Enabled*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.Enabled = true
```
* Lua
```lua
--clicking this object will Enable/Disable it's Voice Zone component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.VoiceZone
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AllowVoice[β](#allowvoice "Direct link to AllowVoice")
bool **AllowVoice** `get` `set`
*Whether allows voice.*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.AllowVoice = true
```
##### AllowVideo[β](#allowvideo "Direct link to AllowVideo")
bool **AllowVideo** `get` `set`
*Whether allows video.*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.AllowVideo = true
```
##### ConnectVoiceService[β](#connectvoiceservice "Direct link to ConnectVoiceService")
bool **ConnectVoiceService** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.ConnectVoiceService = true
```
##### ConnectVideoService[β](#connectvideoservice "Direct link to ConnectVideoService")
bool **ConnectVideoService** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.VoiceZone.ConnectVideoService = true
```
##### Priority[β](#priority "Direct link to Priority")
int **Priority** `get`
*The priority of the voice zone*
* Lua
```lua
priority = Space.Host.ExecutingObject.VoiceZone.Priority
```
##### AreaName[β](#areaname "Direct link to AreaName")
string **AreaName** `get`
*The name of area.*
* Lua
```lua
priority = Space.Host.ExecutingObject.VoiceZone.AreaName
```
##### Spatialized[β](#spatialized "Direct link to Spatialized")
bool **Spatialized** `get`
*Whether the voice zone is spatialized.*
* Lua
```lua
isSpatialized = Space.Host.ExecutingObject.VoiceZone.Spatialized
```
##### SpatialDropoff[β](#spatialdropoff "Direct link to SpatialDropoff")
bool **SpatialDropoff** `get`
*Whether the voice zone is spatialized drop off.*
* Lua
```lua
spatialDropoff = Space.Host.ExecutingObject.VoiceZone.SpatialDropoff
```
##### SpatialStereo[β](#spatialstereo "Direct link to SpatialStereo")
bool **SpatialStereo** `get`
*Whether the voice zone is spatial stereo.*
* Lua
```lua
spatialStereo = Space.Host.ExecutingObject.VoiceZone.SpatialStereo
```
##### SpatialDistance[β](#spatialdistance "Direct link to SpatialDistance")
float **SpatialDistance** `get`
*The spatial distance of the voice zone.*
* Lua
```lua
floatDistance = Space.Host.ExecutingObject.VoiceZone.SpatialDistance
```
##### Global[β](#global "Direct link to Global")
bool **Global** `get`
*Whether the voice zone is global.*
* Lua
```lua
isGlobal = Space.Host.ExecutingObject.VoiceZone.Global
```
##### AuthVideoUsers[β](#authvideousers "Direct link to AuthVideoUsers")
uint\[] **AuthVideoUsers** `get`
*Return an array of auth video user.*
* Lua
```lua
tableAuthVideoUsers = Space.Host.ExecutingObject.VoiceZone.AuthVideoUsers
```
##### AuthVoiceUsers[β](#authvoiceusers "Direct link to AuthVoiceUsers")
uint\[] **AuthVoiceUsers** `get`
*Property Description*
* Lua
```lua
tableAuthVideoUsers = Space.Host.ExecutingObject.VoiceZone.AuthVoiceUsers
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
theGameObject = Space.Host.ExecutingObject.VoiceZone.GameObject
```
---
### Network
Networking APIs for client scripts, covering chat, network messages between peers, web requests, and shared photo and video resources.
---
### SChat
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**OnChat** ](schat#onchat)(Closure callback) void [**OnChat** ](schat#onchat)(Action< SChatMessage > trackInfoCallback) |
| void [**JoinChat** ](/scripting/client-scripting-api-reference/network/schat.md#joinchat)(string name) |
| string [**GetXMPPName** ](/scripting/client-scripting-api-reference/network/schat.md#getxmppname)(string name) |
| void [**LeaveChat** ](/scripting/client-scripting-api-reference/network/schat.md#leavechat)(string name) |
| SVoiceZone [**GetVoiceZone** ](/scripting/client-scripting-api-reference/network/schat.md#getvoicezone)(string channel) |
| void [**JoinVoice** ](/scripting/client-scripting-api-reference/network/schat.md#joinvoice)(string channel, int priority=5, int spatial=0) |
| void [**JoinGridVoice** ](/scripting/client-scripting-api-reference/network/schat.md#joingridvoice)(string channel, int priority=5, int spatial=0) |
| void [**LeaveVoice** ](/scripting/client-scripting-api-reference/network/schat.md#leavevoice)(string channel) |
#### Functions[β](#functions "Direct link to Functions")
##### OnChat[β](#onchat "Direct link to OnChat")
void **OnChat** (Closure callback) void **OnChat** (Action< [SChatMessage](/scripting/client-scripting-api-reference/types/schatmessage.md) > trackInfoCallback)
*Bind a function to the OnChat event. This function will be called every time a new chat message is received on the local channel.*
| Parameter | Type | Description |
| --------- | -------------------------------- | --------------------------------------- |
| callback | Closure or Action\ | Invoked when a chat message is received |
* Lua
```lua
Space.Network.Chat.OnChat(OnChatFunction)
```
* Lua
```lua
--this script takes every new chat message and displays it in a UIText
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime
OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Sender ..": " .. SChatMessage.Message
end
Space.Network.Chat.OnChat(OnChatFunction)
```
##### JoinChat[β](#joinchat "Direct link to JoinChat")
void **JoinChat** (string name)
*Join a chat channel.*
| Parameter | Type | Description |
| --------- | ------ | -------------------- |
| name | string | Chat channel to join |
* Lua
```lua
Space.Network.Chat.JoinChat("Test room")
```
* Lua
```lua
--this script will make the player join a chat when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.JoinChat("PrivateChatZone")
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.LeaveChat("PrivateChatZone")
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### GetXMPPName[β](#getxmppname "Direct link to GetXMPPName")
string **GetXMPPName** (string name)
*Get XMPP name.*
| Parameter | Type | Description |
| --------- | ------ | ------------------------ |
| name | string | Human-readable chat name |
* Lua
```lua
Space.Network.Chat.GetXMPPName("Test room")
```
##### LeaveChat[β](#leavechat "Direct link to LeaveChat")
void **LeaveChat** (string name)
*Leave a chat channel.*
| Parameter | Type | Description |
| --------- | ------ | --------------------- |
| name | string | Chat channel to leave |
* Lua
```lua
Space.Network.Chat.LeaveChat("Test room")
```
* Lua
```lua
--this script will make the player join a chat when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.JoinChat("PrivateChatZone")
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.LeaveChat("PrivateChatZone")
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### GetVoiceZone[β](#getvoicezone "Direct link to GetVoiceZone")
SVoiceZone **GetVoiceZone** (string channel)
*Get a reference to a voice zone component for the given channel.*
| Parameter | Type | Description |
| --------- | ------ | ------------------------- |
| channel | string | Voice channel name/handle |
* Lua
```lua
voiceZone = Space.Network.Chat.GetVoiceZone("AChannel")
```
##### JoinVoice[β](#joinvoice "Direct link to JoinVoice")
void **JoinVoice** (string channel, int priority=5, int spatial=0)
*Join a voice chat channel.*
| Parameter | Type | Description |
| --------- | ------ | ---------------------------------------------- |
| channel | string | Voice channel name/handle |
| priority | int | Optional. Priority, default 5 |
| spatial | int | Optional. Spatialization flag (0/1), default 0 |
* Lua
```lua
Space.Network.Chat.JoinVoice("PrivateVoiceZone")
```
* Lua
```lua
--this script will make the player join a voice channel when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.JoinVoice("PrivateVoiceZone")
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### JoinGridVoice[β](#joingridvoice "Direct link to JoinGridVoice")
void **JoinGridVoice** (string channel, int priority=5, int spatial=0)
*JoinGridVoice is the same as JoinVoice except with a grid wide parameter. (white-label only)*
| Parameter | Type | Description |
| --------- | ------ | ---------------------------------------------- |
| channel | string | Voice channel name/handle (grid-wide) |
| priority | int | Optional. Priority, default 5 |
| spatial | int | Optional. Spatialization flag (0/1), default 0 |
* Lua
```lua
Space.Network.Chat.JoinGridVoice("PrivateGridVoiceZone")
```
* Lua
```lua
--this script will make the player join a Grid voice channel when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.JoinGridVoice("PrivateGridVoiceZone")
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.LeaveVoice("PrivateGridVoiceZone")
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### LeaveVoice[β](#leavevoice "Direct link to LeaveVoice")
void **LeaveVoice** (string channel)
*Leave a voice chat channel*
| Parameter | Type | Description |
| --------- | ------ | ---------------------- |
| channel | string | Voice channel to leave |
* Lua
```lua
Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
```
* Lua
```lua
--this script will make the player join a voice channel when entering a trigger collider and leave it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.JoinVoice("PrivateVoiceZone")
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
Space.Network.Chat.LeaveVoice("PrivateVoiceZone")
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
---
### SNetwork
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SendNetworkMessage** ](snetwork#sendnetworkmessage)(string key, Table message, bool serverOnly, bool loopback) void [**SendNetworkMessage** ](snetwork#sendnetworkmessage)(string key, Table message, bool serverOnly) void [**SendNetworkMessage** ](snetwork#sendnetworkmessage)(string key, Table message) |
| void[ **SendNetworkMessageToUser**](/scripting/client-scripting-api-reference/network/snetwork.md#sendnetworkmessagetouser) (string key, Table message, uint userID) |
| void [**SubscribeToRegionPropertyUpdate**](/scripting/client-scripting-api-reference/network/snetwork.md#subscribetoregionpropertyupdate) (string key, DynValue onRecieve) |
| void [**SubscribeToNetwork** ](/scripting/client-scripting-api-reference/network/snetwork.md#subscribetonetwork)(string key, DynValue onRecieve) |
| void [**SetRegionProperty** ](/scripting/client-scripting-api-reference/network/snetwork.md#setregionproperty)(string key, string value) |
| string [**GetRegionProperty** ](/scripting/client-scripting-api-reference/network/snetwork.md#getregionproperty)(string key) |
| void [**SetShardProperty** ](/scripting/client-scripting-api-reference/network/snetwork.md#setshardproperty)(string key, string value) |
| string [**GetShardProperty** ](/scripting/client-scripting-api-reference/network/snetwork.md#getshardproperty)(string key) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name | Description |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**HasShardProperties** ](/scripting/client-scripting-api-reference/network/snetwork.md#hasshardproperties)`get` | Returns True upon successful connection to the Region/Shard properties' storage. Region/Shard property operations may not be ready when used during initialization and this function will help determine readiness. |
#### Overview[β](#overview "Direct link to Overview")
* Local network messages (region/shard scope)
* Use SendNetworkMessage / SubscribeToNetwork with a string key.
* Delivery is confined to the current region or shard and only to active subscribers of that key.
* Payload is a Lua Table (dictionary) of network-serializable types. Messages are ephemeral and not stored.
* Region/Shard properties (server-stored)
* Use SetRegionProperty/GetRegionProperty for region-scoped semi-permanent storage (persists while the region is open).
* Use SetShardProperty/GetShardProperty for shard-scoped storage (persists until the shard shuts down or all users leave).
* Values are strings; operations may be rate-limited and may not be immediately available on join. Use HasShardProperties to detect readiness.
#### Functions[β](#functions "Direct link to Functions")
##### SendNetworkMessage[β](#sendnetworkmessage "Direct link to SendNetworkMessage")
void **SendNetworkMessage** (string key, Table message)
void **SendNetworkMessage** (string key, Table message, bool serverOnly)
void **SendNetworkMessage** (string key, Table message, bool serverOnly, bool loopback)
*Sends a networked message to every client with a subscriber listening on 'key'. The message itself can be a table/dictionary of network-serializable types (string, float, int, byte, bool and arrays of those types). Requests may be rate limited.*
| Parameter | Type | Description |
| ---------- | ------ | -------------------------------------------------------------- |
| key | string | Subscription key to route the message to listeners |
| message | Table | Table/dictionary of serializable values |
| serverOnly | bool | Optional. If true, send via server only |
| loopback | bool | Optional. If true, also invoke local subscriber on this client |
* Lua
```lua
Space.Network.SendNetworkMessage('AKey', {first = "xyz", second= "abc"})
--or
Space.Network.SendNetworkMessage('AKey', {first = "xyz", second= "abc"}, true)
--or
Space.Network.SendNetworkMessage('AKey', {first = "xyz", second= "abc"}, true, true)
```
* Lua
```lua
image = "mrlee.jpg"
server = "https://middleware.systems/"
obj = Space.Host.GetReference("Gino")
Space.Network.SubscribeToNetwork("smack", onSmack)
function hithere()
resrc = Space.WebServices.GetImage(server .. image)
obj.Renderer.Material.SetTexture("_MainTex", resrc)
Space.Network.SendNetworkMessage("smack",{'smack'})
end
function update()
resrc = Space.WebServices.GetImage(server .. image)
obj.Renderer.Material.SetTexture("_MainTex", resrc)
end
function onSmack()
update()
end
```
##### SendNetworkMessageToUser[β](#sendnetworkmessagetouser "Direct link to SendNetworkMessageToUser")
void **SendNetworkMessageToUser** (string key, Table message, uint userID)
*Sends a networked message to a specific user (userID) with a subscriber listening on 'key'.*
| Parameter | Type | Description |
| --------- | ------ | --------------------------------------- |
| key | string | Subscription key |
| message | Table | Table/dictionary of serializable values |
| userID | uint | Target user ID |
* Lua
```lua
Space.Network.SendNetworkMessageToUser('AKey', {first = "xyz", second= "abc"}, 23123123)
```
##### SubscribeToRegionPropertyUpdate[β](#subscribetoregionpropertyupdate "Direct link to SubscribeToRegionPropertyUpdate")
void **SubscribeToRegionPropertyUpdate** (string key, DynValue onRecieve)
*Subscribes to region property updates on 'key'.*
| Parameter | Type | Description |
| --------- | ---------------- | ---------------------------------------------------------------------------------------------------- |
| key | string | Property key to subscribe to |
| onRecieve | Callback Closure | onRecieve(NetworkPropertyUpdate) will be called on updates. NetworkPropertyUpdate = { Key, Message } |
* Lua
```lua
function onRecieve(NetworkPropertyUpdate)
propertyKey = NetworkPropertyUpdate.Key
propertyValue = NetworkPropertyUpdate.Message
end
Space.Network.SubscribeToRegionPropertyUpdate('A Key', onRecieve)
```
##### SubscribeToNetwork[β](#subscribetonetwork "Direct link to SubscribeToNetwork")
void **SubscribeToNetwork** (string key, Action< [SNetworkMessageLua ](#)> onRecieve) void **SubscribeToNetwork** (string key, DynValue onRecieve)
*Subscribes to network messages on 'key', will fire a SNetworkMessage whenever a matching message is received*
| Parameter | Type | Description |
| --------- | ---------------- | ---------------------------------------------------------------------------------- |
| key | string | Subscription key to listen on |
| onRecieve | Callback Closure | Callback receiving SNetworkMessageLua with fields Key (string) and Message (Table) |
* Lua
```lua
function OnRecieveFunction(SNetworkMessageLua)
--
end
Space.Network.SubscribeToNetwork("AKey", OnRecieveFunction)
```
* Lua
```lua
local scriptedObject = Space.Host.ExecutingObject;
local textValue = Space.Host.GetReference("Text");
scriptedObject.SubscribeToEvents();
-- This function gets used by other objects that are subscribed to the network
gotAMessage = function(arguments)
textValue.UIText.Text = "Got a message with the argument " .. arguments.Message["someArgument"];
end
-- This function gets used by "this" object. Plus, it sends out a message to objects on the network.
local updateTextUI = function()
textValue.UIText.Text = "Got a message with the argument Hi there!";
Space.Network.SendNetworkMessage("helloworld", {someArgument = "Hi there!"});
end
-- Subscribe to network. Note that "this" object doesn't execute gotAMessage.
-- Only the other objects on the network do.
Space.Network.SubscribeToNetwork("helloworld", gotAMessage);
scriptedObject.OnMouseDown(updateTextUI);
-- "Text" used with GetReference is a UItext canvas object used to display the test text inworld. After you add UI > Text to your scene, drag the text object to the Object References section in your script.
```
##### SetRegionProperty[β](#setregionproperty "Direct link to SetRegionProperty")
void **SetRegionProperty** (string key, string value)
*Stores a key/value pair in the Regions semi-permanent memory. Will be erased when all players exit the region, but will persist as long as the region is open. Subject to rate limiting (10/second on the main grid and 20/second on white-label grids)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Network.SetRegionProperty("testKey", "Test Value")
```
* Lua
```lua
--this script is a networked and persistent color changing of an object
--note that we put the object's GlobalID in the key to make it specific to this object
thisObject = Space.Host.ExecutingObject
currentColor = nil
OnClick = function() --this writes to the region properties
if currentColor == Color.Blue then
Space.Network.SetRegionProperty(thisObject.GlobalID .. "color", "red")
else
Space.Network.SetRegionProperty(thisObject.GlobalID .. "color", "blue")
end
end
Sync = function() -- this gets from the region properties
while true do
local result = Space.Network.GetRegionProperty(thisObject.GlobalID .. "color")
if result == "red" then
currentColor = Color.Red
else
currentColor = Color.Blue
end
thisObject.Renderer.Material.SetColor("_Color", currentColor)
coroutine.yield(0.1) --to make sure it doesn't run more than 12/second
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.StartCoroutine(Sync)
```
##### GetRegionProperty[β](#getregionproperty "Direct link to GetRegionProperty")
string **GetRegionProperty** (string key)
*Retrieves the last set value for 'key' in this region. If you have just joined the region, this may not be populated immedietely.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
result = Space.Network.GetRegionProperty("testKey")
```
* Lua
```lua
--this script is a networked and persistent color changing of an object
--note that we put the object's GlobalID in the key to make it specific to this object
thisObject = Space.Host.ExecutingObject
currentColor = nil
OnClick = function() --this writes to the region properties
if currentColor == Color.Blue then
Space.Network.SetRegionProperty(thisObject.GlobalID .. "color", "red")
else
Space.Network.SetRegionProperty(thisObject.GlobalID .. "color", "blue")
end
end
Sync = function() -- this gets from the region properties
while true do
local result = Space.Network.GetRegionProperty(thisObject.GlobalID .. "color")
if result == "red" then
currentColor = Color.Red
else
currentColor = Color.Blue
end
thisObject.Renderer.Material.SetColor("_Color", currentColor)
coroutine.yield(0.1) --to make sure it doesn't run more than 12/second
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
Space.Host.StartCoroutine(Sync)
```
##### SetShardProperty[β](#setshardproperty "Direct link to SetShardProperty")
void **SetShardProperty** (string key, string value)
*Sets a property named 'key' of the Shard to 'value'. Will persist until the Shard is shut down or restarted. (Use SPersistence for longer term storage)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local scriptedObject = Space.Host.ExecutingObject;
scriptedObject.SubscribeToEvents();
local testMsg = "Hello";
local updateTextUI = function()
Space.Network.SetShardProperty("testKey", testMsg);
end
scriptedObject.OnMouseDown(updateTextUI);
```
##### GetShardProperty[β](#getshardproperty "Direct link to GetShardProperty")
string **GetShardProperty** (string key)
*Gets a previously set key.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local scriptedObject = Space.Host.ExecutingObject;
scriptedObject.SubscribeToEvents();
local textValue = Space.Host.GetReference("Text");
local retrieved;
local updateTextUI = function()
retrieved = Space.Network.GetShardProperty("testKey");
end
-- this method is called every frame, once "retrieved" gets a value, it displays in text
local onUpdateMethod = function()
updateTextUI();
if retrieved ~= nil then
textValue.UIText.Text = "Retrieved msg: " .. retrieved ;
end
end
scriptedObject.OnUpdate(onUpdateMethod);
```
#### Properties[β](#properties "Direct link to Properties")
##### HasShardProperties[β](#hasshardproperties "Direct link to HasShardProperties")
bool **HasShardProperties** `get`
*Returns True upon successful connection to the Region/Shard properties' storage. Region/Shard property operations may not be ready when used during initialization and this function ill help determine readiness.*
* Lua
```lua
IsReady = Space.Network.HasShardProperties
```
* Lua
```lua
--This script starts but launches a coroutine that waits for HasShardProperties before continuing
DoWhatYouNeed = function(result)
if property == nil or property == "" then
Space.Log("connected but Shard doesn't exist")
else
Space.Log("connected and Shard exists. Result: " .. tostring(result))
end
end
InitCoroutine = function()
while not Space.Network.HasShardProperties do
coroutine.yield(0)
end
local property = Space.Network.GetRegionProperty("A Key")
DoWhatYouNeed(property)
end
Space.Host.StartCoroutine(InitCoroutine)
```
---
### SNetworkMessageLua
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------- |
| string [**Key** ](/scripting/client-scripting-api-reference/network/snetworkmessagelua.md#key)`get` |
| Table [**Message** ](/scripting/client-scripting-api-reference/network/snetworkmessagelua.md#message)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Key[β](#key "Direct link to Key")
string **Key** `get`
*The Key this message was sent with.*
* Lua
```lua
function OnReceiveFunction(receivedMessage)
local theKey = receivedMessage.Key
end
Space.Network.SubscribeToNetwork("AKey", OnReceiveFunction)
```
##### Message[β](#message "Direct link to Message")
Table **Message** `get`
*The contents of this message.*
* Lua
```lua
function OnReceiveFunction(receivedMessage)
local tableMessage = receivedMessage.Message
end
Space.Network.SubscribeToNetwork("AKey", OnReceiveFunction)
```
---
### SPhotos
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------ |
| SResource [**GetUploadedTexture** ](/scripting/client-scripting-api-reference/network/sphotos.md#getuploadedtexture)() |
| void [**GetSavedTexture** ](/scripting/client-scripting-api-reference/network/sphotos.md#getsavedtexture)(string path, Closure onComplete) |
| Table [**GetInventoryTextures** ](/scripting/client-scripting-api-reference/network/sphotos.md#getinventorytextures)() |
| void [**OpenUploadFileBrowser** ](/scripting/client-scripting-api-reference/network/sphotos.md#openuploadfilebrowser)() |
| void [**OnUploadEnd** ](/scripting/client-scripting-api-reference/network/sphotos.md#onuploadend)(Closure c) |
| void [**OnUploadStart** ](/scripting/client-scripting-api-reference/network/sphotos.md#onuploadstart)(Closure c) |
#### Functions[β](#functions "Direct link to Functions")
##### GetUploadedTexture[β](#getuploadedtexture "Direct link to GetUploadedTexture")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **GetUploadedTexture** ()
*Function Description*
* Lua
```lua
resourceTexture = Space.Photos.GetUploadedTexture()
```
##### GetSavedTexture[β](#getsavedtexture "Direct link to GetSavedTexture")
void **GetSavedTexture** (string path, Closure onComplete)
*Function Description*
| Parameter | Type | Description |
| ---------- | ------------------ | -------------------------------------------------------------------------------------------- |
| path | string | |
| onComplete | Closure (Callback) | Closure will be called once the saved texture has been retrieved. onComplete(SResource) |
* Lua
```lua
function onComplete(SResource)
resourceTexture = SResource
end
Space.Photos.GetSavedTexture('APath', onComplete)
```
##### GetInventoryTextures[β](#getinventorytextures "Direct link to GetInventoryTextures")
Table **GetInventoryTextures** ()
*Function Description*
* Lua
```lua
tableInventoryTexture = Space.Photos.GetInventoryTextures()
```
##### OpenUploadFileBrowser[β](#openuploadfilebrowser "Direct link to OpenUploadFileBrowser")
void **OpenUploadFileBrowser** ()
*Opens a window that let's you select a file you wish to upload. (white-label)*
* Lua
```lua
Space.Photos.OpenUploadFileBrowser()
```
* Lua
```lua
--this script will open a file upload browser when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
Space.Photos.OpenUploadFileBrowser()
end
thisObject.AddClickable()
thisObject.Clickable.Tooltip = "Click me to upload photo"
thisObject.Clickable.OnClick(OnClickFunction)
```
##### OnUploadEnd[β](#onuploadend "Direct link to OnUploadEnd")
void **OnUploadEnd** (Closure c)
**Binds the function c to be called when an upload operation ends.**
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function c()
--
end
Space.Photos.OnUploadEnd(c)
```
* Lua
```lua
--this script will show a text on screen that says "Uploading..." when a photo upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."
function OnUploadStartFunction()
textObject.Active = true
end
function OnUploadEndFunction()
textObject.Active = false
end
Space.Photos.OnUploadStart(OnUploadStartFunction)
Space.Photos.OnUploadEnd(OnUploadEndFunction)
```
##### OnUploadStart[β](#onuploadstart "Direct link to OnUploadStart")
void **OnUploadStart** (Closure c)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function c()
--
end
Space.Photos.OnUploadStart(c)
```
* Lua
```lua
--this script will show a text on screen that says "Uploading..." when a photo upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."
function OnUploadStartFunction()
textObject.Active = true
end
function OnUploadEndFunction()
textObject.Active = false
end
Space.Photos.OnUploadStart(OnUploadStartFunction)
Space.Photos.OnUploadEnd(OnUploadEndFunction)
```
---
### SVideos
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------- |
| Table [**GetInventoryVideos** ](/scripting/client-scripting-api-reference/network/svideos.md#getinventoryvideos)() |
| void [**OpenUploadFileBrowser** ](/scripting/client-scripting-api-reference/network/svideos.md#openuploadfilebrowser)() |
| void [**OnUploadEnd** ](/scripting/client-scripting-api-reference/network/svideos.md#onuploadend)(Closure c) |
| void [**OnUploadStart** ](/scripting/client-scripting-api-reference/network/svideos.md#onuploadstart)(Closure c) |
#### Functions[β](#functions "Direct link to Functions")
##### GetInventoryVideos[β](#getinventoryvideos "Direct link to GetInventoryVideos")
Table **GetInventoryVideos** ()
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableInventoryVideos = Space.Videos.GetInventoryVideos()
```
##### OpenUploadFileBrowser[β](#openuploadfilebrowser "Direct link to OpenUploadFileBrowser")
void **OpenUploadFileBrowser** ()
*Opens a window that let's you select a file you wish to upload. (white-label)*
* Lua
```lua
Space.Videos.OpenUploadFileBrowser()
```
* Lua
```lua
--this script will open a video upload window when clicked
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
Space.Videos.OpenUploadFileBrowser()
end
thisObject.AddClickable()
thisObject.Clickable.Tooltip = "Click me to upload video"
thisObject.Clickable.OnClick(OnClickFunction)
```
##### OnUploadEnd[β](#onuploadend "Direct link to OnUploadEnd")
void **OnUploadEnd** (Closure c)
*Binds the function c to be called when an upload operation ends.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OnUploadEndFunction()
--
end
Space.Videos.OnUploadEnd(OnUploadEndFunction)
```
* Lua
```lua
--this script will show a text on screen that says "Uploading..." when a video upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."
function OnUploadStartFunction()
textObject.Active = true
end
function OnUploadEndFunction()
textObject.Active = false
end
Space.Videos.OnUploadStart(OnUploadStartFunction)
Space.Videos.OnUploadEnd(OnUploadEndFunction)
```
##### OnUploadStart[β](#onuploadstart "Direct link to OnUploadStart")
void **OnUploadStart** (Closure c)
*Binds the function c to be called when an upload operation begins.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OnUploadStartFunction()
--
end
Space.Videos.OnUploadStart(OnUploadStartFunction)
```
* Lua
```lua
--this script will show a text on screen that says "Uploading..." when a video upload is initiated
--and will hide it when the upload has ended
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") --add a UIText object to References in Scripting Runtime
textObject.UIText.Text = "Uploading..."
function OnUploadStartFunction()
textObject.Active = true
end
function OnUploadEndFunction()
textObject.Active = false
end
Space.Videos.OnUploadStart(OnUploadStartFunction)
Space.Videos.OnUploadEnd(OnUploadEndFunction)
```
---
### SWebService
#### Set up your web service[β](#set-up-your-web-service "Direct link to Set up your web service")
To setup your server for communication with space, in the root of your domain, on the port you are using, place a file named 'sinewave.space.scripting.txt' containing 'SPACE\_OK'. E.g. - if this file is not present, you will be unable to use scripting to communicate with the domain. *Note: you should use HTTPS for all API calls. You may also need to implement a CORS policy in your webserver headers.*
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Get**](/scripting/client-scripting-api-reference/network/swebservice.md#get) (string url, Closure onComplete, Table headers=null, float timeout=0) |
| void [**Post** ](/scripting/client-scripting-api-reference/network/swebservice.md#post)(string url, string data, Closure onComplete, Table headers=null, float timeout=0) |
| SResource [**GetImage** ](/scripting/client-scripting-api-reference/network/swebservice.md#getimage)(string url, Closure onComplete=null, Table header=null, float timeout=0) |
#### Functions[β](#functions "Direct link to Functions")
##### Get[β](#get "Direct link to Get")
void **Get** (string url, Closure onComplete, Table headers=null, float timeout=0)
*Performs an HTTP\[S] GET and invokes the callback with an* [SWebResponse](/scripting/client-scripting-api-reference/types/swebresponse.md) *containing the result.*
| Parameter | Type | Description |
| ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------ |
| url | string | The absolute URL to request. Must pass the domain whitelist check. |
| onComplete | Closure | Callback receiving a single [SWebResponse](/scripting/client-scripting-api-reference/types/swebresponse.md). |
| headers | Table (optional) | Supported keys: `Content-Type`, `Bearer` (maps to `Authorization: Bearer `). |
| timeout | float (optional) | Timeout in seconds. `0` disables timeout. |
* Lua
```lua
function OnResponseFunction(responseData)
--
end
Space.WebServices.Get('A URL', OnResponseFunction)
```
* Lua
```lua
-- Example: Retrieve user-specific data from your integration endpoint
-- Typically retrieved dynamically, e.g., from Space.Scene.CurrentUser
local userID = "User123"
-- Identifier for the integrated service or application
local serviceID = "CRMApp"
-- Build the request URL with query parameters
local sentData = "http://www.yourdomain.net/getIntegrationData.php?id=" .. userID .. "&service=" .. serviceID
-- Callback function to handle the API response
local response = function(data)
if data.Error == nil then
-- Log the successful response
Space.Log(data.Response)
else
-- Log any error returned by the API
Space.Log(data.Error)
end
end
-- Make a GET request to your integration API
Space.WebServices.Get(sentData, response)
-- You can parse the response to extract and use relevant integration data
```
Note:
* This call automatically sends diagnostic headers: `X-Sinespace-Region-ID`, `X-Sinespace-Region-Name`, `X-Sinespace-Instance-ID`, `X-Sinespace-Script-Name`, `X-Sinespace-Runtime-Type`, `X-Sinespace-In-Editor`, and `X-Sinespace-Preview-Server`.
* Domains must host `/sinewave.space.scripting.txt` with the content `SPACE_OK` at the root for requests to proceed (see setup above).
##### Post[β](#post "Direct link to Post")
void **Post** (string url, string data, Closure onComplete, Table headers=null, float timeout=0)
*Performs an HTTP\[S] POST and invokes the callback with an* [SWebResponse](/scripting/client-scripting-api-reference/types/swebresponse.md) *containing the result.*
| Parameter | Type | Description |
| ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| url | string | The absolute URL to POST to. Must pass the domain whitelist check. |
| data | string | Request body. For JSON, provide a JSON string and set `Content-Type` accordingly. |
| onComplete | Closure | Callback receiving a single [SWebResponse](/scripting/client-scripting-api-reference/types/swebresponse.md). |
| headers | Table (optional) | Supported keys: `Content-Type` (defaults to `application/x-www-form-urlencoded`), `Bearer` (maps to `Authorization: Bearer `). |
| timeout | float (optional) | Timeout in seconds. `0` disables timeout. |
* Lua
```lua
function OnResponseFunction(responseData)
--
end
local url = 'https://example.com/endpoint'
local data = 'key=value'
Space.WebServices.Post(url, data, OnResponseFunction)
```
* Lua
```lua
-- Example: Send user-specific data to your integration endpoint via POST request
-- User identifier, typically retrieved dynamically
local userID = "User123"
-- Identifier for the integrated service or product
local serviceID = "CRMApp"
-- Target URL for the integration API
local url = "http://www.yourdomain.net/postIntegrationData.php"
-- Construct the payload for the POST request
local sentData = "id=" .. userID .. "&service=" .. serviceID
-- Define a callback to handle the API response
local response = function(data)
if data.Error == nil then
-- Log the successful response
Space.Log(data.Response)
else
-- Log any error returned by the API
Space.Log(data.Error)
end
end
-- Set the appropriate content-type for the POST request
local tableHeader = {["Content-Type"] = "text/plain"}
-- Send a POST request to your integration API
Space.WebServices.Post(url, sentData, response, tableHeader)
```
* Lua
```lua
-- JSON POST with Bearer auth and timeout
local url = "https://api.example.com/widgets"
local body = '{"name":"My Widget","color":"blue"}'
local headers = { ["Content-Type"] = "application/json", ["Bearer"] = "YOUR_ACCESS_TOKEN" }
Space.WebServices.Post(url, body, function(data)
if data.Error == nil then
Space.Log("Created: " .. data.Response)
else
Space.Log("Error: " .. data.Error)
end
end, headers, 15)
```
Note:
* For JSON: set `Content-Type = application/json` and send a JSON string body.
* The target domain must pass the whitelist check (`/sinewave.space.scripting.txt` with `SPACE_OK`).
* HTTPS is recommended; ensure the server sends appropriate CORS headers.
##### GetImage[β](#getimage "Direct link to GetImage")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **GetImage** (string url, Closure onComplete=null, Table header=null, float timeout=0)
*Returns a valid* [*SResource*](/scripting/client-scripting-api-reference/types/sresource.md) *for a image on a remote domain that can be used via e.g.* [*SMaterial*](/scripting/client-scripting-api-reference/types/smaterial.md)*. While the image loads, it will be a white pixel that will be substituted with the real image once loaded.*
| Parameter | Type | Description |
| ---------- | ------------------ | ----------------------------------------------------------------------------------------------------------- |
| url | string | The absolute image URL to load. |
| onComplete | Closure (optional) | Callback receiving the resulting [SResource](/scripting/client-scripting-api-reference/types/sresource.md). |
| header | Table (optional) | Accepted but not used for images; pass `nil`. Reserved for future use. |
| timeout | float (optional) | Accepted but not used for images; pass `0`. Reserved for future use. |
* Lua
```lua
resourceImage = Space.WebServices.GetImage('An Image URL')
```
* Lua
```lua
-- Example: Load and apply a remote image from your integration media server
-- Image filename to retrieve from the media service
local imageFileName = "user_banner_1024.jpg"
-- Base URL of the content delivery server
local mediaServerUrl = "https://cdn.acme-integrations.com/assets/"
-- Reference to the 3D object where the image will be displayed
local displayObject = Space.Host.GetReference("profileDisplay")
-- Fetch the image from the server
local imageResource = Space.WebServices.GetImage(mediaServerUrl .. imageFileName)
-- Apply the image as a texture to the object's material
displayObject.Renderer.Material.SetTexture("_MainTex", imageResource)
```
---
### Player
APIs for the local player β profile, inventory, in-world economy, group membership, and quest progress.
---
### SEconomy
#### SEconomy[β](#seconomy-1 "Direct link to SEconomy")
##### API Keys[β](#api-keys "Direct link to API Keys")
The SEconomy class gives us the ability to transfer silver or issue silver rewards from Sinespace's vault. Therefore, for the below methods to work, you will need to first set the AcessKey which is an API Key given by Sinespace.
To request an API Key, [please submit a support ticket.](https://support.sine.space/support/home)
Here's two API Keys which are pre-generated and available to the public:
b9184836-9c73-486a-b058-a0a668b860f7 Maximum 5000 silver per 24 hours per user, AND allows up to 5000 to be deducted as well. Works only on Preview.
11f55b74-69ee-4dd3-8983-17c466912beb Maximum 500 silver per 24 hours per user. Works on Preview or Live.
Note: The above two keys work with DeductSilver() and AddSilver(). You'll need an API Key which has your specific required function enabled.
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**DeductSilver** ](seconomy#deductsilver)(int amount, Action< bool > onFinished=null) void [**DeductSilver** ](seconomy#deductsilver)(int amount, Closure onFinished=null) |
| void [**AddSilver** ](seconomy#addsilver)(int amount, Action< bool > onFinished=null) void [**AddSilver** ](seconomy#addsilver)(int amount, Closure onFinished=null) |
| void [**TransferSilverFrom** ](seconomy#transfersilverfrom)(int amount, string reason, int to, Action< bool > onFinished=null) void [**TransferSilverFrom** ](seconomy#transfersilverfrom)(int amount, string reason, int to, Closure onFinished=null) |
| void [**IssueReward** ](seconomy#issuereward)(int id, Action< bool > onFinished=null) void [**IssueReward** ](seconomy#issuereward)(int id, Closure onFinished=null) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------- |
| string **AccessKey** `set` |
#### Functions[β](#functions "Direct link to Functions")
##### DeductSilver[β](#deductsilver "Direct link to DeductSilver")
void **DeductSilver** (int amount, Action< bool > onFinished=null) void **DeductSilver** (int amount, Closure onFinished=null)
*Deducts amount of silver from player's silver balance. You can also bind a function which will be called when operation is finished (optional), which also returns a Boolean if the operation succeeded or not (for example, API Key limit reached). This method requires AccessKey to be set first.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function onFinished(success)
--
end
Space.Economy.DeductSilver(50, onFinished)
--or
Space.Economy.DeductSilver(50)
```
* Lua
```lua
--the below script will deduct 50 silver from the person who clicks the object containing it
--(Example: A ticket vendor that requires 50 silver to proceed)
--[The AccessKey we are using below is for preview servers only]
thisGameObject = Space.Host.ExecutingObject
Space.Economy.AccessKey = "b9184836-9c73-486a-b058-a0a668b860f7"
OnPaymentDone = function(success)
if success then
Space.Log("You have paid 50 silver. Please proceed.")
else
Space.Log("Failed. AccessKey limit may have been reached")
end
end
OnClick = function()
Space.Economy.DeductSilver(50, OnPaymentDone)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Buy ticket (50 silver)"
thisGameObject.Clickable.OnClick(OnClick)
```
##### AddSilver[β](#addsilver "Direct link to AddSilver")
void **AddSilver** (int amount, Action< bool > onFinished=null) void **AddSilver** (int amount, Closure onFinished=null)
*Adds amount of silver to player's silver balance. You can also bind a function which will be called when operation is finished (optional), which also returns a Boolean if the operation succeeded or not (for example, API Key limit reached). The source of the silver is Sinespace. This method requires AccessKey to be set first.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function onFinished(success)
--
end
Space.Economy.AddSilver(50, onFinished)
--or
Space.Economy.AddSilver(50)
```
* Lua
```lua
--the below script will deduct 50 silver from the person who clicks the object containing it
--(Example: A ticket vendor that requires 50 silver to proceed)
--[The AccessKey we are using below is for preview servers only]
thisGameObject = Space.Host.ExecutingObject
Space.Economy.AccessKey = "b9184836-9c73-486a-b058-a0a668b860f7"
OnPaymentDone = function(success)
if success then
Space.Log("You have paid 50 silver. Please proceed.")
else
Space.Log("Failed. AccessKey limit may have been reached")
end
end
OnClick = function()
Space.Economy.DeductSilver(50, OnPaymentDone)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Buy ticket (50 silver)"
thisGameObject.Clickable.OnClick(OnClick)
```
##### TransferSilverFrom[β](#transfersilverfrom "Direct link to TransferSilverFrom")
void **TransferSilverFrom** (int amount, string reason, int to, Action< bool > onFinished=null) void **TransferSilverFrom** (int amount, string reason, int to, Closure onFinished=null)
*Removes 'amount' of silver from player avatar's balance and sends it to 'to' avatar ID. You can also bind a function which will be called when operation is finished (optional), which also returns a Boolean if the operation succeeded or not (for example, API Key limit reached). This method requires AccessKey to be set first.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function onFinished(success)
--
end
Space.Economy.TransferSilverFrom(10, "A reason", 23239829,onFinished)
--or
Space.Economy.TransferSilverFrom(10, "A reason", 23239829)
```
* Lua
```lua
--the below script will make the object a clickable that gives 10 silver to another avatar
--(Example: Silver transfer)
--[The AccessKey we are using below is for preview servers only. Please read the API Keys section above.]
thisGameObject = Space.Host.ExecutingObject
Space.Economy.AccessKey = "b9184836-9c73-486a-b058-a0a668b860f7"
done = function(success)
if success then
Space.Log("10 Silver sent")
else
Space.Log("failed")
end
end
OnClick = function()
local avatars=Space.Scene.Avatars
Space.Economy.TransferSilverFrom(10, "testing", avatars[1].ID, done)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### IssueReward[β](#issuereward "Direct link to IssueReward")
void **IssueReward** (int id, Action< bool > onFinished=null) void **IssueReward** (int id, Closure onFinished=null)
*Issues reward 'id' to player Avatar. You can also bind a function which will be called when operation is finished (optional), which also returns a Boolean if the operation succeeded or not (for example, API Key limit reached). This method requires AccessKey to be set first. *(white-label grid only)**
| Parameter | Type | Description |
| ---------- | -------------- | ------------------------------------------------------------------------------------------------------------- |
| id | int | The ID of the reward to player avatar. |
| onFinished | Action< bool > | A function name that will be called with a boolean parameter that tells us if the operation succeeded or not. |
* Lua
```lua
function onFinished(success) --success parameter is optional here
Space.Log(success)
end
Space.Economy.IssueReward(12345,onFinished)
--or
Space.Economy.IssueReward(12345)
```
#### Properties[β](#properties "Direct link to Properties")
##### AcessKey[β](#acesskey "Direct link to AcessKey")
string **AccessKey** `set`
*This API Key needs to be set before any of the SEconomy functions will work.*
[*Read API Keys Section*](/scripting/client-scripting-api-reference/player/seconomy.md#api-keys)
* Lua
```lua
Space.Economy.AccessKey = "b9184836-9c73-486a-b058-a0a668b860f7"
```
---
### SGroup
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------- |
| bool [**IsMemberOf** ](/scripting/client-scripting-api-reference/player/sgroup.md#ismemberof)(int groupID) |
| SGroupInfo [**GetGroupInfo** ](/scripting/client-scripting-api-reference/player/sgroup.md#getgroupinfo)(int groupID) |
| void [**JoinGroup** ](/scripting/client-scripting-api-reference/player/sgroup.md#joingroup)(int groupID, bool force=false) |
| void [**LeaveGroup** ](/scripting/client-scripting-api-reference/player/sgroup.md#leavegroup)(int groupID, bool force=false) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------------------- |
| SGroupInfo\[] [**Membership** ](/scripting/client-scripting-api-reference/player/sgroup.md#propertyname)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### IsMemberOf[β](#ismemberof "Direct link to IsMemberOf")
bool **IsMemberOf** (int groupID)
*Whether is a member of this group.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
IsMember = Space.Groups.IsMemberOf(675)
```
* Lua
```lua
--Clicking this object will check if player is a member of group with ID 350
--and it will turn green if you are, or red turn if you are not
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
if Space.Groups.IsMemberOf(350) then
thisObject.Renderer.Material.SetColor("_Color", Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color", Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### GetGroupInfo[β](#getgroupinfo "Direct link to GetGroupInfo")
[SGroupInfo](/scripting/client-scripting-api-reference/types/sgroupinfo.md) **GetGroupInfo** (int groupID)
*Get the group info by groupID.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
groupInfo = Space.Groups.GetGroupInfo(675)
```
* Lua
```lua
--Clicking this object will turn green if your in group 350 is "Owner"
--and red if your role is not "Owner"
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
local groupInfo = Space.Groups.GetGroupInfo(350)
if groupInfo.Role == "Owner" then
thisObject.Renderer.Material.SetColor("_Color", Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color", Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### JoinGroup[β](#joingroup "Direct link to JoinGroup")
void **JoinGroup** (int groupID, bool force=false)
*Shows player a prompt to join specified group. If force is true, the user will not be shown a prompt. (force parameter is white-label only)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Groups.JoinGroup(675)
```
* Lua
```lua
--Clicking this object will check if player is in group 350
--and will prompt the player to leave if they are a member
--and will prompt them to join if they are not a member
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
if Space.Groups.IsMemberOf(350) then
Space.Groups.LeaveGroup(350)
else
Space.Groups.JoinGroup(350)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### LeaveGroup[β](#leavegroup "Direct link to LeaveGroup")
void **LeaveGroup** (int groupID, bool force=false)
*Shows player a prompt to leave specified group. If force is true, the user will not be shown a prompt. (force parameter is white-label only)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Groups.LeaveGroup(675)
```
* Lua
```lua
--Clicking this object will check if player is in group 350
--and will prompt the player to leave if they are a member
--and will prompt them to join if they are not a member
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
if Space.Groups.IsMemberOf(350) then
Space.Groups.LeaveGroup(350)
else
Space.Groups.JoinGroup(350)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### Membership[β](#membership "Direct link to Membership")
[SGroupInfo](/scripting/client-scripting-api-reference/types/sgroupinfo.md)\[] **Membership** `get`
*Return an array with all the groups this player is a member of*
* Lua
```lua
groups = Space.Groups.Membership
```
* Lua
```lua
--Clicking this object will turn green if you are in at least 1 group
--and red if you are in no groups
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
local groups = Space.Groups.Membership
if #groups > 0 then
thisObject.Renderer.Material.SetColor("_Color", Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color", Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
---
### SInventory
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Authorize** ](/scripting/client-scripting-api-reference/player/sinventory.md#authorize)(Closure onAuthorized=null, Closure onRejected=null) |
| int [**CountCopiesOfItem** ](/scripting/client-scripting-api-reference/player/sinventory.md#countcopiesofitem)(int itemID) |
| void [**AddToHotbar** ](/scripting/client-scripting-api-reference/player/sinventory.md#addtohotbar)(int index, int itemID) |
| void [**RemoveFromHotbar** ](/scripting/client-scripting-api-reference/player/sinventory.md#removefromhotbar)(int index) |
| void [**RequestRefresh** ](/scripting/client-scripting-api-reference/player/sinventory.md#requestrefresh)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------- |
| bool [**Authorized** ](/scripting/client-scripting-api-reference/player/sinventory.md#authorized)`get` |
| SInventoryItem\[] [**Items** ](/scripting/client-scripting-api-reference/player/sinventory.md#items)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Authorize[β](#authorize "Direct link to Authorize")
void **Authorize** (Closure onAuthorized=null, Closure onRejected=null)
*Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Inventory.Authorize()
--or
Space.Inventory.Authorize(onAuth, onRej)
```
* Lua
```lua
--this script shows you how to use this function to take authorization and immediately
--take action based on the result all in a single prompt (a click in this case)
function ifno()
Space.Log("not authorized")
end
function ifyes()
Space.Log("authorized")
--your next steps go here
end
function click()
Space.Inventory.Authorize(ifyes,ifno)
end
Space.Host.ExecutingObject.AddClickable()
Space.Host.ExecutingObject.Clickable.OnClick(click)
```
##### CountCopiesOfItem[β](#countcopiesofitem "Direct link to CountCopiesOfItem")
int **CountCopiesOfItem** (int itemID)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
numOfCopies = Space.Inventory.CountCopiesOfItem(38384839)
```
##### AddToHotbar[β](#addtohotbar "Direct link to AddToHotbar")
void **AddToHotbar** (int index, int itemID)
*Adds the first found instance of itemID to the players hotbar entry at slot 'index'.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Inventory.AddToHotbar(2, 23423523)
```
##### RemoveFromHotbar[β](#removefromhotbar "Direct link to RemoveFromHotbar")
void **RemoveFromHotbar** (int index)
*Remove item at slot index from Hotbar*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Inventory.RemoveFromHotbar(2)
```
##### RequestRefresh[β](#requestrefresh "Direct link to RequestRefresh")
void **RequestRefresh** ()
*Forces a check for external changes to the users inventory, can only be called once every 60 seconds*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Inventory.RequestRefresh()
```
#### Properties[β](#properties "Direct link to Properties")
##### Authorized[β](#authorized "Direct link to Authorized")
bool **Authorized** `get`
*Returns true if player has accepted access authorization request to his inventory*
* Lua
```lua
isAuthorized = Space.Inventory.Authorized
```
##### Items[β](#items "Direct link to Items")
[SInventoryItem](/scripting/client-scripting-api-reference/types/sinventoryitem.md)\[] **Items** `get`
*Returns the array of the users current inventory items*
* Lua
```lua
invItems = Space.Inventory.Items
```
---
### SProfile
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Authorize** ](sprofile#authorize)(Closure onAuthorized=null, Closure onRejected=null) void [**Authorize** ](sprofile#authorize)(Action onAuthorized=null, Action onRejected=null) |
| void [**LoadProfile** ](sprofile#authorize-1)(Action< SUserProfile > onFinished) void [**LoadProfile** ](sprofile#authorize-1)(Closure onFinished) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| SUserProfile [**ActivePlayerProfile** ](/scripting/client-scripting-api-reference/player/sprofile.md#activeplayerprofile)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Authorize[β](#authorize "Direct link to Authorize")
void **Authorize** (Closure onAuthorized=null, Closure onRejected=null) void **Authorize** (Action onAuthorized=null, Action onRejected=null)
*Requests access to profile functions, must be called prior to attempting to access profile. As soon as the player has accepted the request, the Authorized attribute will be 'true'.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Profile.Authorize()
--or
Space.Profile.Authorize(AnOnAuthorizeFunction)
--or
Space.Profile.Authorize(AnOnAuthorizeFunction, AnOnRejectedFuncton)
```
##### LoadProfile[β](#loadprofile "Direct link to LoadProfile")
void **LoadProfile** (Closure onFinished)
*Load the profile of player*
| Parameter | Type | Description |
| ---------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| onFinished | Callback Function | onFinished([SUserProfile](/scripting/client-scripting-api-reference/types/suserprofile.md)) is called once profile is loaded |
* Lua
```lua
function onFinished(SUserProfile)
--
end
Space.Profile.LoadProfile(onFinished)
```
#### Properties[β](#properties "Direct link to Properties")
##### ActivePlayerProfile[β](#activeplayerprofile "Direct link to ActivePlayerProfile")
[SUserProfile](/scripting/client-scripting-api-reference/types/suserprofile.md) **ActivePlayerProfile** `get`
*Property Description*
* Lua
```text
Space.Profile.ActivePlayerProfile
```
---
### SQuests
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------- |
| void [**StartQuest** ](/scripting/client-scripting-api-reference/player/squests.md#startquest)(int id) |
| int [**GetQuestStep** ](/scripting/client-scripting-api-reference/player/squests.md#getqueststep)(int questID) |
| void [**ResetQuest** ](/scripting/client-scripting-api-reference/player/squests.md#resetquest)(int id) |
| void [**SetQuestStep** ](/scripting/client-scripting-api-reference/player/squests.md#setqueststep)(int questID, int step) |
| void [**CompleteQuest** ](/scripting/client-scripting-api-reference/player/squests.md#completequest)(int questID) |
| void [**AbortQuest** ](/scripting/client-scripting-api-reference/player/squests.md#abortquest)(int id) |
| void [**AwardAchievement** ](/scripting/client-scripting-api-reference/player/squests.md#awardachievement)(int id) |
| bool [**HasAchievement** ](/scripting/client-scripting-api-reference/player/squests.md#hasachievement)(int id) |
#### Functions[β](#functions "Direct link to Functions")
##### StartQuest[β](#startquest "Direct link to StartQuest")
void **StartQuest** (int id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Quests.StartQuest(1001211)
```
##### GetQuestStep[β](#getqueststep "Direct link to GetQuestStep")
int **GetQuestStep** (int questID)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
currentStep = Space.Quests.GetQuestStep(1001211)
```
##### ResetQuest[β](#resetquest "Direct link to ResetQuest")
void **ResetQuest** (int id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Quests.ResetQuest(1001211)
```
##### SetQuestStep[β](#setqueststep "Direct link to SetQuestStep")
void **SetQuestStep** (int questID, int step)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Quests.SetQuestStep(1001211, 5)
```
##### CompleteQuest[β](#completequest "Direct link to CompleteQuest")
void **CompleteQuest** (int questID)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Quests.CompleteQuest(1001211)
```
##### AbortQuest[β](#abortquest "Direct link to AbortQuest")
void **AbortQuest** (int id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Quests.AbortQuest(1001211)
```
##### AwardAchievement[β](#awardachievement "Direct link to AwardAchievement")
void **AwardAchievement** (int id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Quests.AwardAchievement(1001211)
```
##### HasAchievement[β](#hasachievement "Direct link to HasAchievement")
bool **HasAchievement** (int id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
hasAchievement = Space.Quests.AwardAchievement(1001211)
```
---
### Scene
APIs for the region a script runs in β the scene itself, cameras, physics, rendering and post-processing, persistence, and grid-level settings.
---
### SCameraManager
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**LockCamera** ](/scripting/client-scripting-api-reference/region/scameramanager.md#lockcamera)(SGameObject owner) |
| void [**ReleaseCamera** ](/scripting/client-scripting-api-reference/region/scameramanager.md#releasecamera)() |
| void [**SetCameraPositionOrientation** ](/scripting/client-scripting-api-reference/region/scameramanager.md#setcamerapositionorientation)(SVector position, SQuaternion orientation) |
| SRay [**ScreenCoordinatesToRay** ](/scripting/client-scripting-api-reference/region/scameramanager.md#screencoordinatestoray)(SVector screenCoordinates) |
| SVector [**ScreenCoordinatesToWorld** ](/scripting/client-scripting-api-reference/region/scameramanager.md#screencoordinatestoworld)(SVector screenCoordinates) |
| SVector [**WorldCoordinatesToScreen** ](/scripting/client-scripting-api-reference/region/scameramanager.md#worldcoordinatestoscreen)(SVector coordinates) |
| void [**ShakeCamera** ](scameramanager#shakecamera)(float magnitude, float time) void [**ShakeCamera** ](scameramanager#shakecamera)(float amplitude, float frequency, float time) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------------------------------------ |
| bool [**IsLocked** ](/scripting/client-scripting-api-reference/region/scameramanager.md#propertyname)`get` |
| SGameObject [**MainCamera** ](/scripting/client-scripting-api-reference/region/scameramanager.md#propertyname-1)`get` |
| SGameObject [**ActiveVirtualCamera** ](/scripting/client-scripting-api-reference/region/scameramanager.md#propertyname-2)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### IsLocked[β](#islocked "Direct link to IsLocked")
bool **IsLocked** `get`
Is the Camera locked?
* Lua
```lua
isCameraLocked = Space.Camera.IsLocked
```
##### MainCamera[β](#maincamera "Direct link to MainCamera")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **MainCamera** `get`
*Note, this property is generally read-only. It's position is driven by internal code.*
* Lua
```lua
mainCamera = Space.Camera.MainCamera
```
##### ActiveVirtualCamera[β](#activevirtualcamera "Direct link to ActiveVirtualCamera")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **ActiveVirtualCamera** `get`
*The currently active Cinemachine Virtual Camera game object.*
* Lua
```lua
currentCamera = Space.Camera.ActiveVirtualCamera
```
#### Functions[β](#functions "Direct link to Functions")
##### LockCamera[β](#lockcamera "Direct link to LockCamera")
void **LockCamera** ()
*Calling this function stops the Camera from being controlled by the viewer, and allows us to control it until* [*ReleaseCamera()*](/scripting/client-scripting-api-reference/region/scameramanager.md#releasecamera) *is called.*
* Lua
```lua
Space.Camera.LockCamera()
```
##### ReleaseCamera[β](#releasecamera "Direct link to ReleaseCamera")
void **ReleaseCamera** ()
*Calling this function reverses the* [*LockCamera()*](/scripting/client-scripting-api-reference/region/scameramanager.md#lockcamera) *call and returns control of the Camera to the viewer.*
* Lua
```lua
Space.Camera.ReleaseCamera()
```
##### SetCameraPositionOrientation[β](#setcamerapositionorientation "Direct link to SetCameraPositionOrientation")
void **SetCameraPositionOrientation** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position, [SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) orientation)
*Sets the Camera's position and rotation. This function requires* [*t*he camera to be locked.](/scripting/client-scripting-api-reference/region/scameramanager.md#lockcamera)
| Parameter | Type | Description |
| ----------- | ----------------------------------------------------------------------------- | -------------------------------------------- |
| position | [SVector](/scripting/client-scripting-api-reference/types/svector.md) | The World Postion of the camera GameObject. |
| orientation | [SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) | The World Rotation of the camera GameObject. |
* Lua
```lua
Space.Camera.SetCameraPositionOrientation (Vector.New(0,0,0),Quaternion.Euler(-60,0,0));
```
##### ScreenCoordinatesToRay[β](#screencoordinatestoray "Direct link to ScreenCoordinatesToRay")
[SRay ](/scripting/client-scripting-api-reference/types/sray.md)**ScreenCoordinatesToRay** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) screenCoordinates)
*Returns a ray going from camera through a screen point.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
cameraRay = Space.Camera.ScreenCoordinatesToRay (Vector.New(0,50,0))
```
* Lua
```lua
--this script will make this object jump to wherever you right click
--(Example: moving objects with right click )
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseDown(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### ScreenCoordinatesToWorld[β](#screencoordinatestoworld "Direct link to ScreenCoordinatesToWorld")
[SVector ](/scripting/client-scripting-api-reference/types/svector.md)**ScreenCoordinatesToWorld** ([SVector ](/scripting/client-scripting-api-reference/types/svector.md)screenCoordinates)
*Transforms a point from screen space into world space.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
obj = Space.Host.ExecutingObject;
Space.Log(Space.Camera.ScreenCoordinatesToWorld(Vector.New(0.5,0.5,0)).ToString());
-- Print 3 worldspace vectors created by screen space point to the console.
```
##### WorldCoordinatesToScreen[β](#worldcoordinatestoscreen "Direct link to WorldCoordinatesToScreen")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **WorldCoordinatesToScreen** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) coordinates)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local trans = Space.Host.ExecutingObject;
Space.Log(Space.Camera.WorldCoordinatesToScreen(trans.WorldPosition).ToString());
-- Print the position created by world space point to the console.
```
##### ShakeCamera[β](#shakecamera "Direct link to ShakeCamera")
void **ShakeCamera** (float magnitude, float time) void **ShakeCamera** (float amplitude, float frequency, float time)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Camera.ShakeCamera(1, 1.0)
--or
Space.Camera.ShakeCamera(2, 1, 1.0)
```
---
### SGrid
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**GetEnabledUserRegions** ](/scripting/client-scripting-api-reference/region/sgrid.md#getenableduserregions)(Closure onComplete) |
| void [**GetRegionTexture** ](sgrid#getregiontexture)(SPublicRegion region, Closure onComplete) void [**GetRegionTexture** ](sgrid#getregiontexture)(string json, Closure onComplete) |
| void [**GetOutfits** ](/scripting/client-scripting-api-reference/region/sgrid.md#getoutfits)(Closure onComplete) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------- |
| bool [**IsWhiteLabel** ](/scripting/client-scripting-api-reference/region/sgrid.md#iswhitelabel)`get` |
| bool [**PlayerIsAdmin** ](/scripting/client-scripting-api-reference/region/sgrid.md#playerisadmin)`get` |
| bool [**PlayerIsModerator** ](/scripting/client-scripting-api-reference/region/sgrid.md#playerismoderator)`get` |
| bool [**PlayerIsDeveloper** ](/scripting/client-scripting-api-reference/region/sgrid.md#playerisdeveloper)`get` |
| bool [**PlayerIsTrusted** ](/scripting/client-scripting-api-reference/region/sgrid.md#playeristrusted)`get` |
| SColor [**ThemeColor1** ](/scripting/client-scripting-api-reference/region/sgrid.md#themecolor1)`get` |
| SColor [**ThemeColor2** ](/scripting/client-scripting-api-reference/region/sgrid.md#themecolor2)`get` |
| SColor [**ThemeColor3** ](/scripting/client-scripting-api-reference/region/sgrid.md#themecolor3)`get` |
| SColor [**ThemeColor4** ](/scripting/client-scripting-api-reference/region/sgrid.md#themecolor4)`get` |
| SColor [**TextColor1** ](/scripting/client-scripting-api-reference/region/sgrid.md#textcolor1)`get` |
| SColor [**TextColor2** ](/scripting/client-scripting-api-reference/region/sgrid.md#textcolor2)`get` |
| string [**Name**](/scripting/client-scripting-api-reference/region/sgrid.md#name) `get` |
| string [**SiteURL** ](/scripting/client-scripting-api-reference/region/sgrid.md#siteurl)`get` |
| int [**DefaultRegion** ](/scripting/client-scripting-api-reference/region/sgrid.md#defaultregion)`get` |
| int\[] [**Avatars** ](/scripting/client-scripting-api-reference/region/sgrid.md#avatars)`get` |
| int [**OrientationRegion** ](/scripting/client-scripting-api-reference/region/sgrid.md#orientationregion)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetEnabledUserRegions[β](#getenableduserregions "Direct link to GetEnabledUserRegions")
void **GetEnabledUserRegions** (Closure onComplete)
*Calling this function will asynchronously get and return information about this player's regions as* [*SUserRegions.* ](/scripting/client-scripting-api-reference/types/suserregions.md)*(This is the same information in the "Region List" window).*
| Parameter | Type | Description |
| ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| onComplete | Closure (Callback) | onComplete is a function that will be called on completion with [SUserRegions ](../types/suserregions)as a parameter. onComplete(SUserRegions) |
| | | |
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
--
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
* Lua
```lua
--Make's a UIText show this Grid's current Subscription Tier
textObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting Runtime
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.SubscriptionTier
text.UIText.Text = r
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### GetRegionTexture[β](#getregiontexture "Direct link to GetRegionTexture")
void **GetRegionTexture** ([SPublicRegion ](/scripting/client-scripting-api-reference/types/spublicregion.md)region, Closure onComplete) void **GetRegionTexture** (string json, Closure onComplete)
*Returns the Region Texture (the image seen while loading the region) as a resource. This function requires an* [*SPublicRegion*](/scripting/client-scripting-api-reference/types/spublicregion.md) *object to identify which region. (white-label grids only)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Grid.GetRegionTexture(AnSPublicRegionObject,OnCompleteFunction)
--see below example
```
* Lua
```lua
--When this object is clicked, it's material becomes the Region Texture of the user's first region
thisObject = Space.Host.ExecutingObject
function GetTextureComplete(textureResource)
thisObject.Renderer.Material.SetTexture("_MainTex",textureResource)
end
function GetUserRegionsComplete(SUserRegions)
r = SUserRegions.AvailableRegions
Space.Grid.GetRegionTexture(r[1],GetTextureComplete)
end
function OnClickFunction()
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### GetOutfits[β](#getoutfits "Direct link to GetOutfits")
void **GetOutfits** (Closure onComplete)
*Calling this function will asynchronously get and return information about this player's outfits as a List of* [*SOutfit*](/scripting/client-scripting-api-reference/types/soutfit.md)*.*
| Parameter | Type | Description |
| ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onComplete | Closure (Callback) | onComplete is a function that will be called on completion with a List of [SOutfit](/scripting/client-scripting-api-reference/types/soutfit.md) as a parameter. |
* Lua
```lua
function OnGetOutfitsComplete(TableSOutfits)
--
end
Space.Grid.GetOutfits(OnGetOutfitsComplete)
```
#### Properties[β](#properties "Direct link to Properties")
##### IsWhiteLabel[β](#iswhitelabel "Direct link to IsWhiteLabel")
bool **IsWhiteLabel** `get`
*Returns true if this Grid is a white-label Grid.*
* Lua
```lua
isWhiteLabel = Space.Grid.IsWhiteLabel
```
* Lua
```lua
--Clicking this object will turn it green color if this grid is white-label
--and will turn it red color if not
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if Space.Grid.IsWhiteLabel then
thisObject.Renderer.Material.SetColor("_Color",Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color",Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### PlayerIsAdmin[β](#playerisadmin "Direct link to PlayerIsAdmin")
bool **PlayerIsAdmin** `get`
*Returns true if this player's Grid role is Admin.(white-label grid only)*
* Lua
```lua
isAdmin = Space.Grid.PlayerIsAdmin
```
* Lua
```lua
--Clicking this object will turn it green color if your grid role is Admin
--and will turn it red color if not
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if Space.Grid.PlayerIsAdmin then
thisObject.Renderer.Material.SetColor("_Color",Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color",Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### PlayerIsModerator[β](#playerismoderator "Direct link to PlayerIsModerator")
bool **PlayerIsModerator** `get`
*Returns true if this player's Grid role is Moderator. (white-label grid only)*
* Lua
```lua
isModerator = Space.Grid.PlayerIsModerator
```
* Lua
```lua
--Clicking this object will turn it green color if your grid role is Moderator
--and will turn it red color if not
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if Space.Grid.PlayerIsModerator then
thisObject.Renderer.Material.SetColor("_Color",Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color",Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### PlayerIsDeveloper[β](#playerisdeveloper "Direct link to PlayerIsDeveloper")
bool **PlayerIsDeveloper** `get`
*Returns true if this player's Grid role is Developer.(white-label grid only)*
* Lua
```lua
isDeveloper = Space.Grid.PlayerIsDeveloper
```
* Lua
```lua
--Clicking this object will turn it green color if your grid role is Developer
--and will turn it red color if not
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if Space.Grid.PlayerIsDeveloper then
thisObject.Renderer.Material.SetColor("_Color",Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color",Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### PlayerIsTrusted[β](#playeristrusted "Direct link to PlayerIsTrusted")
bool **PlayerIsTrusted** `get`
*Returns true if this player's Grid role is Trusted.(white-label grid only)*
* Lua
```lua
isTrusted = Space.Grid.PlayerIsTrusted
```
* Lua
```lua
--Clicking this object will turn it green color if your grid role is Trusted
--and will turn it red color if not
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if Space.Grid.PlayerIsTrusted then
thisObject.Renderer.Material.SetColor("_Color",Color.Green)
else
thisObject.Renderer.Material.SetColor("_Color",Color.Red)
end
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### ThemeColor1[β](#themecolor1 "Direct link to ThemeColor1")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **ThemeColor1** `get`
*The viewer's **Theme Color 1**.*
*The viewer's theme consist of 4 Theme Colors and 2 Text Colors.*
* Lua
```lua
themeColor1 = Space.Grid.ThemeColor1
```
##### ThemeColor2[β](#themecolor2 "Direct link to ThemeColor2")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **ThemeColor2** `get`
*The viewer's **Theme Color 2**.*
*The viewer's theme consist of 4 Theme Colors and 2 Text Colors.*
* Lua
```lua
themeColor2 = Space.Grid.ThemeColor2
```
##### ThemeColor3[β](#themecolor3 "Direct link to ThemeColor3")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **ThemeColor3** `get`
*The viewer's **Theme Color 3**.*
*The viewer's theme consist of 4 Theme Colors and 2 Text Colors.*
* Lua
```lua
themeColor3 = Space.Grid.ThemeColor3
```
##### ThemeColor4[β](#themecolor4 "Direct link to ThemeColor4")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **ThemeColor4** `get`
*The viewer's **Theme Color 4**.*
*The viewer's theme consist of 4 Theme Colors and 2 Text Colors.*
* Lua
```lua
themeColor4 = Space.Grid.ThemeColor4
```
##### TextColor1[β](#textcolor1 "Direct link to TextColor1")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **TextColor1** `get`
*The viewer's **Text Color 1**.*
*The viewer's theme consist of 4 Theme Colors and 2 Text Colors.*
* Lua
```lua
textColor1 = Space.Grid.TextColor1
```
##### TextColor2[β](#textcolor2 "Direct link to TextColor2")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **TextColor2** `get`
*The viewer's **Text Color 2**.*
*The viewer's theme consist of 4 Theme Colors and 2 Text Colors.*
* Lua
```lua
textColor2 = Space.Grid.TextColor2
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Returns the Grid's Name. (white-label grid only)*
* Lua
```lua
gridName = Space.Grid.Name
```
* Lua
```lua
--Clicking this object will populate a UIText field with the current Grid's Name
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("TheTextReference")
function OnClickFunction()
local gridName = Space.Grid.Name
textObject.UIText.Text = gridName
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction
```
##### SiteURL[β](#siteurl "Direct link to SiteURL")
string **SiteURL** `get`
*Returns the Grid's Site URL. (white-label grid only)*
* Lua
```lua
siteUrl = Space.Grid.SiteURL
```
* Lua
```lua
--Clicking this object will populate a UIText field with the current Grid's Site URL
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("TheTextReference")
function OnClickFunction()
local siteURL = Space.Grid.SiteURL
textObject.UIText.Text = siteURL
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction
```
##### DefaultRegion[β](#defaultregion "Direct link to DefaultRegion")
int **DefaultRegion** `get`
*Returns the Region ID of the Default Region. The Default Region is set in the grid's Dashboard. (white-label grid only)*
* Lua
```lua
defaultRegion = Space.Grid.DefaultRegion
```
* Lua
```lua
--Clicking this object will teleport the user to the grid's Default Region
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
local defaultRegion = Space.Grid.DefaultRegion
Space.PlayerAvatar.Teleport(defaultRegion)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Avatars[β](#avatars "Direct link to Avatars")
int\[] **Avatars** `get`
*Returns the IDs of all Avatars in the grid. (white-label grid only)*
* Lua
```lua
avatars = Space.Grid.Avatars
```
* Lua
```lua
--Clicking this object will populate a UIText field with the current Grid's Avatars
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("TheTextReference")
function OnClickFunction()
local avatars = Space.Grid.Avatars
av = json.serialize(avatars)
textObject.UIText.Text = av
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### OrientationRegion[β](#orientationregion "Direct link to OrientationRegion")
int **OrientationRegion** `get`
*Returns the Region ID of the "Orientation Region".*
* Lua
```lua
orientationRegion = Space.Grid.OrientationRegion
```
* Lua
```lua
--Clicking this object will teleport the user to the grid's Orientation Region
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
local orientationRegionRegion = Space.Grid.OrientationRegion
Space.PlayerAvatar.Teleport(orientationRegion)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
---
### SHost
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**InvokeEvent** ](/scripting/client-scripting-api-reference/region/shost.md#invokeevent)(string name) |
| void [**Stop** ](/scripting/client-scripting-api-reference/region/shost.md#stop)() |
| void [**InvokeDelayed** ](/scripting/client-scripting-api-reference/region/shost.md#invokedelayed)(Closure c, float delay) |
| void [**StartCoroutine** ](shost#startcoroutine)(DynValue value, DynValue parameter=default(DynValue), string name=null) void [**StartCoroutine** ](shost#startcoroutine)(string value, DynValue parameter=default(DynValue) |
| bool [**ReferenceExists** ](/scripting/client-scripting-api-reference/region/shost.md#referenceexists)(string name) |
| bool [**ReferenceExistsAndNotEmpty** ](/scripting/client-scripting-api-reference/region/shost.md#referenceexistsandnotempty)(string name) |
| SGameObject [**GetReference** ](/scripting/client-scripting-api-reference/region/shost.md#getreference)(string name) |
| void [**Evaluate** ](/scripting/client-scripting-api-reference/region/shost.md#evaluate)(string script) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------ |
| SGameObject [**ExecutingObject** ](/scripting/client-scripting-api-reference/region/shost.md#executingobject)`get` |
| string [**Language** ](/scripting/client-scripting-api-reference/region/shost.md#language)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### InvokeEvent[β](#invokeevent "Direct link to InvokeEvent")
void **InvokeEvent** (string name)
*Invokes a UnityEvent attached to the Scripting Runtime component this script is executing in.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.InvokeEvent("EventName")
```
##### Stop[β](#stop "Direct link to Stop")
void **Stop** ()
*Pauses the current script until it is manually restarted, at the end of the current function/method; consider using return as well.*
* Lua
```lua
Space.Host.Stop()
```
* Lua
```lua
local trans=Space.Host.ExecutingObject;
trans.SubscribeToEvents();
function Running()
Space.Log("Running")
end
trans.OnUpdate(Running)
Space.Host.InvokeDelayed(function()
Space.Log("Stop")
Space.Host.Stop()
end,5)
--After print the "Stop","Running" won't display anymore.
```
##### InvokeDelayed[β](#invokedelayed "Direct link to InvokeDelayed")
void **InvokeDelayed** (Closure c, float delay)
*Invoke the closure after the delayed time.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.InvokeDelayed(AFunction, 10)
```
* Lua
```lua
--Clicking this object makes it destroy itself after 5 seconds
thisObject = Space.Host.ExecutingObject
function DeleteFunction()
thisObject.Destroy()
end
function OnClickFunction()
Space.Host.InvokeDelayed(DeleteFunction,10)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### StartCoroutine[β](#startcoroutine "Direct link to StartCoroutine")
void **StartCoroutine** (DynValue value, DynValue parameter=default(DynValue), string name=null) void **StartCoroutine** (string value, DynValue parameter=default(DynValue), string name=null)
*Executes the specified function as a coroutine.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.StartCoroutine(aFunction)
--or
Space.Host.StartCoroutine("aFunctionName")
```
* Lua
```lua
local function myCoroutine()
-- The yield statement is a special kind of return, that ensures that the function will continue from the line once the coroutine resumes.
-- Placing a float value inside of the yield will result in a delayed execution.
-- Example: coroutine.yield(0.5) will wait 0.5 seconds before continuing the execution of the coroutine.
-- This will print the current players active time.
Space.Log(Space.Time);
-- Execution of this coroutine will be halted for 10 seconds.
coroutine.yield(10);
-- This will print the current players active time, which will be 10 seconds greater then the previous as a result of the yield
Space.Log(Space.Time);
end
Space.Host.StartCoroutine(myCoroutine);
```
##### ReferenceExists[β](#referenceexists "Direct link to ReferenceExists")
bool **ReferenceExists** (string name)
*Return true when the reference object exists and is not empty.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
referenceExists = Space.Host.ReferenceExists("the reference name")
```
##### ReferenceExistsAndNotEmpty[β](#referenceexistsandnotempty "Direct link to ReferenceExistsAndNotEmpty")
bool **ReferenceExistsAndNotEmpty** (string name)
*Return true when the reference object exists and is not empty.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
existsNotEmpty = Space.Host.ReferenceExistsAndNotEmpty("obj")
--Print "false" to console if didn't set the object named "obj" to the Object References or attach the reference to "obj".
```
##### GetReference[β](#getreference "Direct link to GetReference")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GetReference** (string name)
*Pulls a reference from the scripting runtime component's "References" section by it's name.*
| Parameter | Type | Description |
| --------- | ------ | --------------------------------------------------------------------------------------------- |
| name | string | The name of the reference as set within the Scripting Runtime component (references section). |
* Lua
```lua
theObject = Space.Host.GetReference("referenceName")
```
* Lua
```lua
--Clicking this object makes it destroy the object we linked in the references section
thisObject = Space.Host.ExecutingObject
dObject = Space.Host.GetReference("theObjectToBeDestroyed")
function OnClickFunction()
dObject.Destroy()
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Evaluate[β](#evaluate "Direct link to Evaluate")
void **Evaluate** (string script)
Executes given Lua code/script. (white-label only)
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.Evaluate('Space.Log("test")')
```
#### Properties[β](#properties "Direct link to Properties")
##### ExecutingObject[β](#executingobject "Direct link to ExecutingObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **ExecutingObject** `get`
*A reference to the GameObject that is executing this script. (The GameObject that this Scripting Runtime component is attached to).*
* Lua
```lua
object = Space.Host.ExecutingObject
```
##### Language[β](#language "Direct link to Language")
string **Language** `get`
*Returns the English name for the users language, e.g. 'English', 'French', 'Chinese'*
* Lua
```lua
lang = Space.Host.Language
```
* Lua
```lua
--Makes a UIText show a different message according to the client's language
TextObject = Space.Host.GetReference("TextObject") --add to references section of Scripting Runtime component
language = Space.Host.Language
if language == "English" then
TextObject.UIText.Text = "Welcome!"
elseif language == "Dutch" then
TextObject.UIText.Text = "welkom!"
elseif language == "French" then
TextObject.UIText.Text = "bienvenue!"
else
TextObject.UIText.Text = "Welcome!"
end
```
---
### SPersistence
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**UpdateInfo** ](/scripting/client-scripting-api-reference/region/spersistence.md#updateinfo)(Closure onComplete) |
| string [**RetrieveValue** ](/scripting/client-scripting-api-reference/region/spersistence.md#retrievevalue)(string key) |
| void [**SetValue** ](/scripting/client-scripting-api-reference/region/spersistence.md#setvalue)(string key, string value) |
| void [**UpdateRegionInfo** ](spersistence#updateregioninfo)(Action onComplete) void [**UpdateRegionInfo** ](spersistence#updateregioninfo)(Closure onComplete) |
| string [**RetrieveRegionValue** ](/scripting/client-scripting-api-reference/region/spersistence.md#retrieveregionvalue)(string key) |
| void [**SetRegionValue** ](/scripting/client-scripting-api-reference/region/spersistence.md#setregionvalue)(string key, string value) |
#### Functions[β](#functions "Direct link to Functions")
##### UpdateInfo[β](#updateinfo "Direct link to UpdateInfo")
void **UpdateInfo** (Closure onComplete)
*Call the onComplete function upon the server saving a value.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function OnCompleteFunction()
--
end
Space.Persistence.UpdateInfo(OnCompleteFunction)
```
* Lua
```lua
Space.Persistence.SetValue("TestValue","123");
Space.Persistence.UpdateInfo(function ()
local value = Space.Persistence.RetrieveValue("TestValue")
Space.Log(value)
end)
--print "123" to console.
```
##### RetrieveValue[β](#retrievevalue "Direct link to RetrieveValue")
string **RetrieveValue** (string key)
*Returns the saved value with the key.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Persistence.RetrieveValue("TestValue")
```
##### SetValue[β](#setvalue "Direct link to SetValue")
void **SetValue** (string key, string value)
*Save a **value** to the storage record that is accessed with **key**.*
| Parameter | Type | Description |
| --------- | ------ | -------------- |
| key | string | Max length 48 |
| value | string | Max length 255 |
* Lua
```lua
Space.Persistence.SetValue("MyValue", "Hello World");
```
##### UpdateRegionInfo[β](#updateregioninfo "Direct link to UpdateRegionInfo")
void **UpdateRegionInfo** (Action onComplete) void **UpdateRegionInfo** (Closure onComplete)
*Updates your local cache with the most up-to-date values from the server. This function should be called before using the* [*RetrieveRegionValue*](/scripting/client-scripting-api-reference/region/spersistence.md#retrieveregionvalue) function.
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Persistence.SetRegionValue("TestRegionValue","456")
Space.Persistence.UpdateRegionInfo(function ()
local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")
Space.Log(value)
end)
--print "456" to console.
```
##### RetrieveRegionValue[β](#retrieveregionvalue "Direct link to RetrieveRegionValue")
string **RetrieveRegionValue** (string key)
*Retrieves the saved value from "key" from your local cache. The* [*UpdateRegionInfo* ](/scripting/client-scripting-api-reference/region/spersistence.md#updateregioninfo)*function should be called first to update your local cache with the most up-to-date values from the server.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Persistence.RetrieveRegionValue("TestRegionValue");
```
##### SetRegionValue[β](#setregionvalue "Direct link to SetRegionValue")
void **SetRegionValue** (string key, string value)
*Save the "value" to "key" on both your local cache and on the server.*
| Parameter | Type | Description |
| --------- | ------ | -------------- |
| key | string | Max length 48 |
| value | string | Max length 255 |
* Lua
```lua
Space.Persistence.SetRegionValue("TestRegionValue","456");
```
---
### SPhysics
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SPhysicsHit\[] [**RayCast** ](/scripting/client-scripting-api-reference/region/sphysics.md#raycast)(SVector origin, SVector normal, float distance, SLayerMask layerMask=null) |
| SPhysicsHit [**RayCastSingle** ](/scripting/client-scripting-api-reference/region/sphysics.md#raycastsingle)(SVector origin, SVector normal, float distance, SLayerMask layerMask=null) |
| SPhysicsHit\[] [**SphereCast** ](sphysics#spherecast)(SVector origin, float radius, float distance, SVector direction, SLayerMask layerMask=null) SPhysicsHit\[] [**SphereCast** ](sphysics#spherecast)(SVector origin, float radius, float distance, SLayerMask layerMask=null) |
| SPhysicsHit\[] [**CapsuleCast** ](sphysics#capsulecast)(SVector origin, SVector end, float radius, float distance, SVector up, SLayerMask layerMask=null) SPhysicsHit\[] [**CapsuleCast** ](sphysics#capsulecast)(SVector origin, SVector end, float radius, float distance, SLayerMask layerMask=null) |
| SPhysicsHit\[] [**BoxCast** ](/scripting/client-scripting-api-reference/region/sphysics.md#boxcast)(SVector origin, SVector extents, SVector direction, SQuaternion orientation, float distance, SLayerMask layerMask=null) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------- |
| SVector [**Gravity** ](/scripting/client-scripting-api-reference/region/sphysics.md#gravity)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### RayCast[β](#raycast "Direct link to RayCast")
[SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **RayCast** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, [SVector](/scripting/client-scripting-api-reference/types/svector.md) normal, float distance, [SLayerMask](/scripting/client-scripting-api-reference/types/slayermask.md) layerMask=null)
*Raycasts from origin along normal, distance meters - and returns a list of collisions in distance order (closest first)*
| Parameter | Type | Description |
| --------- | ---------- | ----------------------------------------------------------------- |
| origin | SVector | |
| normal | SVector | |
| distance | SVector | |
| layerMask | SLayerMask | Include a layer mask if you do not want to use viewer's defaults. |
* Lua
```lua
tableSPhysicsHit = Space.Physics.RayCast(Vector.New(0,0,0), Vector.New(1,0,0), 2.0)
```
* Lua
```lua
local trans=Space.Host.ExecutingObject
function Raycast()
local rays = Space.Physics.RayCast(trans.WorldPosition,trans.Forward,50)
if(rays~=nil and #rays>0) then
for i=0,#rays - 1 do
Space.Log(rays[i].Object.Name.." i = "..i)
end
end
end
trans.OnUpdate(Raycast)
```
##### RayCastSingle[β](#raycastsingle "Direct link to RayCastSingle")
[SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md) **RayCastSingle** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, [SVector](/scripting/client-scripting-api-reference/types/svector.md) normal, float distance, [SLayerMask](/scripting/client-scripting-api-reference/types/slayermask.md) layerMask=null)
*Raycasts from origin along normal, distance meters - and returns the first collision.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
SPhysicsHit = Space.Physics.RayCastSingle(Vector.New(0,0,0), Vector.New(1,0,0), 2.0)
```
* Lua
```lua
local trans=Space.Host.ExecutingObject
function RaycastSingle()
local ray=Space.Physics.RayCastSingle(trans.WorldPosition,trans.Forward,50)
if(ray~=nil and ray.ContainsHit==true) then
Space.Log(ray.Object.Name) end
end
trans.OnUpdate(RaycastSingle)
```
* Lua
```lua
--this script will make this object jump to wherever you right click
--(Example: moving objects with right click )
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseDown(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### SphereCast[β](#spherecast "Direct link to SphereCast")
[SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **SphereCast** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, float radius, float distance, [SVector](/scripting/client-scripting-api-reference/types/svector.md) direction, [SLayerMask](/scripting/client-scripting-api-reference/types/slayermask.md) layerMask=null) [SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **SphereCast** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, float radius, float distance, [SLayerMask](/scripting/client-scripting-api-reference/types/slayermask.md) layerMask=null)
*Sweeps from origin in a spherical ray 'radius' wide, and returns the list of collided objects*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableSPhysicsHit = Space.Physics.SphereCast(Vector.New(0,0,0), 3.0, 2.0, Vector.New(1,0,0))
--or
tableSPhysicsHit = Space.Physics.SphereCast(Vector.New(0,0,0), 3.0, 2.0)
```
* Lua
```lua
local trans=Space.Host.ExecutingObject
function SphereRaycast()
local center=trans.WorldPosition + Vector.New(0.5,0.5,0.5)
local rays=Space.Physics.SphereCast(center,10,10,trans.Forward)
if rays~=nil and #rays>0 then
for i=0,#rays - 1 do
Space.Log(rays[i].Object.Name.." i = "..i)
end
end
end
trans.OnUpdate(SphereRaycast)
```
##### CapsuleCast[β](#capsulecast "Direct link to CapsuleCast")
[SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **CapsuleCast** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, [SVector ](/scripting/client-scripting-api-reference/types/svector.md)end, float radius, float distance, [SVector](/scripting/client-scripting-api-reference/types/svector.md) up, SLayerMask layerMask=null) [SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **CapsuleCast** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, [SVector](/scripting/client-scripting-api-reference/types/svector.md) end, float radius, float distance, [SLayerMask](/scripting/client-scripting-api-reference/types/slayermask.md) layerMask=null)
*Sweeps a capsule from origin to end, radius wide and returns a list of collisions.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableSPhysicsHit = Space.Physics.CapsuleCast(Vector.New(0,0,0),Vector.New(0,5,0), 3.0, 2.0, Vector.New(1,0,0))
--or
tableSPhysicsHit = Space.Physics.CapsuleCast(Vector.New(0,0,0),Vector.New(0,5,0), 3.0, 2.0)
```
* Lua
```lua
local trans=Space.Host.ExecutingObject
function CapsuleCast()
local startp=trans.WorldPosition
local endp=startp+trans.Up*10
local rays=Space.Physics.CapsuleCast(startp,endp,1,10,trans.Up)
if rays~=nil and #rays>0 then
for i=0,#rays - 1 do
Space.Log(rays[i].Object.Name.." i = "..i)
end
end
end
trans.OnUpdate(CapsuleCast)
```
##### BoxCast[β](#boxcast "Direct link to BoxCast")
[SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md)\[] **BoxCast** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) origin, [SVector](/scripting/client-scripting-api-reference/types/svector.md) extents, [SVector ](/scripting/client-scripting-api-reference/types/svector.md)direction, [SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) orientation, float distance, [SLayerMask](/scripting/client-scripting-api-reference/types/slayermask.md) layerMask=null)
*Sweeps a box defined by origin+halfExtents along direction, distance meters with a orientation matching orientation - and returns a list of collisions in distance order.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableSPhysicsHit = Space.Physics.BoxCast(Vector.New(0,0,0),Vector.New(1,1,1), Vector.New(0,1,0), Quaternion.New(0,60,0), 10.0)
```
* Lua
```lua
local trans=Space.Host.ExecutingObject
function BoxCast()
local center=trans.WorldPosition + Vector.New(0.5,0.5,0.5)
local endp=local extents=Vector.new(2,2,2)
local rays=Space.Physics.BoxCast(center,extents,trans.Forward,Quaternion.Identity,2)
if rays~=nil and #rays>0 then
for i=0,#rays - 1 do
Space.Log(rays[i].Object.Name.." i = "..i)
end
end
end
trans.OnUpdate(BoxCast)
```
#### Properties[β](#properties "Direct link to Properties")
##### Gravity[β](#gravity "Direct link to Gravity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Gravity** `get` `set`
*The gravity applied to all rigid bodies in the Scene.*
*Gravity can be turned off for an individual Rigidbody using its* [*UseGravity*](/scripting/client-scripting-api-reference/components/srigidbody.md#usegravity) *property.*
* Lua
```lua
Space.Physics.Gravity = Vector.New(0,-1.0,0)
```
---
### SPostFX
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SCommandBuffer [**CreateCommandBuffer** ](/scripting/client-scripting-api-reference/region/spostfx.md#createcommandbuffer)() |
| void [**AddCommandBufferToCamera** ](/scripting/client-scripting-api-reference/region/spostfx.md#addcommandbuffertocamera)(SCommandBuffer commandbuffer, int cameraEvent=19) |
| void [**RemoveCommandBufferFromCamera** ](/scripting/client-scripting-api-reference/region/spostfx.md#removecommandbufferfromcamera)(SCommandBuffer commandbuffer, int cameraEvent=19) |
| void [**SetPostProfile** ](/scripting/client-scripting-api-reference/region/spostfx.md#setpostprofile)(SResource customProfile) |
| void [**ClearPostProfile** ](/scripting/client-scripting-api-reference/region/spostfx.md#clearpostprofile)() |
| void [**SetCrepsecularRays** ](/scripting/client-scripting-api-reference/region/spostfx.md#setcrepsecularrays)(bool on, float thresR, float thresG, float thresB, float colorR, float colorG, float colorB, float falloff, float blurSize, int blurIterations, float intensity) |
| void [**SetAmbientOcclusion** ](/scripting/client-scripting-api-reference/region/spostfx.md#setambientocclusion)(bool on, float intensity, bool aoOnly) |
| void [**SetMotionBlur** ](/scripting/client-scripting-api-reference/region/spostfx.md#setmotionblur)(bool on, float shutterAngle) |
| void [**SetBloom** ](/scripting/client-scripting-api-reference/region/spostfx.md#setbloom)(bool on, float threshold, float intensity) |
| void [**SetAnamorphicFlares** ](/scripting/client-scripting-api-reference/region/spostfx.md#setanamorphicflares)(bool on, float r, float g, float b, float intensity, float threshold, float spread, bool vertical) |
| void [**SetVignette** ](/scripting/client-scripting-api-reference/region/spostfx.md#setvignette)(bool on, float r, float g, float b, float intensity) |
| void [**SetLensDirt** ](/scripting/client-scripting-api-reference/region/spostfx.md#setlensdirt)(bool on, float threshold, SResource texture, float intensity) |
| void [**SetChromaticAberrationPost** ](/scripting/client-scripting-api-reference/region/spostfx.md#setchromaticaberrationpost)(bool on, float strength, float cornerBlur) |
| void [**SetFocus** ](/scripting/client-scripting-api-reference/region/spostfx.md#setfocus)(SGameObject target) |
| void [**SupressFocus** ](/scripting/client-scripting-api-reference/region/spostfx.md#supressfocus)() |
| void [**RestoreFocus** ](/scripting/client-scripting-api-reference/region/spostfx.md#restorefocus)() |
| void [**SetLookUpTable** ](/scripting/client-scripting-api-reference/region/spostfx.md#setlookuptable)(SResource lut) |
#### Functions[β](#functions "Direct link to Functions")
##### CreateCommandBuffer[β](#createcommandbuffer "Direct link to CreateCommandBuffer")
[SCommandBuffer](/scripting/client-scripting-api-reference/types/scommandbuffer.md) **CreateCommandBuffer** ()
*Return a new CommandBuffer.*
* Lua
```lua
commandBuffer = Space.PostFX.CreateCommandBuffer()
```
* Lua
```lua
local commandbuffer=Space.PostFX.CreateCommandBuffer()
local mat=Space.Resources[1]
local cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
```
##### AddCommandBufferToCamera[β](#addcommandbuffertocamera "Direct link to AddCommandBufferToCamera")
void **AddCommandBufferToCamera** ([SCommandBuffer](/scripting/client-scripting-api-reference/types/scommandbuffer.md) commandbuffer, int cameraEvent=19)
*Add the CommandBuffer to the Main Camera.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.AddCommandBufferToCamera(ACommandBuffer)
---or
Space.PostFX.AddCommandBufferToCamera(ACommandBuffer, 18)
```
* Lua
```lua
local commandbuffer=Space.PostFX.CreateCommandBuffer()
local mat=Space.Resources[1]
local cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
function RemoveCommandBuffer()
--Bind this function to a button and then click it in playing.
Space.PostFX.RemoveCommandBufferFromCamera(commandbuffer)
end
```
##### RemoveCommandBufferFromCamera[β](#removecommandbufferfromcamera "Direct link to RemoveCommandBufferFromCamera")
void **RemoveCommandBufferFromCamera** ([SCommandBuffer](/scripting/client-scripting-api-reference/types/scommandbuffer.md) commandbuffer, int cameraEvent=19)
*Remove the CommandBuffer from the Main Camera.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.RemoveCommandBufferToCamera(ACommandBuffer)
---or
Space.PostFX.RemoveCommandBufferToCamera(ACommandBuffer, 18)
```
* Lua
```lua
local commandbuffer=Space.PostFX.CreateCommandBuffer()
local mat=Space.Resources[1]
local cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
function RemoveCommandBuffer()
--Bind this function to a button and then click it in playing.
Space.PostFX.RemoveCommandBufferFromCamera(commandbuffer)
end
```
##### SetPostProfile[β](#setpostprofile "Direct link to SetPostProfile")
void **SetPostProfile** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md) customProfile)
*Set a custom Space Post-Processing Profile.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetPostProfile(Space.Resources[1])
```
##### ClearPostProfile[β](#clearpostprofile "Direct link to ClearPostProfile")
void **ClearPostProfile** ()
*Clear current Post-Processing profile and restore default one.*
* Lua
```lua
Space.PostFX.ClearPostProfile()
```
##### SetCrepsecularRays[β](#setcrepsecularrays "Direct link to SetCrepsecularRays")
void **SetCrepsecularRays** (bool on, float thresR, float thresG, float thresB, float colorR, float colorG, float colorB, float falloff, float blurSize, int blurIterations, float intensity)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetCrepsecularRays(true, 255.0, 0.0, 0.0, 0.0,0.0, 255.0, 1.0, 1.0, 2, 4.0)
```
##### SetAmbientOcclusion[β](#setambientocclusion "Direct link to SetAmbientOcclusion")
void **SetAmbientOcclusion** (bool on, float intensity, bool aoOnly)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetAmbientOcclusion(true, 4.0, true)
```
##### SetMotionBlur[β](#setmotionblur "Direct link to SetMotionBlur")
void **SetMotionBlur** (bool on, float shutterAngle)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetMotionBlur(true, 20.0)
```
##### SetBloom[β](#setbloom "Direct link to SetBloom")
void **SetBloom** (bool on, float threshold, float intensity)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetBloom(true, 2.0, 4.0)
```
##### SetAnamorphicFlares[β](#setanamorphicflares "Direct link to SetAnamorphicFlares")
void **SetAnamorphicFlares** (bool on, float r, float g, float b, float intensity, float threshold, float spread, bool vertical)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetBloom(true, 255.0, 0.0, 0.0, 4.0, 2.0, 3.0, true)
```
##### SetVignette[β](#setvignette "Direct link to SetVignette")
void **SetVignette** (bool on, float r, float g, float b, float intensity)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetVignette(true, 255.0, 0.0, 0.0, 4.0)
```
##### SetLensDirt[β](#setlensdirt "Direct link to SetLensDirt")
void **SetLensDirt** (bool on, float threshold, SResource texture, float intensity)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetLensDirt(true, 4.0, Space.Resources[1], 4.0)
```
##### SetChromaticAberrationPost[β](#setchromaticaberrationpost "Direct link to SetChromaticAberrationPost")
void **SetChromaticAberrationPost** (bool on, float strength, float cornerBlur)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetChromaticAberrationPost(true, 4.0, 1.0)
```
##### SetFocus[β](#setfocus "Direct link to SetFocus")
void **SetFocus** ([SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) target)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetFocus(Space.Host.ExecutingObject)
```
##### SupressFocus[β](#supressfocus "Direct link to SupressFocus")
void **SupressFocus** ()
*Function Description*
* Lua
```lua
Space.PostFX.SupressFocus()
```
##### RestoreFocus[β](#restorefocus "Direct link to RestoreFocus")
void **RestoreFocus** ()
*Function Description*
* Lua
```lua
Space.PostFX.RestoreFocus()
```
##### SetLookUpTable[β](#setlookuptable "Direct link to SetLookUpTable")
void **SetLookUpTable** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md) lut)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.PostFX.SetLookUpTable(Space.Resources[1])
```
---
### SRenderSettings
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetGlobalShaderTexture** ](/scripting/client-scripting-api-reference/region/srendersettings.md#setglobalshadertexture)(string name, SResource dir) |
| void [**SetGlobalShaderFloat** ](/scripting/client-scripting-api-reference/region/srendersettings.md#setglobalshaderfloat)(string name, float dir) |
| void [**SetGlobalShaderColor** ](/scripting/client-scripting-api-reference/region/srendersettings.md#setglobalshadercolor)(string name, SColor dir) |
| void [**SetGlobalShaderVector** ](/scripting/client-scripting-api-reference/region/srendersettings.md#setglobalshadervector)(string name, SVector dir) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| int [**DefaultReflectionResolution** ](/scripting/client-scripting-api-reference/region/srendersettings.md#defaultreflectionresolution)`get` `set` |
| SMaterial [**Skybox** ](/scripting/client-scripting-api-reference/region/srendersettings.md#skybox)`get` `set` |
| float [**FlareFadeSpeed** ](/scripting/client-scripting-api-reference/region/srendersettings.md#flarefadespeed)`get` `set` |
| float [**FlareStrength** ](/scripting/client-scripting-api-reference/region/srendersettings.md#flarestrength)`get` `set` |
| float [**HaloStrength** ](/scripting/client-scripting-api-reference/region/srendersettings.md#halostrength)`get` `set` |
| int [**ReflectionBounces** ](/scripting/client-scripting-api-reference/region/srendersettings.md#reflectionbounces)`get` `set` |
| float [**ReflectionIntensity** ](/scripting/client-scripting-api-reference/region/srendersettings.md#reflectionintensity)`get` `set` |
| SColor [**SubtractiveShadowColor** ](/scripting/client-scripting-api-reference/region/srendersettings.md#subtractiveshadowcolor)`get` `set` |
| float [**AmbientIntensity** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientintensity)`get` `set` |
| SColor [**AmbientLight** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientlight)`get` `set` |
| SColor [**AmbientGroundColor** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientgroundcolor)`get` `set` |
| SColor [**AmbientEquatorColor** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientequatorcolor)`get` `set` |
| SColor [**AmbientSkyColor** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientskycolor)`get` `set` |
| SAmbientMode [**AmbientMode** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientmode)`get` `set` |
| float [**FogEndDistance** ](/scripting/client-scripting-api-reference/region/srendersettings.md#fogenddistance)`get` `set` |
| float [**FogStartDistance** ](/scripting/client-scripting-api-reference/region/srendersettings.md#fogstartdistance)`get` `set` |
| float [**FogDensity** ](/scripting/client-scripting-api-reference/region/srendersettings.md#fogdensity)`get` `set` |
| SColor [**FogColor** ](/scripting/client-scripting-api-reference/region/srendersettings.md#fogcolor)`get` `set` |
| SFogMode [**FogMode** ](/scripting/client-scripting-api-reference/region/srendersettings.md#fogmode)`get` `set` |
| bool [**Fog** ](/scripting/client-scripting-api-reference/region/srendersettings.md#fog)`get` `set` |
| float [**AmbientSkyboxAmount** ](/scripting/client-scripting-api-reference/region/srendersettings.md#ambientskyboxamount)`get` `set` |
| SDefaultReflectionMode [**DefaultReflectionMode** ](/scripting/client-scripting-api-reference/region/srendersettings.md#defaultreflectionmode)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### SetGlobalShaderTexture[β](#setglobalshadertexture "Direct link to SetGlobalShaderTexture")
void **SetGlobalShaderTexture** (string name, [SResource](/scripting/client-scripting-api-reference/types/sresource.md) dir)
*Set a global texture property.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.RenderSettings.SetGlobalShaderTexture("_TestTex",Space.Resources[1])
```
##### SetGlobalShaderFloat[β](#setglobalshaderfloat "Direct link to SetGlobalShaderFloat")
void **SetGlobalShaderFloat** (string name, float dir)
*Set a global float property for all shaders.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.RenderSettings.SetGlobalShaderFloat("_Mult",1)
```
##### SetGlobalShaderColor[β](#setglobalshadercolor "Direct link to SetGlobalShaderColor")
void **SetGlobalShaderColor** (string name, [SColor](/scripting/client-scripting-api-reference/types/scolor.md) dir)
*Set a global color property for all shaders.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.RenderSettings.SetGlobalShaderFloat("_TestColor",Color.Red)
```
##### SetGlobalShaderVector[β](#setglobalshadervector "Direct link to SetGlobalShaderVector")
void **SetGlobalShaderVector** (string name, [SVector](/scripting/client-scripting-api-reference/types/svector.md) dir)
*Set a global color property for all shaders.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.RenderSettings.SetGlobalShaderFloat("_TestVector",Vector.One)
```
#### Properties[β](#properties "Direct link to Properties")
##### DefaultReflectionResolution[β](#defaultreflectionresolution "Direct link to DefaultReflectionResolution")
int **DefaultReflectionResolution** `get` `set`
*Cubemap resolution for default reflection.*
* Lua
```lua
Space.RenderSettings.DefaultReflectionResolution=256
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Cube Map Resolution
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.DefaultReflectionResolution = slider.Value * 4096 -- from 0 to 40906
end
slider.OnValueChanged(OVC)
```
##### Skybox[β](#skybox "Direct link to Skybox")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **Skybox** `get` `set`
*The global skybox to use.*
* Lua
```lua
Space.RenderSettings.Skybox=Space.Resources[1].AsMaterial
```
* Lua
```lua
--clicking this object will toggle between two Skyboxes
--[Add 2 materials to the first two Resource slots in Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if Space.RenderSettings.Skybox==Space.Resources[1].AsMaterial then
Space.RenderSettings.Skybox=Space.Resources[2].AsMaterial
else
Space.RenderSettings.Skybox=Space.Resources[1].AsMaterial
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### FlareFadeSpeed[β](#flarefadespeed "Direct link to FlareFadeSpeed")
float **FlareFadeSpeed** `get` `set`
*The fade speed of all flares in the Scene.*
* Lua
```lua
Space.RenderSettings.FlareFadeSpeed=5
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Flare Fade Speed
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.FlareFadeSpeed = slider.Value * 5 -- from 0 to 5
end
slider.OnValueChanged(OVC)
```
##### FlareStrength[β](#flarestrength "Direct link to FlareStrength")
float **FlareStrength** `get` `set`
*The intensity of all flares in the Scene.*
* Lua
```lua
Space.RenderSettings.FlareStrength=1
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Flare Strength
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.FlareStrength = slider.Value * 5 -- from 0 to 5
end
slider.OnValueChanged(OVC)
```
##### HaloStrength[β](#halostrength "Direct link to HaloStrength")
float **HaloStrength** `get` `set`
*Size of the light halos.*
* Lua
```lua
Space.RenderSettings.HaloStrength=1
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Halo Strength
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.HaloStrength = slider.Value * 5 -- from 0 to 5
end
slider.OnValueChanged(OVC)
```
##### ReflectionBounces[β](#reflectionbounces "Direct link to ReflectionBounces")
int **ReflectionBounces** `get` `set`
*The number of times a reflection includes other reflections.*
* Lua
```lua
Space.RenderSettings.ReflectionBounces=5
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Reflection Bounces
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.ReflectionBounces = slider.Value * 5 -- from 0 to 5
end
slider.OnValueChanged(OVC)
```
##### ReflectionIntensity[β](#reflectionintensity "Direct link to ReflectionIntensity")
float **ReflectionIntensity** `get` `set`
*How much the skybox / custom cubemap reflection affects the Scene.*
* Lua
```lua
Space.RenderSettings.ReflectionIntensity=1
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Reflection Intensity
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.ReflectionIntensity = slider.Value * 5 -- from 0 to 5
end
slider.OnValueChanged(OVC)
```
##### SubtractiveShadowColor[β](#subtractiveshadowcolor "Direct link to SubtractiveShadowColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **SubtractiveShadowColor** `get` `set`
*The color used for the sun shadows in the Subtractive lightmode.*
* Lua
```lua
Space.RenderSettings.SubtractiveShadowColor=Color.Red
```
* Lua
```lua
--clicking the object will open a color picker that changes the Subtractive Shadow Color
thisGameObject = Space.Host.ExecutingObject
originalColor = Space.RenderSettings.SubtractiveShadowColor
OnChange = function(SColor)
Space.RenderSettings.SubtractiveShadowColor = SColor
end
OnSelect = function(SColor)
Space.RenderSettings.SubtractiveShadowColor = SColor
end
OnCancel = function()
Space.RenderSettings.SubtractiveShadowColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AmbientIntensity[β](#ambientintensity "Direct link to AmbientIntensity")
float **AmbientIntensity** `get` `set`
*How much the light from the Ambient Source affects the Scene.*
* Lua
```lua
Space.RenderSettings.AmbientIntensity = 1
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Ambient Intensity
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.AmbientIntensity = slider.Value * 5 -- from 0 to 5
end
slider.OnValueChanged(OVC)
```
##### AmbientLight[β](#ambientlight "Direct link to AmbientLight")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **AmbientLight** `get` `set`
*Flat ambient lighting color.*
* Lua
```lua
Space.RenderSettings.AmbientLight=Color.Blue
```
* Lua
```lua
--clicking the object will open a color picker that changes the Ambient Light Color
thisGameObject = Space.Host.ExecutingObject
originalColor = Space.RenderSettings.AmbientLight
OnChange = function(SColor)
Space.RenderSettings.AmbientLight = SColor
end
OnSelect = function(SColor)
Space.RenderSettings.AmbientLight = SColor
end
OnCancel = function()
Space.RenderSettings.AmbientLight = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AmbientGroundColor[β](#ambientgroundcolor "Direct link to AmbientGroundColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **AmbientGroundColor** `get` `set`
*Ambient lighting coming from below.*
* Lua
```lua
Space.RenderSettings.AmbientGroundColor=Color.Green
```
* Lua
```lua
--clicking the object will open a color picker that changes the Ambient Ground Color
thisGameObject = Space.Host.ExecutingObject
originalColor = Space.RenderSettings.AmbientGroundColor
OnChange = function(SColor)
Space.RenderSettings.AmbientGroundColor = SColor
end
OnSelect = function(SColor)
Space.RenderSettings.AmbientGroundColor = SColor
end
OnCancel = function()
Space.RenderSettings.AmbientGroundColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AmbientEquatorColor[β](#ambientequatorcolor "Direct link to AmbientEquatorColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **AmbientEquatorColor** `get` `set`
*Ambient lighting coming from the sides.*
* Lua
```lua
Space.RenderSettings.AmbientEquatorColor=Color.Green
```
* Lua
```lua
--clicking the object will open a color picker that changes the Ambient Equator Color
thisGameObject = Space.Host.ExecutingObject
originalColor = Space.RenderSettings.AmbientEquatorColor
OnChange = function(SColor)
Space.RenderSettings.AmbientEquatorColor = SColor
end
OnSelect = function(SColor)
Space.RenderSettings.AmbientEquatorColor = SColor
end
OnCancel = function()
Space.RenderSettings.AmbientEquatorColor= originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AmbientSkyColor[β](#ambientskycolor "Direct link to AmbientSkyColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **AmbientSkyColor** `get` `set`
*Ambient lighting coming from above.*
* Lua
```lua
Space.RenderSettings.AmbientSkyColor=Color.White
```
* Lua
```lua
--clicking the object will open a color picker that changes the Ambient Sky Color
thisGameObject = Space.Host.ExecutingObject
originalColor = Space.RenderSettings.AmbientSkyColor
OnChange = function(SColor)
Space.RenderSettings.AmbientSkyColor = SColor
end
OnSelect = function(SColor)
Space.RenderSettings.AmbientSkyColor = SColor
end
OnCancel = function()
Space.RenderSettings.AmbientSkyColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AmbientMode[β](#ambientmode "Direct link to AmbientMode")
int **AmbientMode** `get` `set`
*Ambient lighting mode.* Skybox = 1. Trilight = 2. Flat = 3. Custom = 4.
* Lua
```lua
Space.RenderSettings.AmbientMode=1
```
* Lua
```lua
--clicking this object will toggle between 4 Ambient Modes
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if Space.RenderSettings.AmbientMode==4 then
Space.RenderSettings.AmbientMode=1
else
Space.RenderSettings.AmbientMode = Space.RenderSettings.AmbientMode + 1
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### FogEndDistance[β](#fogenddistance "Direct link to FogEndDistance")
float **FogEndDistance** `get` `set`
*The ending distance of linear fog.*
* Lua
```lua
Space.RenderSettings.FogEndDistance=300
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Fog End Distance
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.FogEndDistance = (slider.Value * 170) + 30-- from 30 to 200
end
slider.OnValueChanged(OVC)
```
##### FogStartDistance[β](#fogstartdistance "Direct link to FogStartDistance")
float **FogStartDistance** `get` `set`
*The starting distance of linear fog.*
* Lua
```lua
Space.RenderSettings.FogStartDistance=10
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Fog Start Distance
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.FogStartDistance = (slider.Value * 10) -- from 0 to 10
end
slider.OnValueChanged(OVC)
```
##### FogDensity[β](#fogdensity "Direct link to FogDensity")
float **FogDensity** `get` `set`
*The density of the exponential fog.*
* Lua
```lua
Space.RenderSettings.FogDensity=10
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Fog Density
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.FogDensity = (slider.Value * 10) -- from 0 to 10
end
slider.OnValueChanged(OVC)
```
##### FogColor[β](#fogcolor "Direct link to FogColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **FogColor** `get` `set`
*The color of the fog.*
* Lua
```lua
Space.RenderSettings.FogColor = Color.Red
```
* Lua
```lua
--clicking the object will open a color picker that changes the Fog color
thisGameObject = Space.Host.ExecutingObject
originalColor = Space.RenderSettings.FogColor
OnChange = function(SColor)
Space.RenderSettings.FogColor = SColor
end
OnSelect = function(SColor)
Space.RenderSettings.FogColor = SColor
end
OnCancel = function()
Space.RenderSettings.FogColor = originalColor
end
OnClick = function()
Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### FogMode[β](#fogmode "Direct link to FogMode")
int **FogMode** `get` `set`
*Ambient lighting mode.* Linear = 1. Exponential = 2. ExponentialSquared = 3.
* Lua
```lua
Space.RenderSettings.FogMode=2
```
* Lua
```lua
--clicking this object will toggle between 3 Fog Modes
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if Space.RenderSettings.FogMode==3 then
Space.RenderSettings.FogMode=1
else
Space.RenderSettings.FogMode = Space.RenderSettings.FogMode + 1
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### Fog[β](#fog "Direct link to Fog")
bool **Fog** `get` `set`
*Whether Fog is enabled*
* Lua
```lua
Space.RenderSettings.Fog=true
```
* Lua
```lua
--clicking this object will toggle enable/disable Fog
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.RenderSettings.Fog = not Space.RenderSettings.Fog
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
##### AmbientSkyboxAmount[β](#ambientskyboxamount "Direct link to AmbientSkyboxAmount")
float **AmbientSkyboxAmount** `get` `set`
*How much the light from the Ambient Source affects the Scene.*
* Lua
```lua
Space.RenderSettings.AmbientSkyboxAmount=10
```
* Lua
```lua
--the below script will make a slider change the Render Setting's Ambient Skybox Amount
thisGameObject = Space.Host.ExecutingObject
slider = Space.Host.GetReference("slider").UISlider --add reference to Scripting Runtime
OVC = function()
Space.RenderSettings.AmbientSkyboxAmount = (slider.Value * 10) -- from 0 to 10
end
slider.OnValueChanged(OVC)
```
##### DefaultReflectionMode[β](#defaultreflectionmode "Direct link to DefaultReflectionMode")
int **DefaultReflectionMode** `get` `set`
*Ambient lighting mode.* Skybox = 0. Custom = 1.
* Lua
```lua
Space.RenderSettings.DefaultReflectionMode = 1
```
* Lua
```lua
--clicking this object will toggle between two Default Reflection Modes
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
if Space.RenderSettings.DefaultReflectionMode==1 then
Space.RenderSettings.DefaultReflectionMode=0
else
Space.RenderSettings.DefaultReflectionMode=1
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```
---
### SScene
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SGameObject [**Find** ](/scripting/client-scripting-api-reference/region/sscene.md#find)(string name) |
| SGameObject [**FindID** ](/scripting/client-scripting-api-reference/region/sscene.md#findid)(string id) |
| void [**MarkObjectTemporary** ](/scripting/client-scripting-api-reference/region/sscene.md#markobjecttemporary)(SGameObject obj) |
| SAvatar [**GetAvatar** ](sscene#getavatar)(long id) SAvatar [**GetAvatar** ](sscene#getavatar)(string name) |
| SGameObject [**CreateGameObject** ](sscene#creategameobject)(string name) SGameObject [**CreateGameObject** ](sscene#creategameobject)(SResource resource) |
| void [**SwitchToInstance** ](/scripting/client-scripting-api-reference/region/sscene.md#switchtoinstance)(uint id) |
| void [**OnPlayerJoin** ](/scripting/client-scripting-api-reference/region/sscene.md#onplayerjoin)(Closure e) |
| void [**OnPlayerLeave** ](/scripting/client-scripting-api-reference/region/sscene.md#onplayerleave)(Closure e) |
| void [**OnEditModeStart** ](/scripting/client-scripting-api-reference/region/sscene.md#oneditmodestart)(Closure e) |
| void [**OnEditModeEnd** ](/scripting/client-scripting-api-reference/region/sscene.md#oneditmodeend)(Closure e) |
| void [**OnEditModeAdd** ](/scripting/client-scripting-api-reference/region/sscene.md#oneditmodeadd)(Closure e) |
| void [**OnEditModeRemove** ](/scripting/client-scripting-api-reference/region/sscene.md#oneditmoderemove)(Closure e) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------- |
| SAvatar [**PlayerAvatar** ](/scripting/client-scripting-api-reference/region/sscene.md#playeravatar)`get` |
| SAvatar\[] [**Avatars** ](/scripting/client-scripting-api-reference/region/sscene.md#avatars)`get` |
| List< SAvatar > [**AllAvatars** ](/scripting/client-scripting-api-reference/region/sscene.md#allavatars)`get` |
| int [**Population** ](/scripting/client-scripting-api-reference/region/sscene.md#population)`get` |
| SGameObject\[] [**Objects** ](/scripting/client-scripting-api-reference/region/sscene.md#objects)`get` |
| string [**Name** ](/scripting/client-scripting-api-reference/region/sscene.md#name)`get` |
| string [**Url** ](/scripting/client-scripting-api-reference/region/sscene.md#url)`get` |
| long [**RegionID** ](/scripting/client-scripting-api-reference/region/sscene.md#regionid)`get` |
| long [**InstanceID** ](/scripting/client-scripting-api-reference/region/sscene.md#instanceid)`get` |
| long [**Owner** ](/scripting/client-scripting-api-reference/region/sscene.md#owner)`get` |
| bool [**PlayerIsOwner** ](/scripting/client-scripting-api-reference/region/sscene.md#playerisowner)`get` |
| bool [**PlayerIsAdmin** ](/scripting/client-scripting-api-reference/region/sscene.md#playerisadmin)`get` |
| bool [**PlayerIsModerator** ](/scripting/client-scripting-api-reference/region/sscene.md#playerismoderator)`get` |
| bool [**PlayerIsDeveloper** ](/scripting/client-scripting-api-reference/region/sscene.md#playerisdeveloper)`get` |
| bool [**PlayerIsTrusted** ](/scripting/client-scripting-api-reference/region/sscene.md#playeristrusted)`get` |
| bool [**IsInEditMode** ](/scripting/client-scripting-api-reference/region/sscene.md#isineditmode)`get` |
| SGameObject\[] [**Floors** ](/scripting/client-scripting-api-reference/region/sscene.md#floors)`get` |
| SLandmark\[] [**Landmarks** ](/scripting/client-scripting-api-reference/region/sscene.md#landmarks)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Find[β](#find "Direct link to Find")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Find** (string name)
*Finds a single Game Object matching 'Name' and returns it. Can use '/' characters to designate a path (e.g. 'Parent/Child' returns Child with 'Parent')*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.Find('Door2')
```
* Lua
```lua
hand = Space.Scene.Find("Hand");
--This returns the GameObject named Hand.
hand = Space.Scene.Find("/Hand");
--This returns the GameObject named Hand.
--Hand must not have a parent in the Hierarchy view.
hand = Space.Scene.Find("/Monster/Arm/Hand");
--This returns the GameObject named Hand,
--which is a child of Arm > Monster.
--Monster must not have a parent in the Hierarchy view.
hand = Space.Scene.Find("Monster/Arm/Hand");
--This returns the GameObject named Hand,
--which is a child of Arm > Monster.
```
##### FindID[β](#findid "Direct link to FindID")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **FindID** (string id)
*Finds a single Game Object using ID and returns it*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
--add Scene Object Database to a Gameobject, set "123" to IDs and name the GameObject "Cube".
local obj=Space.Scene.FindID("123")
Space.Log(obj.Name);
--print "Cube" if the object exists.
```
##### MarkObjectTemporary[β](#markobjecttemporary "Direct link to MarkObjectTemporary")
void **MarkObjectTemporary** ([SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) obj)
*Marks the Game Object as temporary. Temporary objects will be cleaned up automatically if the script is destroyed or reset. Can be used to handle cleanup from procedural objects created by a script.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.MarkObjectTemporary(AnObjectReference)
```
##### GetAvatar[β](#getavatar "Direct link to GetAvatar")
[SAvatar](/scripting/client-scripting-api-reference/types/savatar.md) **GetAvatar** (long id) [SAvatar](/scripting/client-scripting-api-reference/types/savatar.md) **GetAvatar** (string name)
*Get reference to an avatar*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
theAvatar =Space.Scene.GetAvatar(43)
--or
theAvatar =Space.Scene.GetAvatar("TestUser")
```
##### CreateGameObject[β](#creategameobject "Direct link to CreateGameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **CreateGameObject** (string name) [SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **CreateGameObject** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md) resource)
*Creates a game object from the specified resource*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.CreateGameObject('NewBall')
--or
Space.Scene.CreateGameObject(Space.Resources[1])
```
* Lua
```lua
--clicking this object will create a GameObject from a resource and place it above our avatar
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
resource = Space.GetResource("Tomato") --add it as resource in your Scripting Runtime component
OnClick = function()
createdObject = Space.Scene.CreateGameObject(resource)
createdObject.WorldPosition = thisPlayer.GameObject.WorldPosition + thisPlayer.GameObject.Up
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### SwitchToInstance[β](#switchtoinstance "Direct link to SwitchToInstance")
void **SwitchToInstance** (uint id)
*Switch to a shard region.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.SwitchToInstance(2)
```
##### OnPlayerJoin[β](#onplayerjoin "Direct link to OnPlayerJoin")
void **OnPlayerJoin** (Closure e)
*Event which fires whenever a player joins the region*
| Parameter | Type | Description |
| --------- | ------------------ | ----------- |
| e | Closure (Callback) | e(SAvatar) |
* Lua
```lua
--Place this script in a UIText object and it will
--update itself with the name of the last player joined
function updateText(Av) --we include "Av" here because the event gives us a reference to the Avatar that joined
Space.Host.ExecutingObject.UIText.Text= "Last player joined: " .. Av.Username
end
Space.Scene.OnPlayerJoin(updateText) -- updateText will now be called everytime a player joins
```
##### OnPlayerLeave[β](#onplayerleave "Direct link to OnPlayerLeave")
void **OnPlayerLeave** (Closure e)
*Event which fires whenever a player leaves the region*
| Parameter | Type | Description |
| --------- | ------------------ | ----------- |
| e | Closure (Callback) | e(long) |
* Lua
```lua
function playerLeft(id)
--
end
Space.Scene.OnPlayerLeave(playerLeft)
```
* Lua
```lua
--Place this script in a UIText object and it will
--update itself with the name of the last player left
function updateText(Av) --we include "Av" here because the event gives us a reference to the Avatar that has left
Space.Host.ExecutingObject.UIText.Text= "Last player left: " .. Av.Username
end
Space.Scene.OnPlayerLeave(updateText) -- updateText will now be called every time a player leaves
```
##### OnEditModeStart[β](#oneditmodestart "Direct link to OnEditModeStart")
void **OnEditModeStart** (Closure e)
*An event which is fired when player enters Room Edit mode*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.OnEditModeStart(AFunctionName)
```
* Lua
```lua
--makes an object become active upon entering edit mode
thisObject = Space.Host.ExecutingObject
targetObject = Space.Host.GetReference("target") --add to references in Scripting Runtime component
function OnEditModeFunction()
targetObject.Active = true
end
Space.Scene.OnEditModeStart(OnEditModeFunction)
```
##### OnEditModeEnd[β](#oneditmodeend "Direct link to OnEditModeEnd")
void **OnEditModeEnd** (Closure e)
*An event which is fired when player exits Room Edit mode*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.OnEditModeEnd(AfunctionName)
```
* Lua
```lua
--makes an object become active upon exiting edit mode
thisObject = Space.Host.ExecutingObject
targetObject = Space.Host.GetReference("target") --add to references in Scripting Runtime component
function OnEditModeFunction()
targetObject.Active = false
end
Space.Scene.OnEditModeEnd(OnEditModeFunction)
```
##### OnEditModeAdd[β](#oneditmodeadd "Direct link to OnEditModeAdd")
void **OnEditModeAdd** (Closure e)
*An event which is fired when object is added during Edit Mode*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.OnEditModeAdd(AFunctionName)
```
* Lua
```lua
--prints the total number of objects in the scene whenever a new object is added in edit mode
function OnEditModeFunction()
Space.Log(#Space.Scene.Objects)
end
Space.Scene.OnEditModeAdd(OnEditModeFunction)
```
##### OnEditModeRemove[β](#oneditmoderemove "Direct link to OnEditModeRemove")
void **OnEditModeRemove** (Closure e)
*An event which is fired when object is deleted during Edit Mode*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.OnEditModeRemove(AFunctionName)
```
* Lua
```lua
--prints the total number of objects in the scene whenever a new object is removed in edit mode
function OnEditModeFunction()
Space.Log(#Space.Scene.Objects)
end
Space.Scene.OnEditModeRemove(OnEditModeFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### PlayerAvatar[β](#playeravatar "Direct link to PlayerAvatar")
[SAvatar](/scripting/client-scripting-api-reference/types/savatar.md) **PlayerAvatar** `get`
*Returns the current player avatar. If this script is calling this upon initialisation, the Player may not exist yet, and you will want to wait a few frames until the avatar is present before continuing.*
* Lua
```lua
CurrentPlayer = Space.Scene.PlayerAvatar
```
##### Avatars[β](#avatars "Direct link to Avatars")
[SAvatar](/scripting/client-scripting-api-reference/types/savatar.md)\[] **Avatars** `get`
*Returns a list of Avatars in the scene*
* Lua
```lua
avatars = Space.Scene.Avatars
```
* Lua
```lua
--this script, once clicked, will get all avatars in the scene
--and print their ID, Username and Title (excluding self)
--(Example: scoreboards/radars/scanners/game machines)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Avatars = Space.Scene.Avatars
if #Avatars > 0 then
for var=1, #Avatars do
local ID = Avatars[var].ID
local Username = Avatars[var].Username
local Title = Avatars[var].Title
if Title == "" then Title = "None" end
Space.Log("ID: " .. ID .. ", Username: " .. Username .. ", Title: " .. Title)
end
else
Space.Log("No Avatars")
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to print all avatars' information"
thisGameObject.Clickable.OnClick(OnClick)
```
##### AllAvatars[β](#allavatars "Direct link to AllAvatars")
List< [SAvatar](/scripting/client-scripting-api-reference/types/savatar.md) > **AllAvatars** `get`
*Returns a list of all avatars in the scene. The player avatar that is calling this will be added to the end of the list.*
* Lua
```lua
local avatars=Space.Scene.AllAvatars
Space.Log(#avatars)
--Print the length of AllAvatars.
```
* Lua
```lua
--this script, once clicked, will get all avatars in the scene
--and print their ID, Username and Title (including self)
--(Example: scoreboards/radars/scanners/game machines)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
allAvatars = Space.Scene.AllAvatars
for var=1, #allAvatars do
local ID = allAvatars[var].ID
local Username = allAvatars[var].Username
local Title = allAvatars[var].Title
if Title == "" then Title = "None" end
Space.Log("ID: " .. ID .. ", Username: " .. Username .. ", Title: " .. Title)
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to print all avatars' information"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Population[β](#population "Direct link to Population")
int **Population** `get`
*Property Description*
* Lua
```lua
currentPopulation = Space.Scene.Population
```
##### Objects[β](#objects "Direct link to Objects")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md)\[] **Objects** `get`
*Returns a list of Objects in the scene. IMPORTANT: This function is slow, you should cache the result and avoid calling this every frame.*
* Lua
```lua
objects = Space.Scene.Objects
```
* Lua
```lua
--clicking this object will print a name of every object in the scene
--[better use a coroutine incase the foor loop exceeds allowed frame time]
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
local objects = Space.Scene.Objects
for i=1, #objects, 1 do
Space.Log(objects[i].Name)
end
end
thisObject.AddClickable()
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Returns the name of the current region*
* Lua
```lua
RegionName = Space.Scene.Name
```
* Lua
```lua
--this object will be clickable only if it is in a region called "X Region"
--((for example: limiting object functionality to a specific region))
thisObject = Space.Host.ExecutingObject
OnClick = function()
Space.Log("We are in X Region")
end
if Space.Scene.Name == "X Region" then
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
end
```
##### Url[β](#url "Direct link to Url")
string **Url** `get`
*Returns the URL of the current region*
* Lua
```lua
RegionUrl = Space.Scene.Url
```
* Lua
```lua
--the URL of this region will be placed in a UIText upon loading
--and also printed if this object is clicked
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") -- add to scripting runtime references
function OnClick()
Space.Log(Space.Scene.Url)
end
textObject.UIText.Text = Space.Scene.Url
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### RegionID[β](#regionid "Direct link to RegionID")
long **RegionID** `get`
*Returns the region ID of current region.*
* Lua
```lua
Space.Log(Space.Scene.RegionID)
```
* Lua
```lua
--the RegionID of this region will be placed in a UIText upon loading
--and also printed if this object is clicked
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") -- add to scripting runtime references
function OnClick()
Space.Log(Space.Scene.RegionID)
end
textObject.UIText.Text = Space.Scene.RegionID
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### InstanceID[β](#instanceid "Direct link to InstanceID")
long **InstanceID** `get`
*Return the instance ID of current region.*
* Lua
```lua
instanceID = Space.Scene.InstanceID
```
* Lua
```lua
--the RegionID of this region will be placed in a UIText upon loading
--and also printed if this object is clicked
thisObject = Space.Host.ExecutingObject
textObject = Space.Host.GetReference("textObject") -- add to scripting runtime references
function OnClick()
Space.Log(Space.Scene.InstanceID)
end
textObject.UIText.Text = Space.Scene.InstanceID
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Owner[β](#owner "Direct link to Owner")
long **Owner** `get`
*Returns the avatar ID of the regions owner*
* Lua
```lua
RegionOwner = Space.Scene.Owner
```
* Lua
```lua
--this script will make this object only clickable for the region owner
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OnClick = function()
Space.Log("Do Something")
end
if thisPlayer.ID == Space.Scene.Owner then
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
end
```
##### PlayerIsOwner[β](#playerisowner "Direct link to PlayerIsOwner")
bool **PlayerIsOwner** `get`
*Returns whether the current player is the owner of the region*
* Lua
```lua
isOwner = Space.Scene.PlayerIsOwner
```
* Lua
```lua
--this script will make the object a clickable, but only if player is region owner
--(Example: Access control)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Log("this click was only possible because you are a region Owner")
end
if Space.Scene.PlayerIsOwner then
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me"
thisGameObject.Clickable.OnClick(OnClick)
end
```
##### PlayerIsAdmin[β](#playerisadmin "Direct link to PlayerIsAdmin")
bool **PlayerIsAdmin** `get`
*Does this Player have the **Admin** role?*
* Lua
```lua
Space.Scene.PlayerIsAdmin
```
* Lua
```lua
--this script will make the object a clickable, but only if player is region Admin
--(Example: Access control)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Log("this click was only possible because you are a region Admin")
end
if Space.Scene.PlayerIsAdmin then
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me Admin"
thisGameObject.Clickable.OnClick(OnClick)
end
```
##### PlayerIsModerator[β](#playerismoderator "Direct link to PlayerIsModerator")
bool **PlayerIsModerator** `get`
*Does this Player have the **Moderator** role?*
* Lua
```lua
playerIsModerator = Space.Scene.PlayerIsModerator
```
* Lua
```lua
--this script will make the object a clickable, but only if player is Moderator in this region
--(Example: Access control)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Log('this click was only possible because you are Moderator in this region')
end
if Space.Scene.PlayerIsModerator then
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me Moderator"
thisGameObject.Clickable.OnClick(OnClick)
end
```
##### PlayerIsDeveloper[β](#playerisdeveloper "Direct link to PlayerIsDeveloper")
bool **PlayerIsDeveloper** `get`
*Does this Player have the **Developer** role?*
* Lua
```lua
playerIsDeveloper = Space.Scene.PlayerIsDeveloper
```
##### PlayerIsTrusted[β](#playeristrusted "Direct link to PlayerIsTrusted")
bool **PlayerIsTrusted** `get`
Does this Player have the **Trusted** role?
* Lua
```lua
playerIsTrusted = Space.Scene.PlayerIsTrusted
```
* Lua
```lua
--this script will make the object a clickable, but only if player is Trusted in this region
--(Example: Access control)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Log("this click was only possible because you are Trusted in this region")
end
if Space.Scene.PlayerIsTrusted then
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me Trusted"
thisGameObject.Clickable.OnClick(OnClick)
end
```
##### IsInEditMode[β](#isineditmode "Direct link to IsInEditMode")
bool **IsInEditMode** `get`
*Returns true if current player is in edit mode.*
* Lua
```lua
Space.Log(Space.Scene.IsInEditMode)
```
* Lua
```lua
--makes an object only active when this player is in Edit Mode
thisObject = Space.Host.ExecutingObject
targetObject = Space.Host.GetReference("target") --add to references in Scripting Runtime component
function OnUpdateFunction()
targetObject.Active = Space.Scene.IsInEditMode
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### Floors[β](#floors "Direct link to Floors")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md)\[] **Floors** `get`
*Return an array of all floors in the region.*
* Lua
```lua
for i=1,#Space.Scene.Floors do
Space.Log(Space.Scene.Floors[i].Name)
end
--print all floor names.
```
* Lua
```lua
example 2
```
##### Landmarks[β](#landmarks "Direct link to Landmarks")
[SLandmark](/scripting/client-scripting-api-reference/types/slandmark.md)\[] **Landmarks** `get`
*Return all Landmarks in the region*
* Lua
```lua
local landmark = Space.Scene.Landmarks
for i = 1,#landmark do
if landmark[i].Type == LandmarkType.LandingZone then
Space.Log("LandingZone")
end
Space.Log(landmark[i].Name .. " ".. landmark[i].Position.ToString())
end
```
---
### SScript
#### Functions[β](#functions "Direct link to Functions")
##### TypeName[β](#typename "Direct link to TypeName")
string **TypeName** (DynValue dv)
*Return the type name of the value.*
| Parameter | Type | Description |
| --------- | -------- | ----------- |
| dv | DynValue | |
* Lua
```lua
typeName = Space.TypeName("123")
```
##### TrackingAllowed[β](#trackingallowed "Direct link to TrackingAllowed")
bool **TrackingAllowed** (string key)
*Returns true on white-label grids when the user has opted into tracking for the given key. Always returns false on the main grid.*
| Parameter | Type | Description |
| --------- | ------ | -------------------------------------------------------------------------- |
| key | string | A unique identifier used to store and look up the user's tracking consent. |
* Lua
```lua
isTrackingAllowed = Space.TrackingAllowed('3423423423423')
```
##### TrackingRequest[β](#trackingrequest "Direct link to TrackingRequest")
void **TrackingRequest** (string key, string privacynotice, Closure callback, bool force=false)
*Displays a consent prompt (EULA-style) asking the user to allow tracking for a given key. On white-label grids, stores the user's choice and invokes the callback with a boolean indicating consent. On the main grid, this does nothing.*
| Parameter | Type | Description |
| ------------- | ------- | ------------------------------------------------------------------------------------ |
| key | string | A unique identifier used to store and look up the user's tracking consent. |
| privacynotice | string | The privacy notice text to display in the consent dialog. |
| callback | Closure | A function invoked with one boolean parameter: `true` if allowed, `false` otherwise. |
| force | bool | If `true`, show the prompt even if a stored decision exists. Defaults to `false`. |
* Lua
```lua
-- Request consent (white-label only). The callback receives a boolean 'allowed'.
Space.TrackingRequest('24234234234234', 'A notice message', function(allowed)
if allowed then
Space.Log("Tracking allowed")
else
Space.Log("Tracking denied")
end
end)
-- or force re-prompt even if a decision was saved previously:
Space.TrackingRequest('24234234234234', 'A notice message', function(allowed) end, true)
```
##### GetResource[β](#getresource "Direct link to GetResource")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md) **GetResource** (string name)
*Returns a reference to a SResource using it's Resource name.*
| Parameter | Type | Description |
| --------- | ------ | ---------------------------------------------------------------------------------- |
| name | string | Name of the Resource as set in the Scripting Runtime Component (Resources section) |
* Lua
```lua
aResource = Space.GetResource("ResourceName")
```
##### LogEvent[β](#logevent "Direct link to LogEvent")
void **LogEvent** (string eventName, float value, [SVector](/scripting/client-scripting-api-reference/types/svector.md) position)
*Logs an analytics event to the server on white-label grids.*
| Parameter | Type | Description |
| --------- | ------- | --------------------------------------------- |
| eventName | string | The name of the analytics event. |
| value | float | A numeric value associated with the event. |
| position | SVector | A world position to associate with the event. |
* Lua
```lua
Space.LogEvent('event name', 2.0, Vector.New(0,0,0) )
```
##### Log[β](#log "Direct link to Log")
void **Log** (DynValue text, bool logToFile=false) void **Log** (string text, bool logToFile=false)
*Log a message to console.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Color.Blue)
--or
Space.Log("Log")
--or
Space.Log("Log",true)
```
#### Properties[β](#properties "Direct link to Properties")
##### Inventory[β](#inventory "Direct link to Inventory")
[SInventory](/scripting/client-scripting-api-reference/player/sinventory.md) **Inventory** `get`
*Allows access to the users inventory*
* Lua
```lua
inventory = Space.Inventory
```
##### Persistence[β](#persistence "Direct link to Persistence")
[SPersistence](/scripting/client-scripting-api-reference/region/spersistence.md) **Persistence** `get`
*Stores information between user sessions, and for other users*
* Lua
\`\`\` persistence = Space.Persistence \`\`\`
##### Scene[β](#scene "Direct link to Scene")
[SScene](/scripting/client-scripting-api-reference/region/sscene.md) **Scene** `get`
*Allows access to the current scene graph (objects and avatars in the scene, and other information)*
* Lua
```lua
scene = Space.Scene
```
##### Grid[β](#grid "Direct link to Grid")
[SGrid](/scripting/client-scripting-api-reference/region/sgrid.md) **Grid** `get`
*Property Description*
* Lua
```lua
grid = Space.Grid
```
##### Host[β](#host "Direct link to Host")
[SHost](/scripting/client-scripting-api-reference/region/shost.md) **Host** `get`
*Access information about the current scripting runtime host*
* Lua
```lua
host = Space.Host
```
##### Physics[β](#physics "Direct link to Physics")
[SPhysics](/scripting/client-scripting-api-reference/region/sphysics.md) **Physics** `get`
*Call physics-related commands, and variables, such as raycasting*
* Lua
```lua
physics = Space.Physics
```
##### Math[β](#math "Direct link to Math")
[SMath](/scripting/client-scripting-api-reference/types/smath.md) **Math** `get`
*Math related functions (Sin, Cos, Tan, etc)*
* Lua
```lua
Space.Math.Ceil(4.0)
```
##### String[β](#string "Direct link to String")
[SString](/scripting/client-scripting-api-reference/types/sstring.md) **String** `get`
*Miscellaneous additional string functions (e.g. MD5Sum)*
* Lua
```lua
Space.String.GetBytes("some data")
```
##### Input[β](#input "Direct link to Input")
[SInput](/scripting/client-scripting-api-reference/client/sinput.md) **Input** `get`
*Input device related functions (mouse position, keyboard state)*
* Lua
```lua
Space.Input.Vibrate(1,1,false)
```
##### Camera[β](#camera "Direct link to Camera")
[SCameraManager](/scripting/client-scripting-api-reference/region/scameramanager.md) **Camera** `get`
*Take and control the users camera*
* Lua
```lua
obj = Space.Host.ExecutingObject
Space.Camera.LockCamera (obj)
```
##### WebServices[β](#webservices "Direct link to WebServices")
[SWebService](/scripting/client-scripting-api-reference/network/swebservice.md) **WebServices** `get`
*Call remote web services to designated hosts (will not work with arbitrary domains, see page for details)*
* Lua
```lua
Space.WebServices.GetImage("example.com/mrlee.jpg")
```
##### Network[β](#network "Direct link to Network")
[SNetwork](/scripting/client-scripting-api-reference/network/snetwork.md) **Network** `get`
*Send data to other clients through the region server*
* Lua
```lua
Space.Network.SubscribeToNetwork("helloworld", gotAMessageFunction)
```
##### PostFX[β](#postfx "Direct link to PostFX")
[SPostFX](/scripting/client-scripting-api-reference/region/spostfx.md) **PostFX** `get`
*Property Description*
* Lua
```lua
Space.PostFX
```
##### AudioAnalyser[β](#audioanalyser "Direct link to AudioAnalyser")
SAudioAnalyser **AudioAnalyser** `get`
*Property Description*
* Lua
```lua
Space.AudioAnalyser
```
##### Tween[β](#tween "Direct link to Tween")
STween **Tween** `get`
*Property Description*
* Lua
```lua
Space.Tween
```
##### UI[β](#ui "Direct link to UI")
[SUI](/scripting/client-scripting-api-reference/client/sui.md) **UI** `get`
*Property Description*
* Lua
```lua
ui = Space.UI
```
##### Dialogues[β](#dialogues "Direct link to Dialogues")
[SDialogues](/scripting/client-scripting-api-reference/client/sdialogues.md) **Dialogues** `get`
*Property Description*
* Lua
```lua
dialogues = Space.Dialogues
```
##### Shared[β](#shared "Direct link to Shared")
[SShared](/scripting/client-scripting-api-reference/client/sshared.md) **Shared** `get`
*Property Description*
* Lua
```lua
shared = Space.Shared
```
##### Quests[β](#quests "Direct link to Quests")
[SQuests](/scripting/client-scripting-api-reference/player/squests.md) **Quests** `get`
*Property Description*
* Lua
```lua
quests = Space.Quests
```
##### Economy[β](#economy "Direct link to Economy")
[SEconomy](/scripting/client-scripting-api-reference/player/seconomy.md) **Economy** `get`
*Property Description*
* Lua
```lua
economy = Space.Economy
```
##### Groups[β](#groups "Direct link to Groups")
[SGroup](/scripting/client-scripting-api-reference/player/sgroup.md) **Groups** `get`
*Property Description*
* Lua
```lua
groups = Space.Groups
```
##### Activity[β](#activity "Direct link to Activity")
SActivity **Activity** `get`
*Property Description*
* Lua
\`\`\` activity = Space.Activity \`\`\`
##### RenderSettings[β](#rendersettings "Direct link to RenderSettings")
[SRenderSettings](/scripting/client-scripting-api-reference/region/srendersettings.md) **RenderSettings** `get`
*Property Description*
* Lua
```lua
renderSettings = Space.RenderSettings
```
##### Profile[β](#profile "Direct link to Profile")
[SProfile](/scripting/client-scripting-api-reference/player/sprofile.md) **Profile** `get`
*Property Description*
* Lua
```lua
profile = Space.Profile
```
##### Photos[β](#photos "Direct link to Photos")
[SPhotos](/scripting/client-scripting-api-reference/network/sphotos.md) **Photos** `get`
*Property Description*
* Lua
```lua
photos = Space.Photos
```
##### Videos[β](#videos "Direct link to Videos")
[SVideos](/scripting/client-scripting-api-reference/network/svideos.md) **Videos** `get`
*Property Description*
* Lua
```lua
videos = Space.Videos
```
##### MusicDirectory[β](#musicdirectory "Direct link to MusicDirectory")
SMusicDirectory **MusicDirectory** `get`
*Property Description*
* Lua
```lua
musicDirectory = Space.MusicDirectory
```
##### Journey[β](#journey "Direct link to Journey")
SJourney **Journey** `get`
*Property Description*
* Lua
```lua
journey = Space.Journey
```
##### GameTester[β](#gametester "Direct link to GameTester")
SGameTester **GameTester** `get`
*Property Description*
* Lua
```lua
gameTester = Space.GameTester
```
##### RuntimeType[β](#runtimetype "Direct link to RuntimeType")
string **RuntimeType** `get`
*Return current RuntimeType name.*
* Lua
```lua
runtimeType = Space.RuntimeType
```
##### Platform[β](#platform "Direct link to Platform")
string **Platform** `get`
*Return current platform name.*
* Lua
```lua
platform = Space.Platform
```
##### SessionID[β](#sessionid "Direct link to SessionID")
string **SessionID** `get`
*Return current SessionID.*
* Lua
```lua
sessionID = Space.SessionID
```
##### InEditor[β](#ineditor "Direct link to InEditor")
bool **InEditor** `get`
*Return true if in unity editor.*
* Lua
```lua
isInEditor = Space.InEditor
```
* Lua
```lua
--the below script checks if we are in Unity editor or in SS
--this way we can provide an alternative
--(Example: if we're using a function that doesn't work in Unity editor)
thisGameObject = Space.Host.ExecutingObject
if Space.InEditor then
avatarUsername = "Player Name"
else
avatarUsername = Space.Scene.GetAvatar(thisGameObject.Owner).Username --example: this doesn't work in Editor
end
Space.Log(avatarUsername)
```
##### Version[β](#version "Direct link to Version")
int **Version** `get`
*Returns the numeric build version of the viewer (for programmatic comparisons). In the Unity Editor this returns `int.MaxValue`; if unknown at runtime it returns `-1`.*
* Lua
```lua
viewerVersion = Space.Version
```
##### FullVersionString[β](#fullversionstring "Direct link to FullVersionString")
string **FullVersionString** `get`
*Returns the full build version display string tied to release notes (e.g., "2025.6f210"). Best for user-facing display and logging.*
* Lua
```lua
viewerVersionString = Space.FullVersionString
```
##### Resources[β](#resources "Direct link to Resources")
[SResource](/scripting/client-scripting-api-reference/types/sresource.md)\[] **Resources** `get`
*Property Description*
* Lua
```lua
tableOfResources = Space.Resources
```
* Lua
```lua
--the below script will search through the Scripting Runtime's resources
--and return the first instance of an Animation Clip
--[You need to add a few resources to the scripting runtime and make one of them an animation]
resources = Space.Resources
for i = 1, #resources do
if resources[i].Type == "AnimationClip" then
Space.Log("Resource #".. i .. " is an Animation Clip. The resource name is: " .. resources[i].Name)
break
end
end
```
##### Time[β](#time "Direct link to Time")
float **Time** `get`
*Returns time at the beginning of this frame.*
* Lua
```lua
floatTime = Space.Time
```
* Lua
```lua
--this script will update a UIText object with the current local time without using a coroutine
--(example: clock )
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
rateUpdate = 1.0
nextUpdate = 0.0
text = Space.Host.GetReference("Text").UIText
OnUpdate = function()
if Space.Time > nextUpdate then
nextUpdate = Space.Time + rateUpdate
text.Text = Space.LocalTime
end
}
Space.Host.ExecutingObject.OnUpdate(OnUpdate)
```
##### ServerTime[β](#servertime "Direct link to ServerTime")
string **ServerTime** `get`
*Returns current server time.*
* Lua
```lua
serverTime = Space.ServerTime
```
* Lua
```lua
--this script will update a UIText object with the current server time (UTC)
--(example: clock)
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
text = Space.Host.GetReference("Text").UIText
co = function()
while true do
text.Text = Space.ServerTime
coroutine.yield(1)
end
end
Space.Host.StartCoroutine(co)
```
##### LocalTime[β](#localtime "Direct link to LocalTime")
string **LocalTime** `get`
*Returns current local time.*
* Lua
```lua
localTime = Space.LocalTime
```
* Lua
```lua
--this script will update a UIText object with the current local time
--(example: clock)
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
text = Space.Host.GetReference("Text").UIText
co = function()
while true do
text.Text = Space.LocalTime
coroutine.yield(1)
end
end
Space.Host.StartCoroutine(co)
```
##### LoginTime[β](#logintime "Direct link to LoginTime")
float **LoginTime** `get`
*Returns how long player has been logged in (in seconds).*
* Lua
```lua
loginTime = Space.LoginTime
```
* Lua
```lua
--this script will update a UIText object with how long the user has been logged in (in seconds)
--(example: clock)
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
text = Space.Host.GetReference("Text").UIText
co = function()
while true do
text.Text = Space.LoginTime
coroutine.yield(1)
end
end
Space.Host.StartCoroutine(co)
```
##### ServerTimeUnix[β](#servertimeunix "Direct link to ServerTimeUnix")
int **ServerTimeUnix** `get`
*Returns the server time unix timestamp.*
* Lua
```lua
serverTimeUnix = Space.ServerTimeUnix
```
* Lua
```lua
--this script will update a UIText object with the current server time unix timestamp
--(example: clock)
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
text = Space.Host.GetReference("Text").UIText
co = function()
while true do
text.Text = Space.ServerTimeUnix
coroutine.yield(1)
end
end
Space.Host.StartCoroutine(co)
```
##### LocalTimeUnix[β](#localtimeunix "Direct link to LocalTimeUnix")
int **LocalTimeUnix** `get`
*Returns the local time unix timestamp.*
* Lua
```lua
localTimeUnix = Space.LocalTimeUnix
```
* Lua
```lua
--this script will update a UIText object with the current local time unix timestamp
--(example: clock)
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
text = Space.Host.GetReference("Text").UIText
co = function()
while true do
text.Text = Space.LocalTimeUnix
coroutine.yield(1)
end
end
Space.Host.StartCoroutine(co)
```
##### DeltaTime[β](#deltatime "Direct link to DeltaTime")
float **DeltaTime** `get`
*The completion time in seconds since the last frame.*
* Lua
```lua
deltaTime = Space.DeltaTime
```
* Lua
```lua
--the below script rotates an object around Y axis but uses DeltaTime
--to make sure it's not dependant on client's Framerate (FPS)
--this way the object rotates per second not per frame
--(Example: Important movement in OnUpdate)
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
currentY = thisGameObject.WorldRotation.EulerAngles.Y
newRotation = Quaternion.Euler(0, currentY + 1 * Space.DeltaTime, 0) --We multiplied 1 by Space.DeltaTime
thisGameObject.WorldRotation = newRotation
end
thisGameObject.OnUpdate(OnUpdate)
```
##### PreviewServer[β](#previewserver "Direct link to PreviewServer")
bool **PreviewServer** `get`
*Return true if in preview server.*
* Lua
```lua
isInPreview = Space.PreviewServer
```
* Lua
```lua
--this script will update a UIText object with "preview" or "live" depending
--whether we are on preview server or live server
--[UIText object needs to be added to the references section in the scripting runtime with name "Text"]
text = Space.Host.GetReference("Text").UIText
OnUpdate = function()
if Space.PreviewServer then
text.Text = "Preview"
else
text.Text = "Live"
end
end
Space.Host.ExecutingObject.OnUpdate(OnUpdate)
```
##### ComponentName[β](#componentname "Direct link to ComponentName")
string **ComponentName** `get`
*The name of this component.*
* Lua
```lua
componentName = Space.ComponentName
```
---
### Types
The data types passed to and returned from the client API β vectors, colours, transforms, and math helpers, plus the structures that describe avatars, items, and resources.
---
### SAnimationState
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#enabled)`get` `set` |
| float [**Length** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#length)`get` |
| string [**Name** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#name)`get` |
| float [**NormalizedSpeed** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#normalizedspeed)`get` `set` |
| float [**NormalizedTime** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#normalizedtime)`get` `set` |
| float [**Speed** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#speed)`get` `set` |
| float [**Time** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#time)`get` `set` |
| float [**Weight** ](/scripting/client-scripting-api-reference/types/sanimationstate.md#weight)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Enabled[β](#enabled "Direct link to Enabled")
bool **Enabled** `get` `set`
*Is this Animation State enabled?*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
SAnimationState.Enabled = false
```
##### Length[β](#length "Direct link to Length")
float **Length** `get`
*Returns the length of current animation.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
length = SAnimationState.Length
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Returns the name of current animation.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
name = SAnimationState.Name
```
##### NormalizedSpeed[β](#normalizedspeed "Direct link to NormalizedSpeed")
float **NormalizedSpeed** `get` `set`
*Returns the normalized speed of current animation.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
normalizedSpeed = SAnimationState.NormalizedSpeed
```
##### NormalizedTime[β](#normalizedtime "Direct link to NormalizedTime")
float **NormalizedTime** `get` `set`
*Returns the normalized time of current animation.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
normalizedTime = SAnimationState.NormalizedTime
```
##### Speed[β](#speed "Direct link to Speed")
float **Speed** `get` `set`
*The playback speed of the animation. 1.0 is normal playback speed.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
SAnimationState.Speed = 0.5
```
##### Time[β](#time "Direct link to Time")
float **Time** `get` `set`
*Returns the Time of current animation.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
SAnimationState.Time = 0.5
```
##### Weight[β](#weight "Direct link to Weight")
float **Weight** `get` `set`
*Returns the Weight of current animation.*
* Lua
```lua
SAnimationState = Space.Host.ExecutingObject.Animation.GetState()
SAnimationState.Weight = 0.5
```
---
### SAnimatorStateInfo
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------- |
| bool [**IsName** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#isname)(string name) |
| bool [**IsTag** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#istag)(string tag) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------ |
| int [**fullPathHash** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#fullpathhash)`get` |
| int [**nameHash** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#namehash)`get` |
| int [**shortNameHash** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#shortnamehash)`get` |
| float [**normalizedTime** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#normalizedtime)`get` |
| float [**length** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#length)`get` |
| float [**speed** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#speed)`get` |
| float [**speedMultiplier** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#speedmultiplier)`get` |
| int [**tagHash** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#taghash)`get` |
| bool [**loop** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#loop)`get` |
| float [**Length** ](/scripting/client-scripting-api-reference/types/sanimatorstateinfo.md#length)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### IsName[β](#isname "Direct link to IsName")
bool **IsName** (string name)
*Does name match the name of the active state in the statemachine?*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isName("aStateName")
```
##### IsTag[β](#istag "Direct link to IsTag")
bool **IsTag** (string tag)
*Does tag match the tag of the active state in the statemachine.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isTag("aStateTag")
```
#### Properties[β](#properties "Direct link to Properties")
##### fullPathHash[β](#fullpathhash "Direct link to fullPathHash")
int **fullPathHash** `get`
*The full path hash for this state. The hash is generated using Animator.StringToHash.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
fullPathHash = AnimationStateInfo.fullPathHash
```
##### nameHash[β](#namehash "Direct link to nameHash")
int **nameHash** `get`
*The hashed name of the State.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
nameHash= AnimationStateInfo.nameHash
```
##### shortNameHash[β](#shortnamehash "Direct link to shortNameHash")
int **shortNameHash** `get`
*The hash is generated using SAnimator.StringToHash. The hash does not include the name of the parent layer.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
shortNameHash= AnimationStateInfo.shortNameHash
```
##### normalizedTime[β](#normalizedtime "Direct link to normalizedTime")
float **normalizedTime** `get`
*Normalized time of the State. The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
normalizedTime= AnimationStateInfo.normalizedTime
```
##### length[β](#length "Direct link to length")
float **length** `get`
*Current duration of the state. In seconds Can vary when the State contains a Blend Tree.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
length= AnimationStateInfo.length
```
##### speed[β](#speed "Direct link to speed")
float **speed** `get`
*The playback speed of the animation. 1 is the normal playback speed. A negative playback speed will play the animation from the end.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speed= AnimationStateInfo.speed
```
##### speedMultiplier[β](#speedmultiplier "Direct link to speedMultiplier")
float **speedMultiplier** `get`
\_The speed multiplier for this state.
A negative speed multiplier will play the animation backwards. If no speed parameter as been set for this SAnimatorState, the default value will be 1.\_
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speedMultiplier= AnimationStateInfo.speedMultiplier
```
##### tagHash[β](#taghash "Direct link to tagHash")
int **tagHash** `get`
\_The Tag of the State.
The hash is generated using SAnimator.StringToHash.\_
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
tagHash= AnimationStateInfo.tagHash
```
##### loop[β](#loop "Direct link to loop")
bool **loop** `get`
*Is the state looping. All animations in the state must be looping.*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
loop= AnimationStateInfo.loop
```
##### Length[β](#length-1 "Direct link to Length")
float **Length** `get`
*Current duration of the state. In seconds Can vary when the State contains a Blend Tree*
* Lua
```lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
Length= AnimationStateInfo.Length
```
---
### SAvatar
#### Functions[β](#functions "Direct link to Functions")
##### AttachTo[β](#attachto "Direct link to AttachTo")
void **AttachTo** ([SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) target)
*Attaches the player to the target game object, keeping the avatar fixed in its current position/rotation relative to the target object (e.g. for use in Vehicles)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.PlayerAvatar.AttachTo(targetObject)
```
* Lua
```lua
--the below script makes the player Attach/Detach to/from this object by clicking it
--(Example: Seat/Vehicle/Experience etc.. )
thisGameObject = Space.Host.ExecutingObject
isAttached = 0
OnClick = function()
if isAttached == 0 then
Space.Scene.PlayerAvatar.AttachTo(thisGameObject)
isAttached = 1
elseif isAttached == 1 then
Space.Scene.PlayerAvatar.Detach()
isAttached = 0
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Attach/Detach yourself to/from me"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Detach[β](#detach "Direct link to Detach")
void **Detach** ()
*Detaches the avatar from whatever it may be attached to (only works for the player avatar), including chairs, vehicles and so forth.*
* Lua
```lua
Space.Scene.PlayerAvatar.Detach()
```
* Lua
```lua
--the below script makes the player Attach/Detach to/from this object by clicking it
--(Example: Seat/Vehicle/Experience etc.. )
thisGameObject = Space.Host.ExecutingObject
isAttached = 0
OnClick = function()
if isAttached == 0 then
Space.Scene.PlayerAvatar.AttachTo(thisGameObject)
isAttached = 1
elseif isAttached == 1 then
Space.Scene.PlayerAvatar.Detach()
isAttached = 0
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Attach/Detach yourself to/from me"
thisGameObject.Clickable.OnClick(OnClick)
```
##### OnAvatarAttached[β](#onavatarattached "Direct link to OnAvatarAttached")
void **OnAvatarAttached** ()
*An event which fires whenever this avatar is attached to a game object in the current scene.*
* Lua
```lua
function OAA()
--
end
Space.Scene.PlayerAvatar.OnAvatarAttached(OAA)
```
##### OnAvatarDetached[β](#onavatardetached "Direct link to OnAvatarDetached")
void **OnAvatarDetached** ()
*An event which fires whenever this avatar is detached from a game object in the current scene.*
* Lua
```lua
function OAD()
--
end
Space.Scene.PlayerAvatar.OnAvatarDetached(OAD)
```
##### LoadOutfit[β](#loadoutfit "Direct link to LoadOutfit")
void **LoadOutfit** (int outfitID)
*Only works on a white-label deployment due to abuse concerns. Restrictions: The outfit ID needs to be one of the grid template outfits, with all the restrictions that apply to those (i.e. must use either SW content, or content uploaded by a grid admin account).*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local avatar=Space.Scene.PlayerAvatar
avatar.LoadOutfit(10001)
```
* Lua
```lua
--the below script changes the player's outfit into
--a pre-defined outfit if they click the object containing the script
--(Example: Player clicks on a wardrobe and their outfit changes)
--[Only works on white-label deployment]
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Scene.PlayerAvatar.LoadOutfit(2662469)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Put on your favourite suit"
thisGameObject.Clickable.OnClick(OnClick)
```
##### ResetOutfit[β](#resetoutfit "Direct link to ResetOutfit")
void **ResetOutfit** ()
*Reset current outfit. (white-label only)*
* Lua
```lua
Space.Scene.PlayerAvatar.ResetOutfit()
```
* Lua
```lua
--Clicking this object will reset player avatar's outfit
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OnClick = function()
thisPlayer.ResetOutfit()
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Register[β](#register "Direct link to Register")
void **Register** (string username, string password, string email, bool subscribeToSinespaceNewsletter=false, Closure onSuccess=null, Closure onError=null)
*Allow a guest to register. (white-label only)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local avatar=Space.Scene.PlayerAvatar
avatar.Register("MyName","MyPassword","MyEmail",false,function ()
Space.Log("Success!")
end,function ()
Space.Log("OnError!!")
end)
```
##### ResetOutfitToTemplate[β](#resetoutfittotemplate "Direct link to ResetOutfitToTemplate")
void **ResetOutfitToTemplate** (int outfitID)
*Reset current outfit to a specific template. (white-label only)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local avatar=Space.Scene.PlayerAvatar
avatar.ResetOutfitToTemplate(10001)
```
* Lua
```lua
--Clicking this object will reset player avatar's outfit to a specific template.
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OnClick = function()
thisPlayer.ResetOutfitToTemplate(10001)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### FindBone[β](#findbone "Direct link to FindBone")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **FindBone** (string bone)
*Retrieves the specified humanoid bone as an SGameObject. Requires a Humanoid rig; returns nil if the bone is missing or the avatar is nonβhumanoid. The name is matched caseβinsensitively against UnityEngine.HumanBodyBones.*
| Parameter | Type | Description |
| --------- | ------ | -------------------------------------------------------------------------------------------- |
| bone | string | Name of a UnityEngine.HumanBodyBones value (caseβinsensitive), e.g., "LeftShoulder", "Head". |
* Lua
```lua
-- Humanoid models only. Pass a UnityEngine.HumanBodyBones name.
local bone = Space.Scene.PlayerAvatar.FindBone("LeftShoulder")
Space.Log(bone.Name) -- Prints the bone name of the corresponding search parameter; on default avatars, prints "LeftShoulder"
--[[
UnityEngine.HumanBodyBones values
Body: Hips, Spine, Chest, UpperChest
Head: Neck, Jaw, Head, LeftEye, RightEye
Left Arm: LeftShoulder, LeftUpperArm, LeftLowerArm, LeftHand
Left Leg: LeftUpperLeg, LeftLowerLeg, LeftFoot, LeftToes
Right Arm: RightShoulder, RightUpperArm, RightLowerArm, RightHand
Right Leg: RightUpperLeg, RightLowerLeg, RightFoot, RightToes
Left Hand (Thumb): LeftThumbProximal, LeftThumbIntermediate, LeftThumbDistal
Left Hand (Index): LeftIndexProximal, LeftIndexIntermediate, LeftIndexDistal
Left Hand (Middle): LeftMiddleProximal, LeftMiddleIntermediate, LeftMiddleDistal
Left Hand (Ring): LeftRingProximal, LeftRingIntermediate, LeftRingDistal
Left Hand (Little): LeftLittleProximal, LeftLittleIntermediate, LeftLittleDistal
Right Hand (Thumb): RightThumbProximal, RightThumbIntermediate, RightThumbDistal
Right Hand (Index): RightIndexProximal, RightIndexIntermediate, RightIndexDistal
Right Hand (Middle): RightMiddleProximal, RightMiddleIntermediate, RightMiddleDistal
Right Hand (Ring): RightRingProximal, RightRingIntermediate, RightRingDistal
Right Hand (Little): RightLittleProximal, RightLittleIntermediate, RightLittleDistal
]]
```
* Lua
```lua
--this script will set your avatar's "right hand" as parent of this object
--this way this object will be a child of your right hand and therefore move with it
--(Example: clicking on a gun to equip it)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
RightHand = Space.Scene.PlayerAvatar.FindBone("RightHand")
thisGameObject.SetParent(RightHand)
thisGameObject.LocalPosition = Vector.New(0,0,0) -- resetting position to match hand
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to Equip "
thisGameObject.Clickable.OnClick(OnClick)
```
##### Teleport[β](#teleport "Direct link to Teleport")
void **Teleport** (string landmarkName) void **Teleport** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position) void **Teleport** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) position, [SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) rotation) void **Teleport** (int region) void **Teleport** (int region, [SVector](/scripting/client-scripting-api-reference/types/svector.md) position, [SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) rotation)
*Teleport the avatar.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.PlayerAvatar.Teleport("MyLandMark")
--or
Space.Scene.PlayerAvatar.Teleport( Vector.New(0,0,0) )
--or
Space.Scene.PlayerAvatar.Teleport( Vector.New(0,0,0), Quaternion.New(0,0,0) )
--or
Space.Scene.PlayerAvatar.Teleport( 5432342)
--or
Space.Scene.PlayerAvatar.Teleport( 5432342, Vector.New(0,0,0), Quaternion.New(0,0,0) )
```
* Lua
```lua
--the below script teleports player to a specific landmark
--if they click the object containing it
--(Example: A region promotional/advertisement sign)
--[You need a landmark in the scene with name "Fashion Section Landmark"
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Scene.PlayerAvatar.Teleport("Fashion Section Landmark")
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me to go to the fashion section!"
thisGameObject.Clickable.OnClick(OnClick)
```
##### SetIKGoal[β](#setikgoal "Direct link to SetIKGoal")
void **SetIKGoal** (string goal, bool positionGoal, float positionStrength, [SVector](/scripting/client-scripting-api-reference/types/svector.md) positionTarget, bool rotationGoal, float rotationStrength, [SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) rotationTarget)
*Set the IK goal to avatar.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
avatar=Space.Scene.PlayerAvatar
pos=avatar.FindBone("Chest").WorldPosition
avatar.SetIKGoal("Chest",false,0,pos,true,20,Quaternion.Euler(0,60,0))
```
##### ClearIKGoal[β](#clearikgoal "Direct link to ClearIKGoal")
void **ClearIKGoal** (string goal)
*Clear the IK Goal.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
avatar=Space.Scene.PlayerAvatar
pos=avatar.FindBone("Chest").WorldPosition
avatar.SetIKGoal("Chest",false,0,pos,true,20,Quaternion.Euler(0,60,0))
Space.Host.InvokeDelayed(function ()
avatar.ClearIKGoal("Chest")
end,5)
-- will clear after 5 seconds.
```
##### PlayCustomAnimation[β](#playcustomanimation "Direct link to PlayCustomAnimation")
void **PlayCustomAnimation** ([SResource](/scripting/client-scripting-api-reference/types/sresource.md) animationClip)
*Play a custom animation on the avatar.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Scene.PlayerAvatar.PlayCustomAnimation(Space.Resources[1])
```
* Lua
```lua
--the below script makes the player Play/Stop a custom animation when clicking this object
--(Example: Dance Machine )
--[Required: Place an animation in the first "Resource" in the scripting runtime]
thisGameObject = Space.Host.ExecutingObject
isDancing = 0
OnClick = function()
if isDancing == 0 then
Space.Scene.PlayerAvatar.PlayCustomAnimation(Space.Resources[1])
isDancing = 1
elseif isDancing == 1 then
Space.Scene.PlayerAvatar.StopCustomAnimation()
isDancing = 0
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Start/Stop dancing"
thisGameObject.Clickable.OnClick(OnClick)
```
##### StopCustomAnimation[β](#stopcustomanimation "Direct link to StopCustomAnimation")
void **StopCustomAnimation** ()
*Make the avatar stops playing custom animation.*
* Lua
```lua
avatar=Space.Scene.PlayerAvatar
avatar.PlayCustomAnimation(Space.Resources[1])
avatar.StopCustomAnimation()
```
* Lua
```lua
--the below script makes the player Play/Stop a custom animation when clicking this object
--(Example: Dance Machine )
--[Required: Place an animation in the first "Resource" in the scripting runtime]
thisGameObject = Space.Host.ExecutingObject
isDancing = 0
OnClick = function()
if isDancing == 0 then
Space.Scene.PlayerAvatar.PlayCustomAnimation(Space.Resources[1])
isDancing = 1
elseif isDancing == 1 then
Space.Scene.PlayerAvatar.StopCustomAnimation()
isDancing = 0
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to Start/Stop dancing"
thisGameObject.Clickable.OnClick(OnClick)
```
##### OnAvatarReload[β](#onavatarreload "Direct link to OnAvatarReload")
void **OnAvatarReload** (Closure o)
*This event will be called when the avatar gets loaded.*
| Parameter | Type | Description |
| --------- | ------------------ | -------------------------------------------------------------------------- |
| o | Closure (callback) | A function that will be called once the OnAvatarReload event is triggered. |
* Lua
```lua
local avatar=Space.Scene.PlayerAvatar
avatar.OnAvatarReload(function ()
Space.Log(avatar.OutfitID)
end)
```
* Lua
```lua
--this script ensures the avatar is still animating after their avatar gets reloaded
thisPlayer = Space.Scene.PlayerAvatar
theAnimation = Space.GetResource("The Animation") --add animation to resources in Scripting Runtime
wasAnimated = true --you'll need to set this according to the situation, its true now for example's sake
ResetDance = function()
if wasAnimated then
thisPlayer.PlayCustomAnimation(theAnimation)
end
end
thisPlayer.OnAvatarReload(ResetDance)
```
##### SynchroniseState[β](#synchronisestate "Direct link to SynchroniseState")
void **SynchroniseState** ()
*Synchronise avatar's state to network.*
* Lua
```lua
Space.Scene.PlayerAvatar.SynchroniseState()
```
##### StartFly[β](#startfly "Direct link to StartFly")
void **StartFly** ()
*Puts the avatar into Fly Mode.*
* Lua
```lua
Space.Scene.PlayerAvatar.StartFly()
```
* Lua
```lua
--the below script teleports the player to a sky location after he clicks
--but then immediately puts the character in fly mode so they don't fall back down
--(Example: Sky exhibit)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Scene.PlayerAvatar.Teleport(Vector.New(0,10,0))
Space.Scene.PlayerAvatar.StartFly()
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me to view our sky exhibit!"
thisGameObject.Clickable.OnClick(OnClick)
```
##### EndFly[β](#endfly "Direct link to EndFly")
void **EndFly** ()
*Exits Avatar out of Fly Mode*
* Lua
```lua
Space.Scene.PlayerAvatar.EndFly()
```
* Lua
```lua
--the below script teleports a player flying in the sky back to the ground
--and then ends fly mode by switching to Idle so they remain standing
--(Example: Going back down to ground from Sky exhibit)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
Space.Scene.PlayerAvatar.Teleport(Vector.New(0,0,0))
Space.Scene.PlayerAvatar.EndFly()
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click me to go back to the ground!"
thisGameObject.Clickable.OnClick(OnClick)
```
##### OnAvatarSkeletonReload[β](#onavatarskeletonreload "Direct link to OnAvatarSkeletonReload")
void **OnAvatarSkeletonReload** (Closure o)
*This event will be called when the avatar skeleton gets loaded.*
| Parameter | Type | Description |
| --------- | ------------------ | ---------------------------------------------------------------------------------- |
| o | Closure (callback) | A function that will be called once the OnAvatarSkeletonReload event is triggered. |
* Lua
```lua
avatar=Space.Scene.PlayerAvatar
Space.Log(avatar.BlockJump)
avatar.OnAvatarSkeletonReload(function ()
Space.Log(avatar.OutfitID)
end)
```
* Lua
```lua
--this script ensures the avatar is still animating after their avatar's skeleton gets reloaded
thisPlayer = Space.Scene.PlayerAvatar
theAnimation = Space.GetResource("The Animation") --add animation to resources in Scripting Runtime
wasAnimated = true --you'll need to set this according to the situation, its true now for example's sake
ResetDance = function()
if wasAnimated then
thisPlayer.PlayCustomAnimation(theAnimation)
end
end
thisPlayer.OnAvatarSkeletonReload(ResetDance)
```
##### TeleportToNextEvent[β](#teleporttonextevent "Direct link to TeleportToNextEvent")
double **TeleportToNextEvent** (long withinSeconds=600)
*Teleports to the region of the next scheduled event if it starts within the given time window. Returns 0 if a teleport occurs; returns the number of seconds until the next event if it is outside the cutoff; returns -1 if there are no upcoming events.*
| Parameter | Type | Description |
| ------------- | ---- | --------------------------------------------------------------------- |
| withinSeconds | long | Maximum seconds ahead to consider for auto-teleport. Defaults to 600. |
* Lua
```lua
timeUntilNextEvent = Space.Scene.PlayerAvatar.TeleportToNextEvent()
--or
timeUntilNextEvent = Space.Scene.PlayerAvatar.TeleportToNextEvent(500)
```
#### Properties[β](#properties "Direct link to Properties")
##### Username[β](#username "Direct link to Username")
string **Username** `get`
*Returns the avatar's current username (note: this can be changed by players for a small fee)*
* Lua
```lua
playerUsername = Space.Scene.PlayerAvatar.Username
```
* Lua
```lua
--this script, once clicked, will get all avatars in the scene
--and print their Username(including self)
--(Example: scoreboards/radars/scanners/game machines)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
allAvatars = Space.Scene.AllAvatars
for var=1, #allAvatars do
local Username = allAvatars[var].Username
Space.Log("Username: " .. Username)
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to print all avatars' Username"
thisGameObject.Clickable.OnClick(OnClick)
```
##### DisplayName[β](#displayname "Direct link to DisplayName")
string **DisplayName** `get`
*Returns the avatar's display name (falls back to Username if unset).*
* Lua
```lua
playerDisplayName = Space.Scene.PlayerAvatar.DisplayName
```
##### Title[β](#title "Direct link to Title")
string **Title** `get`
*Returns the avatar's current title*
* Lua
```lua
playerTitle = Space.Scene.PlayerAvatar.Title
```
* Lua
```lua
--this script, once clicked, will get all avatars in the scene
--and print their Title and Username(including self)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
allAvatars = Space.Scene.AllAvatars
for var=1, #allAvatars do
local Username = allAvatars[var].Username
local Title = allAvatars[var].Title
Space.Log(Title .. " " .. Username)
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to print all avatars' Titles and Username"
thisGameObject.Clickable.OnClick(OnClick)
```
##### OrgTitle[β](#orgtitle "Direct link to OrgTitle")
string **OrgTitle** `get`
*Returns the user's organizational job title (JobTitle).*
* Lua
```lua
playerJobTitle = Space.Scene.PlayerAvatar.OrgTitle
```
##### OrgName[β](#orgname "Direct link to OrgName")
string **OrgName** `get`
*Returns the user's organization/company name (Company).*
* Lua
```lua
playerCompanyName = Space.Scene.PlayerAvatar.OrgName
```
##### ID[β](#id "Direct link to ID")
long **ID** `get`
*Returns the avatar's user ID, please note if you store these, this is a 'long' value not a 'int'.*
* Lua
```lua
playerID = Space.Scene.PlayerAvatar.ID
```
* Lua
```lua
--this script, once clicked, will get all avatars in the scene
--and print their ID(including self)
--(Example: scoreboards/radars/scanners/game machines)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
allAvatars = Space.Scene.AllAvatars
for var=1, #allAvatars do
local ID = allAvatars[var].ID
Space.Log("ID: " .. ID)
end
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to print all avatars' ID"
thisGameObject.Clickable.OnClick(OnClick)
```
##### IsAttached[β](#isattached "Direct link to IsAttached")
bool **IsAttached** `get`
*Returns True if avatar is Attached*
* Lua
```lua
isAttached = Space.Scene.PlayerAvatar.IsAttached
```
##### MovementSpeed[β](#movementspeed "Direct link to MovementSpeed")
float **MovementSpeed** `get` `set`
*How fast the avatar's movement is*
* Lua
```lua
Space.Scene.PlayerAvatar.MovementSpeed = 20
```
* Lua
```lua
--the below script makes the object give the player triple movement speed
--once it's clicked, and then returns them to original speed after 10 seconds
--(Example: Triple Speed Powerup (avatar running race))
thisGameObject = Space.Host.ExecutingObject
TripleSpeedCoroutine = function()
local originalSpeed = Space.Scene.PlayerAvatar.MovementSpeed
Space.Scene.PlayerAvatar.MovementSpeed = originalSpeed * 3
coroutine.yield(10)
Space.Scene.PlayerAvatar.MovementSpeed = originalSpeed
end
OnClick = function()
Space.Host.StartCoroutine(TripleSpeedCoroutine)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Triple Speed Powerup!"
thisGameObject.Clickable.OnClick(OnClick)
```
##### JumpHeight[β](#jumpheight "Direct link to JumpHeight")
float **JumpHeight** `get` `set`
*How high the avatar's jump is*
* Lua
```lua
Space.Scene.PlayerAvatar.JumpHeight = 20
```
* Lua
```lua
--the below script makes the object give the player triple jump height
--once it's clicked, and then returns them to original jump height after 10 seconds
--(Example: Triple Jump Height Powerup )
thisGameObject = Space.Host.ExecutingObject
originalJumpHeight = Space.Scene.PlayerAvatar.JumpHeight
TripleJumpHeightCoroutine = function()
Space.Scene.PlayerAvatar.JumpHeight = originalJumpHeight * 3
coroutine.yield(10)
Space.Scene.PlayerAvatar.JumpHeight = originalJumpHeight
end
OnClick = function()
Space.Host.StartCoroutine(TripleJumpHeightCoroutine)
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Triple JumpHeight Powerup!"
thisGameObject.Clickable.OnClick(OnClick)
```
##### Guest[β](#guest "Direct link to Guest")
bool **Guest** `get`
*Is this Avatar a Guest?*
* Lua
```lua
isGuest = Space.Scene.PlayerAvatar.Guest
```
* Lua
```lua
--this script will make this object non-clickable for guest players
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OnClick = function()
Space.Log("Do Something")
end
if not thisPlayer.Guest then --if player is not guest
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
end
```
##### OutfitID[β](#outfitid "Direct link to OutfitID")
long **OutfitID** `get`
*Returns the current outfit ID of the avatar*
* Lua
```lua
avOutfit = Space.Scene.PlayerAvatar.OutfitID
```
##### Loaded[β](#loaded "Direct link to Loaded")
bool **Loaded** `get`
*Returns true if avatar is Loaded*
* Lua
```lua
isLoaded = Space.Scene.PlayerAvatar.Loaded
```
* Lua
```lua
--this script will wait for a joining avatar to load first before making it play an animation
--(otherwise that animation may be reset if played before load is complete)
NewJoinAnimation = Space.GetResource("The Animation")
OnPlayerJoin = function(NewAvatar)
Space.Host.StartCoroutine(function()
while not NewAvatar.Loaded do coroutine.yield(0) end --makes it wait
Space.Log("yes")
NewAvatar.PlayCustomAnimation(NewJoinAnimation) --at this point Loaded is True
end)
end
Space.Scene.OnPlayerJoin(OnPlayerJoin)
```
##### Gender[β](#gender "Direct link to Gender")
string **Gender** `get`
*Returns the avatar's gender as a string (e.g., "Male", "Female").*
* Lua
```lua
playerGender = Space.Scene.PlayerAvatar.Gender
```
##### LockObject[β](#lockobject "Direct link to LockObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **LockObject** `get`
*The object the Avatar is* [*Attached*](/scripting/client-scripting-api-reference/types/savatar.md#attachto) *to. Returns **Null** if Avatar is not attached.*
* Lua
```lua
lockObject = Space.Scene.PlayerAvatar.LockObject
```
##### Skeleton[β](#skeleton "Direct link to Skeleton")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Skeleton** `get`
*Returns a reference to avatar's skeleton GameObject*
* Lua
```lua
avSkeleton = Space.Scene.PlayerAvatar.Skeleton
```
* Lua
```lua
--clicking this object will replace your avatar's animator controller (found on the skeleton)
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
customController = Space.GetResource("animcont")
OnClick = function()
thisPlayer.Skeleton.Animator.Controller = customController
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### BlockMovement[β](#blockmovement "Direct link to BlockMovement")
bool **BlockMovement** `get` `set`
*If set to True, avatar's movement will be blocked*
* Lua
```lua
Space.Scene.PlayerAvatar.BlockMovement = true
```
* Lua
```lua
--the below script makes this object a boundary area where any user entering it
--will be blocked from movement for 20 seconds, then the object will release controls and
--destroy itself after that
--(Example: freezing trap)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
FrozenTime = 0.0
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockMovement = true
end
end
end
OnTriggerStay = function(TriggerStayer)
if TriggerStayer.Root.Avatar ~= nil then
if TriggerStayer.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
FrozenTime = FrozenTime + Space.DeltaTime
if FrozenTime > 20 then
Space.Scene.PlayerAvatar.BlockMovement = false
thisGameObject.Destroy()
end
end
end
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerStay(OnTriggerStay)
```
##### BlockRun[β](#blockrun "Direct link to BlockRun")
bool **BlockRun** `get` `set`
*Is the Avatar blocked from running?*
* Lua
```lua
Space.Scene.PlayerAvatar.BlockRun = true
```
* Lua
```lua
--this script will block a player's run ability when entering trigger collider and release it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockRun = true
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockRun = false
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### BlockFly[β](#blockfly "Direct link to BlockFly")
bool **BlockFly** `get` `set`
*Is the Avatar blocked from flying?*
* Lua
```lua
Space.Scene.PlayerAvatar.BlockFly = true
```
* Lua
```lua
--this script will block a player's fly ability when entering trigger collider and release it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockFly = true
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockFly = false
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### BlockCrouch[β](#blockcrouch "Direct link to BlockCrouch")
bool **BlockCrouch** `get` `set`
*Is the Avatar blocked from crouching?*
* Lua
```lua
Space.Scene.PlayerAvatar.BlockCrouch = true
```
* Lua
```lua
--this script will block a player's crouch ability when entering trigger collider and release it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockCrouch = true
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockCrouch = false
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### BlockJump[β](#blockjump "Direct link to BlockJump")
bool **BlockJump** `get` `set`
*Is the Avatar blocked from jumping?*
* Lua
```lua
Space.Scene.PlayerAvatar.BlockJump = true
```
* Lua
```lua
--this script will block a player's jump ability when entering trigger collider and release it when leaving
--[Requires this object to have a "Trigger" collider]
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OTS = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockJump= true
end
end
OTE = function(gameObject)
if gameObject.Avatar ~= nil and thisPlayer == gameObject.Avatar then
thisPlayer.BlockJump= false
end
end
thisObject.OnTriggerStart(OTS)
thisObject.OnTriggerExit(OTE)
```
##### IsGrounded[β](#isgrounded "Direct link to IsGrounded")
bool **IsGrounded** `get`
*Returns True if avatar is Grounded*
* Lua
```lua
isGrounded = Space.Scene.PlayerAvatar.IsGrounded
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*The reference to the Avatar's GameObject*
* Lua
```lua
playerObject = Space.Scene.PlayerAvatar.GameObject
```
* Lua
```lua
--Clicking this object will teleport you 2 units forward and make you face the opposite way
thisObject = Space.Host.ExecutingObject
thisPlayer = Space.Scene.PlayerAvatar
OnClick = function()
local targetPos = thisPlayer.GameObject.WorldPosition + (thisPlayer.GameObject.Forward * 2)
local targetRot = thisPlayer.GameObject.WorldRotation * Quaternion.AngleAxis(Vector.Up, 180)
thisPlayer.Teleport(targetPos, targetRot)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
---
### SAvatarAppearance
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**LoadOutfit** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#loadoutfit)(int outfitID) |
| void [**ResetOutfit** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#resetoutfit)() |
| void [**ResetOutfitToTemplate** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#resetoutfittotemplate)(int outfitID) |
| float [**GetSlider** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#getslider)(SAppearanceSlider slider) |
| float [**GetHeight** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#getheight)() |
| SColor [**GetSkinTone** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#getskintone)() |
| SColor [**GetEyeTone** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#geteyetone)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------- |
| long [**OutfitID** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#outfitid)`get` |
| SGameObject [**Skeleton** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#skeleton)`get` |
| bool [**Loaded** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#loaded)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/types/savatarappearance.md#gameobject)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### LoadOutfit[β](#loadoutfit "Direct link to LoadOutfit")
void **LoadOutfit** (int outfitID)
*Changes the current Avatar's outfit to outfitID. For a player Avatar, this only works on white-label grid. For NPC avatars, this works on all grids.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.AvatarAppearance.LoadOutfit(160)
```
* Lua
```lua
--this script toggles between 3 different outfits when NPC Statue object is clicked
--[Object needs to have an NPC Statue component]
outfits = {4134388, 4134385, 4134386}
currentOutfit = 0
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if currentOutfit == #outfits then
currentOutfit = 1
else
currentOutfit = currentOutfit + 1
end
thisObject.AvatarAppearance.LoadOutfit(outfits[currentOutfit])
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### ResetOutfit[β](#resetoutfit "Direct link to ResetOutfit")
void **ResetOutfit** ()
*Changes the current Avatar's outfit and resets it to outfitID 0. For a player Avatar, this only works on white-label grid. For NPC avatars, this works on all grids.*
* Lua
```lua
Space.Host.ExecutingObject.AvatarAppearance.ResetOutfit()
```
* Lua
```lua
--this script makes a UIButton reset an NPC statue outfit when clicked
--[UIButton object needs to be linked in scripting runtime references with name "button1"]
--[Object needs to have an NPC Statue component]
thisObject = Space.Host.ExecutingObject
refButton = Space.Host.GetReference("button1")
function OnClickFunction()
thisObject.AvatarAppearance.ResetOutfit()
end
refButton.UIButton.OnClick(OnClickFunction)
```
##### ResetOutfitToTemplate[β](#resetoutfittotemplate "Direct link to ResetOutfitToTemplate")
void **ResetOutfitToTemplate** (int outfitID)
*Changes the current Avatar's outfit to outfitID only if the player running this code already owns that outfit. For a player Avatar, this only works on white-label grid. For NPC avatars, this works on all grids.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.AvatarAppearance.ResetOutfitToTemplate(10001)
```
* Lua
```lua
--this script toggles between 3 different outfits when NPC Statue object is clicked
--[Object needs to have an NPC Statue component]
--For this function, the player needs to own this outfit. Use LoadOutfit if player might not own it
outfits = {4134388, 4134385, 4134386}
currentOutfit = 0
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
if currentOutfit == #outfits then
currentOutfit = 1
else
currentOutfit = currentOutfit + 1
end
thisObject.AvatarAppearance.ResetOutfitToTemplate(outfits[currentOutfit])
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### GetSlider[β](#getslider "Direct link to GetSlider")
float **GetSlider** (int slider)
*Return the value of Appearance Sliders.*
| Parameter | Type | Description |
| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slider | int | 1= Asian, 2= European, 3= African, 4= FaceShape, 5= FaceWidth, 6= FaceLength, 7= ForeheadShape, 8= ForeheadDepth, 9= CheekHeight, 10= CheekWidth, 11= JawShape, 12= JawWidth, 13= JawHeight, 14= EyebrowHeight, 15= EyebrowDepth, 16= EyeHeight, 17= EyeSpacing, 18= EyeSize, 19= EyeWidth, 20= EyeballSize, 21= EyeInside, 22= EyeOutside, 23= EyelashLength, 24= NoseWidth, 25= NoseDepth, 26= NoseHeight, 27= NoseShape, 28= NoseTipShape, 29= NostrilWidth, 30= MouthWidth, 31= MouthHeight, 32= MouthDepth, 33= UpperLipWidth, 34= UpperLipThickness, 35= LowerLipWidth, 36= LowerLipThickness, 37= Smile, 38= EarHeight, 39= EarWidth, 40= Earlobe, 41= EarShape, 42= Muscular, 43= Toned, 44= Grand, 45= Lean, 46= SkullHeight, 47= SkullWidth, 48= SkullDepth, 49= NeckThickness, 50= ShoulderThickness, 51= UpperArmThickness, 52= ForearmThickness, 53= WristSize, 54= ElbowThin, 55= HandThickness, 56= HandTone, 57= FingerWidth, 58= BustProximity, 59= BustSize, 60= ChestDepth, 61= PectoralSize, 62= PectoralHeight, 63= AbdomenMiddle, 64= AbdomenDepth, 65= WaistWidth, 66= HipSize, 67= GlutesSize, 68= GlutesHeight, 69= LoveHandles, 70= ThighSize, 71= KneeTone, 72= ShinSize, 73= AnkleTone, 74= FootThickness, 75= FootTone, 76= ToeWidth, 77= HeadSize, 78= NeckSize, 79= ShoulderSize, 80= UpperArmSize, 81= ForearmSize, 82= HandSize, 83= SpineSize, 84= ChestSize, 85= UpperLegSize, 86= LowerLegSize, 87= FeetSize, 88= ToesSize, 89= HeadPosition, 90= NeckLength, 91= ForearmLength, 92= HandPosition, 93= SpineLength, 94= ChestLength, 95= UpperLegLength, 96= LowerLegLength, 97= FeetLength, 98= ToesLength, 99= ShoulderHeight, 100= ShoulderWidth, 101= FeetFloorOffset |
* Lua
```lua
FaceLength = Space.Host.ExecutingObject.AvatarAppearance.GetSlider(AppearanceSlider.FaceLength)
```
* Lua
```lua
--this script updates a UIText with the current Face Length of the npc
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdateFunction = function()
uiText.Text = thisObject.AvatarAppearance.GetSlider(AppearanceSlider.FaceLength)
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### GetHeight[β](#getheight "Direct link to GetHeight")
float **GetHeight** ()
*Return height of avatar.*
* Lua
```lua
height = Space.Host.ExecutingObject.AvatarAppearance.GetHeight()
```
* Lua
```lua
--this script updates a UIText with the height of this NPC statue
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdateFunction = function()
uiText.Text = thisObject.AvatarAppearance.GetHeight()
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### GetSkinTone[β](#getskintone "Direct link to GetSkinTone")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **GetSkinTone** ()
*Return skin tone of avatar.*
* Lua
```lua
SkinTone = Space.Host.ExecutingObject.AvatarAppearance.GetSkinTone()
```
* Lua
```lua
--this script updates a UIText with the current Skin Tone of the npc
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdateFunction = function()
uiText.Text = thisObject.AvatarAppearance.GetSkinTone().ToString()
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### GetEyeTone[β](#geteyetone "Direct link to GetEyeTone")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **GetEyeTone** ()
*Return eye tone of avatar.*
* Lua
```lua
EyeTone = Space.Host.ExecutingObject.AvatarAppearance.GetEyeTone()
```
* Lua
```lua
--this script updates a UIText with the current Eye Tone of the npc
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdateFunction = function()
uiText.Text = thisObject.AvatarAppearance.GetEyeTone().ToString()
end
thisObject.OnUpdate(OnUpdateFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### OutfitID[β](#outfitid "Direct link to OutfitID")
long **OutfitID** `get`
*Return the current outfit id.*
* Lua
```lua
outfitID= Space.Host.ExecutingObject.AvatarAppearance.OutfitID
```
* Lua
```lua
--this script updates a UIText with the current outfit ID of the npc
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdateFunction = function()
uiText.Text = thisObject.GameObject.AvatarAppearance.OutfitID
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### Skeleton[β](#skeleton "Direct link to Skeleton")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Skeleton** `get`
*Return the GameObject of avatar skeleton.*
* Lua
```lua
playerSkeleton = Space.Host.ExecutingObject.AvatarAppearance.Skeleton
```
##### Loaded[β](#loaded "Direct link to Loaded")
bool **Loaded** `get`
*Returns true if the avatar is full loaded.*
* Lua
```lua
isLoaded= Space.Host.ExecutingObject.AvatarAppearance.Loaded
```
* Lua
```lua
--this script updates a UIText with the loading status of the npc
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("thetext").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdateFunction = function()
uiText.Text = thisObject.AvatarAppearance.Loaded
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Property Description*
* Lua
```lua
npcGameObject = Space.Host.ExecutingObject.AvatarAppearance.GameObject
```
---
### SChatMessage
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Attribute Name |
| --------------------------------------------------------------------------------------------------- |
| uint [**SenderID** ](/scripting/client-scripting-api-reference/types/schatmessage.md#senderid)`get` |
| string [**Sender** ](/scripting/client-scripting-api-reference/types/schatmessage.md#sender)`get` |
| string [**Channel** ](/scripting/client-scripting-api-reference/types/schatmessage.md#channel)`get` |
| string [**Message** ](/scripting/client-scripting-api-reference/types/schatmessage.md#message)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### SenderID[β](#senderid "Direct link to SenderID")
uint **SenderID** `get`
*ID of the sender of the message*
* Lua
```lua
function oc(chatm)
Space.Log(chatm.SenderID)
end
Space.Network.Chat.OnChat(oc)
```
* Lua
```lua
--this script processes every new chat message and makes a UIText display the Sender's ID
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime
OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.SenderID
end
Space.Network.Chat.OnChat(OnChatFunction)
```
##### Sender[β](#sender "Direct link to Sender")
string **Sender** `get`
*Name of the sender of the message*
* Lua
```lua
function oc(chatm)
Space.Log(chatm.Sender)
end
Space.Network.Chat.OnChat(oc)
```
* Lua
```lua
--this script processes every new chat message and makes a UIText display the Sender name
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime
OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Sender
end
Space.Network.Chat.OnChat(OnChatFunction)
```
##### Channel[β](#channel "Direct link to Channel")
string **Channel** `get`
*Name of the channel*
* Lua
```lua
function oc(chatm)
Space.Log(chatm.Channel)
end
Space.Network.Chat.OnChat(oc)
```
* Lua
```lua
--this script processes every new chat message and makes a UIText display the channel's name
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime
OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Channel
end
Space.Network.Chat.OnChat(OnChatFunction)
```
##### Message[β](#message "Direct link to Message")
string **Message** `get`
*The contents of the chat message*
* Lua
```lua
function oc(chatm)
Space.Log(chatm.Message)
end
Space.Network.Chat.OnChat(oc)
```
* Lua
```lua
--this script processes every new chat message and makes a UIText display the Message
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime
OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Message
end
Space.Network.Chat.OnChat(OnChatFunction)
```
---
### SColor
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| --------------------------------------------------------------------------------------------------------------------------- |
| string [**ToHex** ](/scripting/client-scripting-api-reference/types/scolor.md#tohex)() |
| SColor [**Lerp** ](/scripting/client-scripting-api-reference/types/scolor.md#lerp)(SColor b, float t) |
| bool [**Equals** ](/scripting/client-scripting-api-reference/types/scolor.md#equals)(SColor other) |
| override string [**ToString** ](/scripting/client-scripting-api-reference/types/scolor.md#tostring)() |
| static SColor [**New** ](/scripting/client-scripting-api-reference/types/scolor.md#new)(float r, float g, float b, float a) |
| static SColor [**FromHex** ](/scripting/client-scripting-api-reference/types/scolor.md#fromhex)(string hex) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------- |
| float [**R** ](/scripting/client-scripting-api-reference/types/scolor.md#r)`get` |
| float [**G**](/scripting/client-scripting-api-reference/types/scolor.md#g) `get` |
| float [**B**](/scripting/client-scripting-api-reference/types/scolor.md#b) `get` |
| float [**A**](/scripting/client-scripting-api-reference/types/scolor.md#a) `get` |
| SColor [**Black** ](/scripting/client-scripting-api-reference/types/scolor.md#black)`get` |
| SColor [**White** ](/scripting/client-scripting-api-reference/types/scolor.md#white)`get` |
| SColor [**Red** ](/scripting/client-scripting-api-reference/types/scolor.md#red)`get` |
| SColor [**Blue** ](/scripting/client-scripting-api-reference/types/scolor.md#blue)`get` |
| SColor [**Green** ](/scripting/client-scripting-api-reference/types/scolor.md#green)`get` |
| SColor [**Yellow** ](/scripting/client-scripting-api-reference/types/scolor.md#yellow)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### ToHex[β](#tohex "Direct link to ToHex")
string **ToHex** ()
*Return the Hex value of the color.*
* Lua
```lua
colorRedHex = Color.Red.ToHex()
```
##### Lerp[β](#lerp "Direct link to Lerp")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Lerp** ([SColor](/scripting/client-scripting-api-reference/types/scolor.md) b, float t)
*Linearly interpolates between current color and b by t.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
lerpedRedBlue = Color.Blue.Lerp(Color.Red, 0.5)
```
* Lua
```lua
--create a cube and set a new material.
--add ScriptingRuntime.
local mat=Space.Host.ExecutingObject.Renderer.Material
function ChangeColor()
mat.SetColor("_Color",Color.Red.Lerp(Color.Blue,Space.Math.PingPong(Space.Time,1)))
end
Space.Host.ExecutingObject.OnUpdate(ChangeColor)
```
##### Equals[β](#equals "Direct link to Equals")
bool **Equals** ([SColor](/scripting/client-scripting-api-reference/types/scolor.md) other)
*Returns true if colors are same.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isItTrue = Color.Red.Equals(Color.Blue)
```
##### ToString[β](#tostring "Direct link to ToString")
string **ToString** ()
*Returns the RGBA value of the current color.*
* Lua
```lua
redString = Color.Red.ToString()
```
##### New[β](#new "Direct link to New")
static [SColor](/scripting/client-scripting-api-reference/types/scolor.md) **New** (float r, float g, float b, float a)
*Create a color by red, green, blue and alpha parameters.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
theColor = Color.New(255.0, 0.0, 0.0, 1.0)
```
##### FromHex[β](#fromhex "Direct link to FromHex")
static [SColor](/scripting/client-scripting-api-reference/types/scolor.md) **FromHex** (string hex)
*Create a color by Hex value.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
fromHex = Color.FromHex('FF0000')
```
#### Properties[β](#properties "Direct link to Properties")
##### R[β](#r "Direct link to R")
float **R** `get`
*Property Description*
* Lua
```lua
r = Color.Red.R
```
##### G[β](#g "Direct link to G")
float **G** `get`
*Property Description*
* Lua
```lua
g = Color.Red.G
```
##### B[β](#b "Direct link to B")
float **B** `get`
*Property Description*
* Lua
```lua
g = Color.Red.B
```
##### A[β](#a "Direct link to A")
float **A** `get`
*Property Description*
* Lua
```lua
g = Color.Red.A
```
##### Black[β](#black "Direct link to Black")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Black** `get`
*Solid black. RGBA is (0, 0, 0, 1).*
* Lua
```lua
blackColor = Color.Black
```
##### White[β](#white "Direct link to White")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **White** `get`
*Solid White. RGBA is (1, 1, 1, 1).*
* Lua
```lua
whiteColor = Color.White
```
##### Red[β](#red "Direct link to Red")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Red** `get`
*Solid Red. RGBA is (1, 0, 0, 1).*
* Lua
```lua
blackRed = Color.Red
```
##### Blue[β](#blue "Direct link to Blue")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Blue** `get`
*Solid Blue. RGBA is (0, 0, 1, 1).*
* Lua
```lua
blueColor = Color.Blue
```
##### Green[β](#green "Direct link to Green")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Green** `get`
*Solid Green. RGBA is (0, 1, 0, 1).*
* Lua
```lua
greenColor = Color.Green
```
##### Yellow[β](#yellow "Direct link to Yellow")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **Yellow** `get`
*Yellow. RGBA is (1, 0.92, 0.016, 1).*
* Lua
```lua
yellowColor = Color.Yellow
```
---
### SCommandBuffer
##### DrawRenderer[β](#drawrenderer "Direct link to DrawRenderer")
void **DrawRenderer** ([SRenderer](/scripting/client-scripting-api-reference/components/srenderer.md) renderer, [SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) material)
*Add a "draw renderer" command.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
commandbuffer=Space.PostFX.CreateCommandBuffer()
mat=Space.Resources[1]
cube=Space.Host.GetReference("Cube")
commandbuffer.DrawRenderer(cube.Renderer,mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
```
##### Blit[β](#blit "Direct link to Blit")
void **Blit** ([SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) mat)
*Add a "bit into a render texture" command.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
commandbuffer=Space.PostFX.CreateCommandBuffer()
mat=Space.Resources[1]
commandbuffer.Blit(mat.AsMaterial)
Space.PostFX.AddCommandBufferToCamera(commandbuffer)
```
---
### SDateTime
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Equals** ](/scripting/client-scripting-api-reference/types/sdatetime.md#equals)(SDateTime other) |
| int [**ComparesTo** ](/scripting/client-scripting-api-reference/types/sdatetime.md#comparesto)(SDateTime other) |
| string [**FormatLocal** ](/scripting/client-scripting-api-reference/types/sdatetime.md#formatlocal)(string format) |
| string [**FormatGlobal** ](/scripting/client-scripting-api-reference/types/sdatetime.md#formatlocal)(string format) |
| string [**Regional** ](/scripting/client-scripting-api-reference/types/sdatetime.md#regional)(string region) |
| string [**FormatRegional** ](/scripting/client-scripting-api-reference/types/sdatetime.md#formatregional)(string region, string format) |
| SDateTime [**AddYears** ](/scripting/client-scripting-api-reference/types/sdatetime.md#addyears)(int amount) |
| SDateTime [**AddMonths** ](/scripting/client-scripting-api-reference/types/sdatetime.md#addmonths)(int amount) |
| SDateTime [**AddDays** ](/scripting/client-scripting-api-reference/types/sdatetime.md#adddays)(double amount) |
| SDateTime [**AddHours** ](/scripting/client-scripting-api-reference/types/sdatetime.md#addhours)(double amount) |
| SDateTime [**AddMinutes** ](/scripting/client-scripting-api-reference/types/sdatetime.md#addminutes)(double amount) |
| SDateTime [**AddSeconds** ](/scripting/client-scripting-api-reference/types/sdatetime.md#addseconds)(double amount) |
| SDateTime [**AddMilliseconds** ](/scripting/client-scripting-api-reference/types/sdatetime.md#functionname-1)(double amount) |
| |
| |
| **Static Functions** |
| static SDateTime [**Now**](/scripting/client-scripting-api-reference/types/sdatetime.md#now)() |
| static SDateTime [**Server** ](/scripting/client-scripting-api-reference/types/sdatetime.md#server)() |
| static SDateTime [**Parse**](/scripting/client-scripting-api-reference/types/sdatetime.md#parse) (string input) |
| static bool [**IsLeapYear**](/scripting/client-scripting-api-reference/types/sdatetime.md#isleapyear) (int year) |
| static int [**DaysInMonth** ](/scripting/client-scripting-api-reference/types/sdatetime.md#daysinmonth)(int year, int month) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------ |
| int [**Year** ](/scripting/client-scripting-api-reference/types/sdatetime.md#year)`get` |
| int [**Month** ](/scripting/client-scripting-api-reference/types/sdatetime.md#month)`get` |
| int [**Day** ](/scripting/client-scripting-api-reference/types/sdatetime.md#day)`get` |
| int [**Hour** ](/scripting/client-scripting-api-reference/types/sdatetime.md#hour)`get` |
| int [**Minute** ](/scripting/client-scripting-api-reference/types/sdatetime.md#minute)`get` |
| int [**Second** ](/scripting/client-scripting-api-reference/types/sdatetime.md#second)`get` |
| int [**Millisecond** ](/scripting/client-scripting-api-reference/types/sdatetime.md#millisecond)`get` |
| string [**Local** ](/scripting/client-scripting-api-reference/types/sdatetime.md#local)`get` |
| string [**Global** ](/scripting/client-scripting-api-reference/types/sdatetime.md#global)`get` |
| int [**UnixTime** ](/scripting/client-scripting-api-reference/types/sdatetime.md#unixtime)`get` |
| bool [**IsDaylightSavingTime** ](/scripting/client-scripting-api-reference/types/sdatetime.md#isdaylightsavingtime)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Equals[β](#equals "Direct link to Equals")
bool **Equals** (SDateTime other)
*Returns true if the datetimes are same.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
\`\`\` ATargetDateTime = DateTime.Now().AddMinutes(5) AreEqual = ATargetDateTime.Equals(DateTime.Now()) \`\`\`
##### ComparesTo[β](#comparesto "Direct link to ComparesTo")
int **ComparesTo** (SDateTime other)
*Compares two datetimes and returns an integer. 0 == identical. greater than 0 == This datetime is greater than other. less than 0 == This datetime is less than other.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
ATargetDateTime = DateTime.Now().AddMinutes(5)
AreEqual = ATargetDateTime.ComparesTo(DateTime.Now())
```
##### FormatLocal[β](#formatlocal "Direct link to FormatLocal")
string **FormatLocal** (string format)
*Outputs a custom formatted string with the date and time according to local language rules.*
| Parameter | Type | Description |
| --------- | ------ | ---------------------- |
| format | string | See below for examples |
* Lua
```lua
localTimeCustomFormat = DateTime.Now().FormatLocal("dddd, MMMM dd, yyyy h:mm:ss tt")
```
* Lua
\`\`\` --Example format strings
\--\[\[ format = "dddd, MMMM dd, yyyy h:mm:ss tt" Result: Monday, May 28, 2012 11:35:00 AM
format = "Ldddd, MMMM dd, yyyy" Result: Monday, May 28, 2012
format = "h:mm:ss tt" Result: 11:35:00 AM
format = "MMMM dd" Result: May 28
format = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT" Result: Mon, 28 May 2012 11:35:00 GMT
format = "M/d/yyyy" Result: 5/28/2012
format = "h:mm tt" Result: 11:35 AM
format = "yyyy'-'MM'-'dd'T'HH':'mm':'ss" Result: 2012-05-28T11:35:00
format = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'" Result: 2012-05-28 11:35:00Z
format = "MMMM, yyyy" Result: May, 2012 --]] \`\`\`
##### FunctionName[β](#functionname "Direct link to FunctionName")
string **FormatGlobal** (string format)
*Outputs a custom formatted string with the date and time according to global rules (culture invariant).*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
GlobalTimeCustomFormat = DateTime.Now().FormatLocal("dddd, MMMM dd, yyyy h:mm:ss tt")
```
* Lua
```lua
--Example format strings
--[[
format = "dddd, MMMM dd, yyyy h:mm:ss tt"
Result: Monday, May 28, 2012 11:35:00 AM
format = "Ldddd, MMMM dd, yyyy"
Result: Monday, May 28, 2012
format = "h:mm:ss tt"
Result: 11:35:00 AM
format = "MMMM dd"
Result: May 28
format = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT"
Result: Mon, 28 May 2012 11:35:00 GMT
format = "M/d/yyyy"
Result: 5/28/2012
format = "h:mm tt"
Result: 11:35 AM
format = "yyyy'-'MM'-'dd'T'HH':'mm':'ss"
Result: 2012-05-28T11:35:00
format = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"
Result: 2012-05-28 11:35:00Z
format = "MMMM, yyyy"
Result: May, 2012
--]]
```
##### Regional[β](#regional "Direct link to Regional")
string **Regional** (string region)
*Outputs a string with the date and time formatted according to specific regional rules.*
| Parameter | Type | Description |
| --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
| region | string | [List available here](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) |
* Lua
```lua
stringTimeRegional = DateTime.Now().Regional('en-us')
```
##### FormatRegional[β](#formatregional "Direct link to FormatRegional")
string **FormatRegional** (string region, string format)
*Outputs a custom formatted string with the date and time according to specific regional rules.*
| Parameter | Type | Description |
| --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
| region | string | [List available here](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) |
| format | string | See below |
* Lua
```lua
stringTimeFormatRegional = DateTime.Now().FormatRegional('en-us','dddd, MMMM dd, yyyy h:mm:ss tt')
```
* Lua
```lua
--Example format strings
--[[
format = "dddd, MMMM dd, yyyy h:mm:ss tt"
Result: Monday, May 28, 2012 11:35:00 AM
format = "Ldddd, MMMM dd, yyyy"
Result: Monday, May 28, 2012
format = "h:mm:ss tt"
Result: 11:35:00 AM
format = "MMMM dd"
Result: May 28
format = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT"
Result: Mon, 28 May 2012 11:35:00 GMT
format = "M/d/yyyy"
Result: 5/28/2012
format = "h:mm tt"
Result: 11:35 AM
format = "yyyy'-'MM'-'dd'T'HH':'mm':'ss"
Result: 2012-05-28T11:35:00
format = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"
Result: 2012-05-28 11:35:00Z
format = "MMMM, yyyy"
Result: May, 2012
--]]
```
##### AddYears[β](#addyears "Direct link to AddYears")
SDateTime **AddYears** (int amount)
*Return a new SDateTime that is the current date time + amount years.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5YearsLater = DateTime.Now().AddYears(5)
```
##### AddMonths[β](#addmonths "Direct link to AddMonths")
SDateTime **AddMonths** (int amount)
*Return a new SDateTime that is the current date time + amount months.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5MonthsLater = DateTime.Now().AddMonths(5)
```
##### AddDays[β](#adddays "Direct link to AddDays")
SDateTime **AddDays** (double amount)
*Return a new SDateTime that is the current date time + amount days.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5DaysLater = DateTime.Now().AddDays(5)
```
##### AddHours[β](#addhours "Direct link to AddHours")
SDateTime **AddHours** (double amount)
*Return a new SDateTime that is the current date time + amount hours.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5HoursLater = DateTime.Now().AddHours(5)
```
##### AddMinutes[β](#addminutes "Direct link to AddMinutes")
SDateTime **AddMinutes** (double amount)
*Return a new SDateTime that is the current date time + amount minutes.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5MinutesLater = DateTime.Now().AddMinutes(5)
```
##### AddSeconds[β](#addseconds "Direct link to AddSeconds")
SDateTime **AddSeconds** (double amount)
*Return a new SDateTime that is the current date time + amount seconds.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5SecondsLater = DateTime.Now().AddSeconds(5)
```
##### AddMilliseconds[β](#addmilliseconds "Direct link to AddMilliseconds")
SDateTime **AddMilliseconds** (double amount)
*Return a new SDateTime that is the current date time + amount milliseconds.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
date5MillisecondsLater = DateTime.Now().AddMilliseconds(5)
```
##### Now[β](#now "Direct link to Now")
static SDateTime **Now**()
*Creates a new SDateTime object equal to the current local time.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
localDateTime = DateTime.Now()
```
##### Server[β](#server "Direct link to Server")
static SDateTime **Server** ()
*Creates a new SDateTime object equal to the current server time.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
serverDateTime = DateTime.Server()
```
##### Parse[β](#parse "Direct link to Parse")
static SDateTime **Parse** (string input)
*Creates a new SDateTime object by attempting to parse a string input. Returns null/nil if the string cannot be parsed.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
parseDateTime = DateTime.Parse('10/3/2022 1:26:02 PM')
```
##### IsLeapYear[β](#isleapyear "Direct link to IsLeapYear")
static bool **IsLeapYear** (int year)
*Return true if the specified year is a leap year.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isLeapYear = DateTime.IsLeapYear(2024)
```
##### DaysInMonth[β](#daysinmonth "Direct link to DaysInMonth")
static int **DaysInMonth** (int year, int month)
*Return the number of days in the given month for the given year.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isLeapYear = DateTime.DaysInMonth(2022, 8)
```
#### Properties[β](#properties "Direct link to Properties")
##### Year[β](#year "Direct link to Year")
int **Year** `get`
*Get the independent time unit property of the SDateTime object.*
* Lua
```lua
currentYear = DateTime.Now().Year
```
##### Month[β](#month "Direct link to Month")
int **Month** `get`
*Property Description*
* Lua
```lua
currentMonth = DateTime.Now().Month
```
##### Day[β](#day "Direct link to Day")
int **Day** `get`
*Property Description*
* Lua
```lua
currentDay = DateTime.Now().Day
```
##### Hour[β](#hour "Direct link to Hour")
int **Hour** `get`
*Property Description*
* Lua
```lua
currentHour = DateTime.Now().Hour
```
##### Minute[β](#minute "Direct link to Minute")
int **Minute** `get`
*Property Description*
* Lua
```lua
currentMinute = DateTime.Now().Minute
```
##### Second[β](#second "Direct link to Second")
int **Second** `get`
*Property Description*
* Lua
```lua
currentSecond = DateTime.Now().Second
```
##### Millisecond[β](#millisecond "Direct link to Millisecond")
int **Millisecond** `get`
*Property Description*
* Lua
```lua
currentMillisecond = DateTime.Now().Millisecond
```
##### Local[β](#local "Direct link to Local")
string **Local** `get`
*Outputs a string with the date and time formatted according to local language rules.*
* Lua
```lua
currentTimeStringLocal = DateTime.Now().Local
```
##### Global[β](#global "Direct link to Global")
string **Global** `get`
*Outputs a string with the date and time formatted according to global rules (culture invariant).*
* Lua
```lua
currentTimeStringGlobal = DateTime.Now().Global
```
##### UnixTime[β](#unixtime "Direct link to UnixTime")
int **UnixTime** `get`
*Return this time in Unix time, the number of seconds since Jan 1st, 1970.*
* Lua
```lua
currentUnixTime = DateTime.Now().UnixTime
```
##### IsDaylightSavingTime[β](#isdaylightsavingtime "Direct link to IsDaylightSavingTime")
bool **IsDaylightSavingTime** `get`
*Indicates whether this instance of DateTime is within the daylight saving time range for the current time zone.*
* Lua
```lua
isCurrentTimeDaylightSaving = DateTime.Now().IsDaylightSavingTime
```
---
### SGameObject
#### Functions[β](#functions "Direct link to Functions")
##### SubscribeToEvents[β](#subscribetoevents "Direct link to SubscribeToEvents")
void **SubscribeToEvents** ()
*Causes this script to start listening to events on the object.*
info
***This function is now automatically called by events that require it***
* Lua
```lua
Space.Host.ExecutingObject.SubscribeToEvents()
```
##### SetSiblingIndex[β](#setsiblingindex "Direct link to SetSiblingIndex")
void **SetSiblingIndex** (int newIndex)
*Sets the sibling index.*
*Use this to change the sibling index of the GameObject. If a GameObject shares a parent with other GameObjects and are on the same level (i.e. they share the same direct parent), these GameObjects are known as siblings. The sibling index shows where each GameObject sits in this sibling hierarchy.*
*Use SetSiblingIndex to change the GameObjectβs place in this hierarchy. When the sibling index of a GameObject is changed, its order in the Hierarchy window will also change.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.SetSiblingIndex(2)
```
##### SetAsFirstSibling[β](#setasfirstsibling "Direct link to SetAsFirstSibling")
void **SetAsFirstSibling** ()
*This GameObject becomes the first Sibling*
* Lua
```lua
Space.Host.ExecutingObject.SetAsFirstSibling()
```
##### SetAsLastSibling[β](#setaslastsibling "Direct link to SetAsLastSibling")
void **SetAsLastSibling** ()
*This GameObject becomes the last Sibling*
* Lua
```lua
Space.Host.ExecutingObject.SetAsLastSibling()
```
##### Duplicate[β](#duplicate "Direct link to Duplicate")
SGameObject **Duplicate** ()
*Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity*
* Lua
```lua
local copy = Space.Host.ExecutingObject.Duplicate()
```
* Lua
```lua
--this script will make this object, once clicked, duplicate itself, then the duplicate
--moves up and then duplicate itself again and the duplicate move down (total 3 vertically aligned)
--(Example: cells multiplying)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
local firstDuplicate = thisGameObject.Duplicate()
firstDuplicate.WorldPosition = firstDuplicate.WorldPosition + firstDuplicate.Up
local secondDuplicate = thisGameObject.Duplicate()
secondDuplicate.WorldPosition = secondDuplicate.WorldPosition - secondDuplicate.Up
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to watch me multiply "
thisGameObject.Clickable.OnClick(OnClick)
```
##### Instantiate[β](#instantiate "Direct link to Instantiate")
SGameObject **Instantiate** ()
*Copy of Duplicate() for convenience*
* Lua
```lua
NewGameObject = Space.Host.ExecutingObject.Instantiate()
```
* Lua
```lua
--this script will make this object, once clicked, duplicate itself, then the duplicate
--moves up and then duplicate itself again and the duplicate move down (total 3 vertically aligned)
--(Example: cells multiplying)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
local firstDuplicate = thisGameObject.Instantiate()
firstDuplicate.WorldPosition = firstDuplicate.WorldPosition + firstDuplicate.Up
local secondDuplicate = thisGameObject.Instantiate()
secondDuplicate.WorldPosition = secondDuplicate.WorldPosition - secondDuplicate.Up
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to watch me multiply "
thisGameObject.Clickable.OnClick(OnClick)
```
##### AddHingeJoint[β](#addhingejoint "Direct link to AddHingeJoint")
[SHingeJoint](/scripting/client-scripting-api-reference/components/shingejoint.md) **AddHingeJoint** ()
*Adds a Hinge Joint component to this Game Object and returns its reference*
* Lua
```lua
NewHingeJoint = Space.Host.ExecutingObject.AddHingeJoint()
```
* Lua
```lua
--clicking this object will add a Hinge Joint component to it at runtime
thisObject = Space.Host.ExecutingObject
OnClick = function()
HJ = thisObject.AddHingeJoint()
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### AddLight[β](#addlight "Direct link to AddLight")
[SLight](/scripting/client-scripting-api-reference/components/slight.md) **AddLight** ()
*Adds a Light component to the object.*
* Lua
```lua
newLightComponent = Space.Host.ExecutingObject.AddLight()
```
##### AddAnimator[β](#addanimator "Direct link to AddAnimator")
[SAnimator](/scripting/client-scripting-api-reference/components/sanimator.md) **AddAnimator** ()
*Adds an Animator component to this Game Object and returns its reference*
* Lua
```lua
NewAnimator = Space.Host.ExecutingObject.AddAnimator()
```
* Lua
```lua
--clicking this object will add an animator to it and controller at runtime
thisObject = Space.Host.ExecutingObject
theResource = Space.GetResource("An Animator Controller") -- add controller to resources in Scripting Runtime
OnClick = function()
Animator = thisObject.AddAnimator()
Animator.Controller = theResource
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### AddAudioSource[β](#addaudiosource "Direct link to AddAudioSource")
[SAudioSource](/scripting/client-scripting-api-reference/components/saudiosource.md) **AddAudioSource** ()
*Adds an AudioSource component to the object.*
* Lua
```lua
newAudioSourceComponent = Space.Host.ExecutingObject.AddAudioSource()
```
##### AddClickable[β](#addclickable "Direct link to AddClickable")
[SClickable](/scripting/client-scripting-api-reference/components/sclickable.md) **AddClickable** ()
*Adds a Clickable component to the object.*
* Lua
```lua
newClikcableComponent = Space.Host.ExecutingObject.AddClickable()
```
##### GetScript[β](#getscript "Direct link to GetScript")
[SScriptingRuntime](/scripting/client-scripting-api-reference/components/sscriptingruntime.md) **GetScript** (string name)
*Returns a Scripting Runtime component attached to this object by Component Name, or nil if none exist*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingRuntime = Space.Host.ExecutingObject.GetScript("scriptingruntimecomponentname")
```
##### GetScriptsInChildren[β](#getscriptsinchildren "Direct link to GetScriptsInChildren")
List< [SScriptingRuntime](/scripting/client-scripting-api-reference/components/sscriptingruntime.md) > **GetScriptsInChildren** (string name, bool includeInactive=false)
*Returns Scripting Runtime components attached to this object by Component Name or its children*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableScriptsInChildren = Space.Host.ExecutingObject.GetScriptsInChildren("scriptingruntimecomponentname",true)
```
##### GetScriptInChildren[β](#getscriptinchildren "Direct link to GetScriptInChildren")
[SScriptingRuntime](/scripting/client-scripting-api-reference/components/sscriptingruntime.md) **GetScriptInChildren** (string name, bool includeInactive=false)
*Returns a Scripting Runtime component attached to this object or its children by Component Name, or nil if none exist*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingRuntimeInChildren = Space.Host.ExecutingObject.GetScriptInChildren("scriptingruntimecomponentname",true)
```
##### GetScriptInParent[β](#getscriptinparent "Direct link to GetScriptInParent")
[SScriptingRuntime](/scripting/client-scripting-api-reference/components/sscriptingruntime.md) **GetScriptInParent** (string name)
*Returns a Scripting Runtime component attached to this object or its parents by Component Name, or nil if none exist*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingRuntimeInParent = Space.Host.ExecutingObject.GetScript("scriptingruntimecomponentname")
```
##### GetEvents[β](#getevents "Direct link to GetEvents")
[SScriptingEvents](/scripting/client-scripting-api-reference/components/sscriptingevents.md) **GetEvents** (string name)
*Function Description*
| Parameter | Type | Description |
| --------- | ------ | ----------- |
| name | string | |
* Lua
```lua
scriptingEvent = Space.Host.ExecutingObject.GetEvents('ScriptingEventsComponentName')
```
##### GetAllEventsInChildren[β](#getalleventsinchildren "Direct link to GetAllEventsInChildren")
List< [SScriptingEvents](/scripting/client-scripting-api-reference/components/sscriptingevents.md) > **GetAllEventsInChildren** (string name, bool includeInactive=false)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableScriptingEvent = Space.Host.ExecutingObject.GetAllEventsInChildren
```
##### GetEventsInChildren[β](#geteventsinchildren "Direct link to GetEventsInChildren")
[SScriptingEvents](/scripting/client-scripting-api-reference/components/sscriptingevents.md) **GetEventsInChildren** (string name, bool includeInactive=false)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingEvent = Space.Host.ExecutingObject.GetEventsInChildren('ScriptingEventsComponentName')
--or
scriptingEvent = Space.Host.ExecutingObject.GetEventsInChildren('ScriptingEventsComponentName', true)
```
##### GetEventsInParent[β](#geteventsinparent "Direct link to GetEventsInParent")
[SScriptingEvents](/scripting/client-scripting-api-reference/components/sscriptingevents.md) **GetEventsInParent** (string name)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingEvent = Space.Host.ExecutingObject.GetEventsInParent('ScriptingEventsComponentName')
```
##### GetResources[β](#getresources "Direct link to GetResources")
[SScriptingResources](/scripting/client-scripting-api-reference/components/sscriptingresources.md) **GetResources** (string name)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.GetResources('ResourcesComponentName')
```
##### GetAllResourcesInChildren[β](#getallresourcesinchildren "Direct link to GetAllResourcesInChildren")
List< [SScriptingResources](/scripting/client-scripting-api-reference/components/sscriptingresources.md) > **GetAllResourcesInChildren** (string name, bool includeInactive=false)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableScriptingResources = Space.Host.ExecutingObject.GetAllResourcesInChildren('ScriptingResourcesComponentName')
--or
tableScriptingResources = Space.Host.ExecutingObject.GetAllResourcesInChildren('ScriptingResourcesComponentName', true)
```
##### GetResourcesInChildren[β](#getresourcesinchildren "Direct link to GetResourcesInChildren")
[SScriptingResources](/scripting/client-scripting-api-reference/components/sscriptingresources.md) **GetResourcesInChildren** (string name, bool includeInactive=false)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInChildren('ScriptingResourcesComponentName')
--or
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInChildren('ScriptingResourcesComponentName', true)
```
##### GetResourcesInParent[β](#getresourcesinparent "Direct link to GetResourcesInParent")
[SScriptingResources](/scripting/client-scripting-api-reference/components/sscriptingresources.md) **GetResourcesInParent** (string name)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInParent('ScriptingResourcesComponentName')
```
##### GetData[β](#getdata "Direct link to GetData")
[SScriptingData](/scripting/client-scripting-api-reference/components/sscriptingdata.md) **GetData** (string name)
*Returns a Scripting Data component attached to this object by Component Name, or nil if none exist*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingData = Space.Host.ExecutingObject.GetData("scriptingdatacomponentname")
```
##### GetAllDataInChildren[β](#getalldatainchildren "Direct link to GetAllDataInChildren")
List< [SScriptingData](/scripting/client-scripting-api-reference/components/sscriptingdata.md) > **GetAllDataInChildren** (string name, bool includeInactive=false)
*Returns Scripting Data components attached to this object by Component Name or its children*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
tableScriptingDataInChildren = Space.Host.ExecutingObject.GetAllDataInChildren("scriptingdatacomponentname",true)
```
##### GetDataInChildren[β](#getdatainchildren "Direct link to GetDataInChildren")
[SScriptingData](/scripting/client-scripting-api-reference/components/sscriptingdata.md) **GetDataInChildren** (string name, bool includeInactive=false)
*Returns a Scripting Data component attached to this object or its children by Component Name, or nil if none exist*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingDataInChildren = Space.Host.ExecutingObject.GetDataInChildren("scriptingdatacomponentname",true)
```
##### GetDataInParent[β](#getdatainparent "Direct link to GetDataInParent")
[SScriptingData](/scripting/client-scripting-api-reference/components/sscriptingdata.md) **GetDataInParent** (string name)
*Returns a Scripting Data component attached to this object or its parents by Component Name, or nil if none exist*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
scriptingDataInParent = Space.Host.ExecutingObject.GetDataInParent("scriptingdatacomponentname")
```
##### AddRigidbody[β](#addrigidbody "Direct link to AddRigidbody")
[SRigidbody](/scripting/client-scripting-api-reference/components/srigidbody.md) **AddRigidbody** ()
*Adds a Rigidbody component to the object.*
* Lua
```lua
newRigibodyComponent = Space.Host.ExecutingObject.AddRigidbody()
```
##### AddNavMeshAgent[β](#addnavmeshagent "Direct link to AddNavMeshAgent")
[SNavMeshAgent](/scripting/client-scripting-api-reference/components/snavmeshagent.md) **AddNavMeshAgent** ()
*Adds a NavMeshAgent component to the object.*
* Lua
```lua
newNavMeshAgentComponent = Space.Host.ExecutingObject.AddNavMeshAgent()
```
##### AddSeat[β](#addseat "Direct link to AddSeat")
[SSeat](/scripting/client-scripting-api-reference/components/sseat.md) **AddSeat** ()
*Adds a Seat component to the object.*
* Lua
```lua
newSeatComponent = Space.Host.ExecutingObject.AddSeat()
```
##### OnAwake[β](#onawake "Direct link to OnAwake")
void **OnAwake** (Closure e)
*Binds a event to the Awake() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnAwake(F)
```
##### OnStart[β](#onstart "Direct link to OnStart")
void **OnStart** (Closure e)
*Binds a event to the Start() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnStart(F)
```
##### OnEnable[β](#onenable "Direct link to OnEnable")
void **OnEnable** (Closure e)
*Binds a event to the OnEnable() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnEnable(F)
```
##### OnDisable[β](#ondisable "Direct link to OnDisable")
void **OnDisable** (Closure e)
*Binds a event to the OnDisable() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnDisable(F)
```
##### OnFixedUpdate[β](#onfixedupdate "Direct link to OnFixedUpdate")
void **OnFixedUpdate** (Closure e)
*Binds a event to the OnFixedUpdate() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnFixedUpdate(F)
```
* Lua
```lua
--this script will make this object move forward each physics frame
thisObject = Space.Host.ExecutingObject
OnFixedUpdate = function()
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * 0.01 )
--unlike OnUpdate we did not multiply by Space.DeltaTime
--because OnFixedUpdate executes at the same rate regardless
end
thisObject.OnFixedUpdate(OnFixedUpdate)
```
##### OnLateUpdate[β](#onlateupdate "Direct link to OnLateUpdate")
void **OnLateUpdate** (Closure e)
*Binds a event to the OnLateUpdate() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnLateUpdate(F)
```
* Lua
```lua
--this script will make this object move forward each frame
--but it will be last to move among other objects (read about OnLateUpdate)
--(example: camera movement)
thisObject = Space.Host.ExecutingObject
OnLateUpdate = function()
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * 0.01 * Space.DeltaTime)
--we multipy by Space.DeltaTime so that it behaves the same for all players
--even though they have different FPS (frames per second)
end
thisObject.OnLateUpdate(OnLateUpdate)
```
##### OnTriggerStart[β](#ontriggerstart "Direct link to OnTriggerStart")
void **OnTriggerStart** (Action< SGameObject > e) void **OnTriggerStart** (Closure e)
*When a GameObject collides with another GameObject, Unity calls OnTriggerEnter.*
*OnTriggerEnter happens on the FixedUpdate function when two GameObjects collide. The Colliders involved are not always at the point of initial contact.*
*Note: Both GameObjects must contain a Collider component. One must have Collider.isTrigger enabled, and contain a Rigidbody. If both GameObjects have Collider.isTrigger enabled, no collision happens. The same applies when both GameObjects do not have a Rigidbody component.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnTriggerStart = function(SGameObject)
Space.Log("Trigger Start")
end
this.OnTriggerStart (OnTriggerStart )
```
* Lua
```lua
--the below scipt makes this object a boundary area where flying gets blocked
--while player is in it and flying is allowed once player leaves it
--(Example: No fly zone)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = true
end
end
end
OnTriggerExit = function(TriggerExiter)
if TriggerExiter.Root.Avatar ~= nil then
if TriggerExiter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = false
end
end
end
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerExit(OnTriggerExit)
```
##### OnTriggerStay[β](#ontriggerstay "Direct link to OnTriggerStay")
void **OnTriggerStay** (Action< SGameObject > e) void **OnTriggerStay** (Closure e)
*OnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every frame.*
*This message is sent to the trigger and the collider that touches the trigger. Note that trigger events are only sent if one of the colliders also has a rigidbody attached. Trigger events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnTriggerStay = function(SGameObject)
Space.Log("Trigger Stay")
end
this.OnTriggerStay(OnTriggerStay)
```
* Lua
```lua
--the below scipt makes this object a boundary area where any user entering it
--will be blocked from movement for 10 seconds, then the object will release controls and
--destry itself after that
--(Example: freezing trap)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
FrozenTime = 0.0
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockMovement = true
end
end
end
OnTriggerStay = function(TriggerStayer)
if TriggerStayer.Root.Avatar ~= nil then
if TriggerStayer.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
FrozenTime = FrozenTime + Space.DeltaTime
if FrozenTime > 20 then
Space.Scene.PlayerAvatar.BlockMovement = false
thisGameObject.Destroy()
end
end
end
end
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerStay(OnTriggerStay)
```
##### OnTriggerExit[β](#ontriggerexit "Direct link to OnTriggerExit")
void **OnTriggerExit** (Action< SGameObject > e) void **OnTriggerExit** (Closure e)
*OnTriggerExit is called when the Collider other has stopped touching the trigger.*
*This message is sent to the trigger and the Collider that touches the trigger. Notes: Trigger events are only sent if one of the Colliders also has a Rigidbody attached. Trigger events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions. OnTriggerExit occurs on the FixedUpdate after the Colliders have stopped touching. The Colliders involved are not guaranteed to be at the point of initial separation.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnTriggerExit = function(SGameObject)
Space.Log("Trigger Stay")
end
this.OnTriggerExit(OnTriggerExit)
```
* Lua
```lua
--the below scipt makes this object a boundary area where flying gets blocked
--while player is in it and flying is allowed once player leaves it
--(Example: No fly zone)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = true
end
end
end
OnTriggerExit = function(TriggerExiter)
if TriggerExiter.Root.Avatar ~= nil then
if TriggerExiter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = false
end
end
end
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerExit(OnTriggerExit)
```
##### OnCollisionEnter[β](#oncollisionenter "Direct link to OnCollisionEnter")
void **OnCollisionEnter** (Action< SPhysicsHit > e) void **OnCollisionEnter** (Closure e)
*OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.*
*In contrast to* [*OnTrigger*](/scripting/client-scripting-api-reference/types/sgameobject.md#ontriggerstart)[*Start*](/scripting/client-scripting-api-reference/types/sgameobject.md#ontriggerstart)*, OnCollisionEnter is passed the* [*SPhysicsHit*](/scripting/client-scripting-api-reference/types/sphysicshit.md) *class and not a Collider (GameObject). The SPhysicsHit class contains information, for example, about contact points and impact velocity. Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnCollisionEnter = function(SPhysicsHit)
Space.Log("Collision Enter")
end
this.OnCollisionEnter(OnCollisionEnter)
```
* Lua
```lua
--this script will make this object delete itself if it collides with something
--(Example: grenade)
--[Make sure you add a rigibody to this object (read above about "collisions")
thisGameObject = Space.Host.ExecutingObject
OnCollisionEnter = function(SPhysicsHit)
thisGameObject.Destroy()
end
thisGameObject.OnCollisionEnter(OnCollisionEnter)
```
##### OnCollisionStay[β](#oncollisionstay "Direct link to OnCollisionStay")
void **OnCollisionStay** (Action< [SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md) > e) void **OnCollisionStay** (Closure e)
*OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.*
*In contrast to* [*OnTriggerStay*](/scripting/client-scripting-api-reference/types/sgameobject.md#ontriggerstay)*, OnCollisionStay is passed the* [*SPhysicsHit*](/scripting/client-scripting-api-reference/types/sphysicshit.md) *class and not a Collider (GameObject). The* [*SPhysicsHit*](/scripting/client-scripting-api-reference/types/sphysicshit.md) *class contains information about contact points, impact velocity etc. If you don't use collisionInfo in the function, leave out the collisionInfo parameter as this avoids unneccessary calculations. Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions. Collision stay events are not sent for sleeping Rigidbodies.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnCollisionStay = function(SPhysicsHit)
Space.Log("Collision Stay")
end
this.OnCollisionStay(OnCollisionStay)
```
* Lua
```lua
--this script will make this object delete itself if
--it is being touched for around 10 seconds
--(Example: a flag being captured)
--[Make sure this object has collider/rigidbody (read above about "collisions" for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
touchedTime = 0.0
OnCollisionStay = function(SPhysicsHit)
touchedTime = touchedTime + Space.DeltaTime
if touchedTime > 25 then
thisGameObject.Destroy()
end
end
thisGameObject.OnCollisionStay(OnCollisionStay)
```
##### OnCollisionExit[β](#oncollisionexit "Direct link to OnCollisionExit")
void **OnCollisionExit** (Action< [SPhysicsHit](/scripting/client-scripting-api-reference/types/sphysicshit.md) > e) void **OnCollisionExit** (Closure e)
*OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.*
*In contrast to OnTriggerExit, OnCollisionExit is passed the SPhysicsHit class and not a Collider. The SPhysicsHit class contains information about contact points, impact velocity etc. If you don't use collisionInfo in the function, leave out the collisionInfo parameter as this avoids unneccessary calculations. Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnCollisionExit = function(SPhysicsHit)
Space.Log("Collision Exit")
end
this.OnCollisionExit(OnCollisionExit)
```
* Lua
```lua
--this script will make this object destroy itself when an object
--that collided with it exits the collission
--(Example: landmine)
--[Make sure you add a rigibody to this object (read above about "collisions")
thisGameObject = Space.Host.ExecutingObject
OnCollisionExit = function(SPhysicsHit)
thisGameObject.Destroy()
end
thisGameObject.OnCollisionExit(OnCollisionExit)
```
##### OnParticleCollision[β](#onparticlecollision "Direct link to OnParticleCollision")
void **OnParticleCollision** (Action< SGameObject > e) void **OnParticleCollision** (Closure e)
*OnParticleCollision is called when a particle hits a Collider.*
*This can be used to apply damage to a GameObject when hit by particles.*
*This message is sent to scripts attached to Particle Systems and to the Collider that was hit.*
*When OnParticleCollision is invoked from a script attached to a GameObject with a Collider, the GameObject parameter represents the ParticleSystem. The Collider receives at most one message per Particle System that collided with it in any given frame even when the Particle System struck the Collider with multiple particles in the current frame.*
*When OnParticleCollision is invoked from a script attached to a ParticleSystem, the GameObject parameter represents a GameObject with an attached Collider struck by the ParticleSystem. The ParticleSystem receives at most one message per Collider that is struck.*
*Messages are only sent if you enable Send Collision Messages in the Inspector of the Particle System Collision module.*
*The OnParticleCollision can be a co-routine. Simply use the yield statement in the function.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleCollision = function(GameObject)
Space.Log("Particle Collision")
end
this.OnParticleCollision(OnParticleCollision)
```
##### OnParticleTrigger[β](#onparticletrigger "Direct link to OnParticleTrigger")
void **OnParticleTrigger** (Closure e)
*Binds a new event handler for the OnParticleTrigger event.*
*OnParticleTrigger event is called when any particles in a Particle System meet the conditions in the trigger module.*
*This can be used to kill or modify particles that are inside or outside a collision volume.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
Space.Log("Particle Trigger Event")
end
this.OnParticleTrigger(OnParticleTrigger)
```
##### OnUpdate[β](#onupdate "Direct link to OnUpdate")
void **OnUpdate** (Closure e)
*Binds a event to the OnUpdate() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnUpdate(F)
```
* Lua
```lua
--this script will make this object move forward each frame
thisObject = Space.Host.ExecutingObject
OnUpdate = function()
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * 0.01 * Space.DeltaTime)
--we multipy by Space.DeltaTime so that it behaves the same for all players
--even though they have different FPS (frames per second)
end
thisObject.OnUpdate(OnUpdate)
```
##### OnMouseDown[β](#onmousedown "Direct link to OnMouseDown")
void **OnMouseDown** (Closure e)
*Binds a event to the OnMouseDown() event.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnMouseDown(F)
```
##### OnApplicationQuit[β](#onapplicationquit "Direct link to OnApplicationQuit")
void **OnApplicationQuit** (Closure e)
*Binds a new event handler for the On Application Quit event*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
this = Space.Host.ExecutingObject
OnApplicationQuit = function()
Space.Log("Application Quit")
end
this.OnApplicationQuit(OnApplicationQuit)
```
##### CompareTag[β](#comparetag "Direct link to CompareTag")
bool **CompareTag** (string tag)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isSame = Space.Host.ExecutingObject.CompareTag('tagname')
```
##### SetParent[β](#setparent "Direct link to SetParent")
void **SetParent** (SGameObject other, bool worldPositionStays=true)
*Make this GameObject the child of GameObject 'other'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.SetParent(otherObjectReference,true)
```
* Lua
```lua
--this script will set your avatar's "right hand" as parent of this object
--this way this object will be a child of your right hand and therefore move with it
--(Example: clicking on a gun to equip it)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
RightHand = Space.Scene.PlayerAvatar.FindBone("RightHand")
thisGameObject.SetParent(RightHand)
thisGameObject.LocalPosition = Vector.New(0,0,0) -- resetting position to match hand
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to Equip "
thisGameObject.Clickable.OnClick(OnClick)
```
##### Find[β](#find "Direct link to Find")
SGameObject **Find** (string name)
*Find and return a reference to GameObject with name 'name'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
FoundObject = Space.Host.ExecutingObject.Find("GameObject Name")
```
##### FindInChildren[β](#findinchildren "Direct link to FindInChildren")
SGameObject **FindInChildren** (string name)
*Find and return a reference to GameObject with name 'name' including children*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
FoundObjectInChildren = Space.Host.ExecutingObject.FindInChildren("GameObject Name")
```
##### Destroy[β](#destroy "Direct link to Destroy")
void **Destroy** ()
*Schedules this object for deletion at the end of the frame*
* Lua
```lua
Space.Host.ExecutingObject.Destroy()
```
##### GetComponent[β](#getcomponent "Direct link to GetComponent")
SComponent **GetComponent** (string name)
danger
Depreciated
#### Properties[β](#properties "Direct link to Properties")
##### Owner[β](#owner "Direct link to Owner")
long **Owner** `get`
*Returns the GameObject's Owner*
* Lua
```lua
Owner = Space.Host.ExecutingObject.Owner
```
##### LocalID[β](#localid "Direct link to LocalID")
int **LocalID** `get`
*Returns the GameObject's Local ID*
* Lua
```lua
LocalID = Space.Host.ExecutingObject.LocalID
```
##### InventoryID[β](#inventoryid "Direct link to InventoryID")
int **InventoryID** `get`
*Return's the GameObject's InventoryID*
* Lua
```lua
InventoryID = Space.Host.ExecutingObject.InventoryID
```
##### HasStableID[β](#hasstableid "Direct link to HasStableID")
bool **HasStableID** `get`
*Returns true if GameObject has Stable ID*
* Lua
```lua
HasStableID = Space.Host.ExecutingObject.HasStableID
```
##### GlobalID[β](#globalid "Direct link to GlobalID")
string? **GlobalID** `get`
*Returns the global ID of the GameObject*
* Lua
```lua
GlobalID = Space.Host.ExecutingObject.GlobalID
```
##### Exists[β](#exists "Direct link to Exists")
bool **Exists** `get`
*Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)*
* Lua
```lua
doesExist = Space.Host.ExecutingObject.Exists
```
##### HingeJoint[β](#hingejoint "Direct link to HingeJoint")
[SHingeJoint](/scripting/client-scripting-api-reference/components/shingejoint.md) **HingeJoint** `get`
*Returns a HingeJoint component attached to this object, or nil if none exist*
* Lua
```lua
HingeJoint = Space.Host.ExecutingObject.HingeJoint
```
##### Light[β](#light "Direct link to Light")
[SLight](/scripting/client-scripting-api-reference/components/slight.md) **Light** `get`
*Returns a reference to a Light component on the object. Will return null if it does not exist.*
* Lua
```lua
newLightComponent = Space.Host.ExecutingObject.Light
```
##### ReflectionProbe[β](#reflectionprobe "Direct link to ReflectionProbe")
[SReflectionProbe](/scripting/client-scripting-api-reference/components/sreflectionprobe.md) **ReflectionProbe** `get`
*Returns a ReflectionProbe component attached to this object, or nil if none exist*
* Lua
```lua
ReflectionProbe = Space.Host.ExecutingObject.ReflectionProbe
```
##### LightInChild[β](#lightinchild "Direct link to LightInChild")
[SLight](/scripting/client-scripting-api-reference/components/slight.md) **LightInChild**`get`
*Returns a Light component attached to this object or its children, or nil if none exist*
* Lua
```lua
LightInChild = Space.Host.ExecutingObject.LightInChild
```
##### LightInParent[β](#lightinparent "Direct link to LightInParent")
[SLight](/scripting/client-scripting-api-reference/components/slight.md) **LightInParent** `get`
*Returns a Light component attached to this object or it's parent, or nil if none exist*
* Lua
```lua
LightInParent = Space.Host.ExecutingObject.LightInParent
```
##### Animator[β](#animator "Direct link to Animator")
[SAnimator](/scripting/client-scripting-api-reference/components/sanimator.md) **Animator** `get`
*Returns a reference to a Animator component on the object. Will return null if it does not exist.*
* Lua
```lua
animatorComponent = Space.Host.ExecutingObject.Animator
```
##### Animation[β](#animation "Direct link to Animation")
[SAnimation](/scripting/client-scripting-api-reference/components/sanimation.md) **Animation** `get`
*Returns an Animation component attached to this object, or nil if none exist Animation is a legacy component and should not be confused with Animator*
* Lua
```lua
Animation = Space.Host.ExecutingObject.Animation
```
##### CanvasGroup[β](#canvasgroup "Direct link to CanvasGroup")
[SCanvasGroup](/scripting/client-scripting-api-reference/components/scanvasgroup.md) **CanvasGroup** `get`
*Returns Canvas Group component attached to this object, or nil if none exist*
* Lua
```lua
CanvasGroup = Space.Host.ExecutingObject.CanvasGroup
```
##### Audio[β](#audio "Direct link to Audio")
[SAudioSource](/scripting/client-scripting-api-reference/components/saudiosource.md) **Audio** `get`
*Returns a reference to a AudioSource component on the object. Will return null if it does not exist.*
* Lua
```lua
newAudioComponent = Space.Host.ExecutingObject.Audio
```
##### Floor[β](#floor "Direct link to Floor")
[SRoomFloor](/scripting/client-scripting-api-reference/components/sroomfloor.md) **Floor** `get`
*Returns a RoomFloor component attached to this object, or nil if none exist*
* Lua
```lua
Floor = Space.Host.ExecutingObject.Floor
```
##### VoiceZone[β](#voicezone "Direct link to VoiceZone")
[SVoiceZone](/scripting/client-scripting-api-reference/components/svoicezone.md) **VoiceZone** `get`
*Returns a VoiceZone component attached to this object, or nil if none exist*
* Lua
```lua
VoiceZone = Space.Host.ExecutingObject.VoiceZone
```
##### Browser[β](#browser "Direct link to Browser")
[SBrowserSurface](/scripting/client-scripting-api-reference/components/sbrowsersurface.md) **Browser** `get`
*Returns a reference to a BrowserSurface component on the object. Will return null if it does not exist.*
* Lua
```lua
newBrowserComponent = Space.Host.ExecutingObject.Browser
```
##### Director[β](#director "Direct link to Director")
[SPlayableDirector](/scripting/client-scripting-api-reference/components/splayabledirector.md) **Director** `get`
*Returns a PlayableDirector component attached to this object, or nil if none exist*
* Lua
```lua
Director = Space.Host.ExecutingObject.Director
```
##### Renderer[β](#renderer "Direct link to Renderer")
[SRenderer](/scripting/client-scripting-api-reference/components/srenderer.md) **Renderer** `get`
*Returns a reference to a Renderer component on the object. Will return null if it does not exist.*
* Lua
```lua
renderer = Space.Host.ExecutingObject.Renderer
```
##### Vehicle[β](#vehicle "Direct link to Vehicle")
[SModularVehicle](/scripting/client-scripting-api-reference/components/smodularvehicle.md) **Vehicle** `get`
*Returns a Modular Vehicle component attached to this object, or nil if none exist*
* Lua
```lua
Vehicle = Space.Host.ExecutingObject.Vehicle
```
##### PostProcessVolume[β](#postprocessvolume "Direct link to PostProcessVolume")
[SPostProcessVolume](/scripting/client-scripting-api-reference/components/spostprocessvolume.md) **PostProcessVolume** `get`
*Returns a Post Process Volume component attached to this object, or nil if none exist*
* Lua
```lua
PostProcessVolume = Space.Host.ExecutingObject.PostProcessVolume
```
##### Archimatix[β](#archimatix "Direct link to Archimatix")
SAXModel **Archimatix** `get`
*Returns a Archimatix Model ("AXModel" component) - or Nil if nothing exists*
* Lua
```lua
Archimatix = Space.Host.ExecutingObject.Archimatix
```
##### Clickable[β](#clickable "Direct link to Clickable")
[SClickable](/scripting/client-scripting-api-reference/components/sclickable.md) **Clickable** `get`
*Returns a reference to a Clickable component on the object. Will return null if it does not exist.*
* Lua
```lua
clickableComponent = Space.Host.ExecutingObject.Clickable
```
##### EmbeddedVideo[β](#embeddedvideo "Direct link to EmbeddedVideo")
[SEmbeddedVideo](/scripting/client-scripting-api-reference/components/sembeddedvideo.md) **EmbeddedVideo** `get`
*Returns an Embedded Video component attached to this object, or nil if none exist (may not work within editor)*
* Lua
```lua
EmbeddedVideo = Space.Host.ExecutingObject.EmbeddedVideo
```
##### Avatar[β](#avatar "Direct link to Avatar")
[SAvatar](/scripting/client-scripting-api-reference/types/savatar.md) **Avatar** `get`
*A reference to an Avatar component on the GameObject.*
* Lua
```lua
Avatar = Space.Host.ExecutingObject.Avatar
```
##### AvatarAppearance[β](#avatarappearance "Direct link to AvatarAppearance")
[SAvatarAppearance](/scripting/client-scripting-api-reference/types/savatarappearance.md) **AvatarAppearance** `get`
*Returns a AvatarAppearance component attached to this object, or nil if none exist*
* Lua
```lua
AvatarAppearance = Space.Host.ExecutingObject.AvatarAppearance
```
##### Script[β](#script "Direct link to Script")
[SScriptingRuntime](/scripting/client-scripting-api-reference/components/sscriptingruntime.md) **Script** `get`
*Returns a Scripting Runtime component attached to this object, or nil if none exist*
* Lua
```lua
Script = Space.Host.ExecutingObject.Script
```
##### StateMachine[β](#statemachine "Direct link to StateMachine")
[SStateMachine](/scripting/client-scripting-api-reference/components/sstatemachine.md) **StateMachine** `get`
*Returns a State Machine component attached to this object, or nil if none exist*
* Lua
```lua
StateMachine = Space.Host.ExecutingObject.StateMachine
```
##### Networking[β](#networking "Direct link to Networking")
[SNetworking](/scripting/client-scripting-api-reference/components/snetworking.md) **Networking** `get`
*Returns a Simple Networking component attached to this object, or nil if none exists*
* Lua
```lua
SimpleNetworking = Space.Host.ExecutingObject.Networking
```
##### Events[β](#events "Direct link to Events")
[SScriptingEvents](/scripting/client-scripting-api-reference/components/sscriptingevents.md) **Events** `get`
*Property Description*
* Lua
```lua
eventsComponent = Space.Host.ExecutingObject.Events
```
##### Resources[β](#resources "Direct link to Resources")
[SScriptingResources](/scripting/client-scripting-api-reference/components/sscriptingresources.md) **Resources** `get`
*Property Description*
* Lua
```lua
resourcesComponent = Space.Host.ExecutingObject.Resources
```
##### Data[β](#data "Direct link to Data")
[SScriptingData](/scripting/client-scripting-api-reference/components/sscriptingdata.md) **Data** `get`
*Returns a Scripting Data component attached to this object, or nil if none exist*
* Lua
```lua
Data = Space.Host.ExecutingObject.Data
```
##### Rigidbody[β](#rigidbody "Direct link to Rigidbody")
[SRigidbody](/scripting/client-scripting-api-reference/components/srigidbody.md) **Rigidbody** `get`
*Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.*
* Lua
```lua
rigidbodyComponent = Space.Host.ExecutingObject.Rigidbody
```
##### Collider[β](#collider "Direct link to Collider")
[SCollider](/scripting/client-scripting-api-reference/components/scollider.md) **Collider** `get`
*Returns a reference to a Collider component on the object. Will return null if it does not exist.*
* Lua
```lua
colliderComponent = Space.Host.ExecutingObject.Collider
```
##### BoxCollider[β](#boxcollider "Direct link to BoxCollider")
[SBoxCollider](/scripting/client-scripting-api-reference/components/sboxcollider.md) **BoxCollider** `get`
*Returns a Box Collider component attached to this object, or nil if none exist*
* Lua
```lua
BoxCollider = Space.Host.ExecutingObject.BoxCollider
```
##### SphereCollider[β](#spherecollider "Direct link to SphereCollider")
[SSphereCollider](/scripting/client-scripting-api-reference/components/sspherecollider.md) **SphereCollider** `get`
*Returns a Sphere Collider component attached to this object, or nil if none exist*
* Lua
```lua
SphereCollider = Space.Host.ExecutingObject.SphereCollider
```
##### CapsuleCollider[β](#capsulecollider "Direct link to CapsuleCollider")
[SCapsuleCollider](/scripting/client-scripting-api-reference/components/scapsulecollider.md) **CapsuleCollider** `get`
*Returns a Capsule Collider component attached to this object, or nil if none exist*
* Lua
```lua
CapsuleCollider = Space.Host.ExecutingObject.CapsuleCollider
```
##### WheelCollider[β](#wheelcollider "Direct link to WheelCollider")
[SWheelCollider](#) **WheelCollider** `get`
*Returns a WheelCollider component attached to this object, or nil if none exist*
* Lua
```lua
WheelCollider = Space.Host.ExecutingObject.WheelCollider
```
##### CharacterController[β](#charactercontroller "Direct link to CharacterController")
[SCharacterController](/scripting/client-scripting-api-reference/components/scharactercontroller.md) **CharacterController** `get`
*Returns a Character Controller component attached to this object, or nil if none exist*
* Lua
```lua
CharacterController = Space.Host.ExecutingObject.CharacterController
```
##### AudioReactive[β](#audioreactive "Direct link to AudioReactive")
[SAudioReactiveBase](/scripting/client-scripting-api-reference/components/saudioreactivebase.md) **AudioReactive** `get`
*Returns the first Audio Reactive component attached to this object, or nil if none exist*
* Lua
```lua
AudioReactive = Space.Host.ExecutingObject.AudioReactive
```
##### AttachmentHelper[β](#attachmenthelper "Direct link to AttachmentHelper")
SAttachmentHelper **AttachmentHelper** `get`
*Returns the first Attachment Helper component attached to this object, or nil if none exist*
* Lua
```lua
AttachmentHelper = Space.Host.ExecutingObject.AttachmentHelper
```
##### AudioReactiveAnimation[β](#audioreactiveanimation "Direct link to AudioReactiveAnimation")
[SAudioReactiveAnimation](/scripting/client-scripting-api-reference/components/saudioreactiveanimation.md) **AudioReactiveAnimation** `get`
*Returns the first Audio Reactive Animation component attached to this object, or nil if none exist*
* Lua
```lua
AudioReactiveAnimation = Space.Host.ExecutingObject.AudioReactiveAnimation
```
##### AudioReactiveLight[β](#audioreactivelight "Direct link to AudioReactiveLight")
[SAudioReactiveLight](/scripting/client-scripting-api-reference/components/saudioreactivelight.md) **AudioReactiveLight** `get`
*Returns the first Audio Reactive Light component attached to this object, or nil if none exist*
* Lua
```lua
AudioReactiveLight = Space.Host.ExecutingObject.AudioReactiveLight
```
##### AudioReactiveParticleSystem[β](#audioreactiveparticlesystem "Direct link to AudioReactiveParticleSystem")
[SAudioReactiveParticleSystem](/scripting/client-scripting-api-reference/components/saudioreactiveparticlesystem.md) **AudioReactiveParticleSystem** `get`
*Returns the first Audio Reactive Particle System component attached to this object, or nil if none exist*
* Lua
```lua
AudioReactiveParticleSystem = Space.Host.ExecutingObject.AudioReactiveParticleSystem
```
##### AudioReactiveMaterial[β](#audioreactivematerial "Direct link to AudioReactiveMaterial")
[SAudioReactiveMaterial](/scripting/client-scripting-api-reference/components/saudioreactivelight.md) **AudioReactiveMaterial** `get`
*Returns the first Audio Reactive Material component attached to this object, or nil if none exist*
* Lua
```lua
AudioReactiveMaterial = Space.Host.ExecutingObject.AudioReactiveMaterial
```
##### AudioReactiveTransform[β](#audioreactivetransform "Direct link to AudioReactiveTransform")
[SAudioReactiveTransform](/scripting/client-scripting-api-reference/components/saudioreactivetransform.md) **AudioReactiveTransform** `get`
*Returns the first Audio Reactive Transform component attached to this object, or nil if none exist*
* Lua
```lua
AudioReactiveTransform = Space.Host.ExecutingObject.AudioReactiveTransform
```
##### TrailRenderer[β](#trailrenderer "Direct link to TrailRenderer")
[STrailRenderer](/scripting/client-scripting-api-reference/components/strailrenderer.md) **TrailRenderer** `get`
*Returns a Trail Renderer component attached to this object, or nil if none exist*
* Lua
```lua
TrailRenderer = Space.Host.ExecutingObject.TrailRenderer
```
##### LineRenderer[β](#linerenderer "Direct link to LineRenderer")
[SLineRenderer](/scripting/client-scripting-api-reference/components/slinerenderer.md) **LineRenderer** `get`
*Returns a Line Renderer component attached to this object, or nil if none exist*
* Lua
```lua
LineRenderer = Space.Host.ExecutingObject.LineRenderer
```
##### UILayout[β](#uilayout "Direct link to UILayout")
[SUILayout](/scripting/client-scripting-api-reference/components/suilayout.md) **UILayout** `get`
*Returns a Renderer component attached to this object, or nil if none exist*
* Lua
```lua
UILayout = Space.Host.ExecutingObject.UILayout
```
##### UIToggle[β](#uitoggle "Direct link to UIToggle")
[SUIToggle](/scripting/client-scripting-api-reference/components/suitoggle.md) **UIToggle** `get`
*Returns a Unity uGUI Toggle component attached to this object, or nil if none exist*
* Lua
```lua
UIToggle = Space.Host.ExecutingObject.UIToggle
```
##### UIDropdown[β](#uidropdown "Direct link to UIDropdown")
[SUIDropdown](/scripting/client-scripting-api-reference/components/suidropdown.md) **UIDropdown** `get`
*Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist*
* Lua
```lua
UIDropdown = Space.Host.ExecutingObject.UIDropdown
```
##### UIButton[β](#uibutton "Direct link to UIButton")
[SUIButton](/scripting/client-scripting-api-reference/components/suibutton.md) **UIButton** `get`
*Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist*
* Lua
```lua
UIButton = Space.Host.ExecutingObject.UIButton
```
##### UIText[β](#uitext "Direct link to UIText")
[SUIText](/scripting/client-scripting-api-reference/components/suitext.md) **UIText** `get`
*Returns a reference to a UI.Text component on the object. Will return null if it does not exist.*
* Lua
```lua
uitext = Space.Host.ExecutingObject.UIText
```
##### UISlider[β](#uislider "Direct link to UISlider")
[SUISlider](/scripting/client-scripting-api-reference/components/suislider.md) **UISlider** `get`
*Returns a Unity uGUI Slider component attached to this object, or nil if none exist*
* Lua
```lua
UISlider = Space.Host.ExecutingObject.UISlider
```
##### UIScrollbar[β](#uiscrollbar "Direct link to UIScrollbar")
[SUIScrollbar](/scripting/client-scripting-api-reference/components/suiscrollbar.md) **UIScrollbar** `get`
*Returns a Unity uGUI Scrollbar component attached to this object, or nil if none exist*
* Lua
```lua
UIScrollbar = Space.Host.ExecutingObject.UIScrollbar
```
##### UICanvas[β](#uicanvas "Direct link to UICanvas")
[SUICanvas](/scripting/client-scripting-api-reference/components/suicanvas.md) **UICanvas** `get`
*Returns a Unity uGUI Canvas component attached to this object, or nil if none exist*
* Lua
```lua
UICanvas = Space.Host.ExecutingObject.UICanvas
```
##### UIImage[β](#uiimage "Direct link to UIImage")
[SUIImage](/scripting/client-scripting-api-reference/components/suiimage.md) **UIImage** `get`
*Returns a Unity uGUI Image component attached to this object, or nil if none exist*
* Lua
```lua
UIImage = Space.Host.ExecutingObject.UIImage
```
##### UIRawImage[β](#uirawimage "Direct link to UIRawImage")
[SUIRawImage](/scripting/client-scripting-api-reference/components/suirawimage.md) **UIRawImage** `get`
*Returns a Unity uGUI Text component attached to this object, or nil if none exist*
* Lua
```lua
UIRawImage = Space.Host.ExecutingObject.UIRawImage
```
##### UIInputField[β](#uiinputfield "Direct link to UIInputField")
[SUIInputField](/scripting/client-scripting-api-reference/components/suiinputfield.md) **UIInputField** `get`
*Returns a Unity uGUI Text component attached to this object, or nil if none exist*
* Lua
```lua
UIInputField = Space.Host.ExecutingObject.UIInputField
```
##### UIToolTipHint[β](#uitooltiphint "Direct link to UIToolTipHint")
[SUIToolTipHint](/scripting/client-scripting-api-reference/components/suitooltiphint.md) **UIToolTipHint** `get`
*Property Description*
* Lua
```lua
tooltipHint = Space.Host.ExecutingObject.UIToolTipHint
```
##### Camera[β](#camera "Direct link to Camera")
[SCamera](/scripting/client-scripting-api-reference/components/scamera.md) **Camera** `get`
*Property Description*
* Lua
```lua
camera = Space.Host.ExecutingObject.Camera
```
##### VirtualCamera[β](#virtualcamera "Direct link to VirtualCamera")
[SVirtualCamera](/scripting/client-scripting-api-reference/components/svirtualcamera.md) **VirtualCamera** `get`
*Returns a VirtualCamera component attached to this object, or nil if none exists*
* Lua
```lua
VirtualCamera = Space.Host.ExecutingObject.VirtualCamera
```
##### Cloth[β](#cloth "Direct link to Cloth")
[SCloth](/scripting/client-scripting-api-reference/components/scloth.md) **Cloth** `get`
*Returns a Cloth component attached to this object, or nil if none exists*
* Lua
```lua
Cloth = Space.Host.ExecutingObject.Cloth
```
##### MeshRenderer[β](#meshrenderer "Direct link to MeshRenderer")
[SMeshRenderer](/scripting/client-scripting-api-reference/components/smeshrenderer.md) **MeshRenderer** `get`
*Returns a MeshRenderer component attached to this object, or nil if none exists*
* Lua
```lua
MeshRenderer = Space.Host.ExecutingObject.MeshRenderer
```
##### Furniture[β](#furniture "Direct link to Furniture")
[SFurniture](/scripting/client-scripting-api-reference/components/sfurniture.md) **Furniture** `get`
*Returns a Furniture component attached to this object, or nil if none exists*
* Lua
```lua
Furniture = Space.Host.ExecutingObject.Furniture
```
##### NavMeshAgent[β](#navmeshagent "Direct link to NavMeshAgent")
[SNavMeshAgent](/scripting/client-scripting-api-reference/components/snavmeshagent.md) **NavMeshAgent** `get`
*Adds a NavMeshAgent component to the object.*
* Lua
```lua
navMeshAgent = Space.Host.ExecutingObject.AddNavMeshAgent()
```
##### NavMeshObstacle[β](#navmeshobstacle "Direct link to NavMeshObstacle")
[SNavMeshObstacle](/scripting/client-scripting-api-reference/components/snavmeshobstacle.md) **NavMeshObstacle** `get`
*Returns a NavMeshObstacle component attached to this object, or nil if none exists*
* Lua
```lua
NavMeshObstacle = Space.Host.ExecutingObject.NavMeshObstacle
```
##### ParticleSystem[β](#particlesystem "Direct link to ParticleSystem")
[SParticleSystem](/scripting/client-scripting-api-reference/components/sparticlesystem.md) **ParticleSystem** `get`
*Returns a ParticleSystem component attached to this object, or nil if none exists*
* Lua
```lua
ParticleSystem = Space.Host.ExecutingObject.ParticleSystem
```
##### RectTransform[β](#recttransform "Direct link to RectTransform")
[SRectTransform](/scripting/client-scripting-api-reference/components/srecttransform.md) **RectTransform** `get`
*Returns a RectTransform component attached to this object, or nil if none exists*
* Lua
```lua
RectTransform = Space.Host.ExecutingObject.RectTransform
```
##### Seat[β](#seat "Direct link to Seat")
[SSeat](/scripting/client-scripting-api-reference/components/sseat.md) **Seat** `get`
*Returns a reference to a Seat component on the object. Will return null if it does not exist.*
* Lua
```lua
seatComponent = Space.Host.ExecutingObject.AddSeat()
```
##### SkinnedMeshRenderer[β](#skinnedmeshrenderer "Direct link to SkinnedMeshRenderer")
[SSkinnedMeshRenderer](/scripting/client-scripting-api-reference/components/sskinnedmeshrenderer.md) **SkinnedMeshRenderer** `get`
*Returns a SkinnedMeshRenderer component attached to this object, or nil if none exists*
* Lua
```lua
SkinnedMeshRenderer = Space.Host.ExecutingObject.SkinnedMeshRenderer
```
##### Radio[β](#radio "Direct link to Radio")
[SSceneBackgroundMusic](/scripting/client-scripting-api-reference/components/sscenebackgroundmusic.md) **Radio** `get`
*Returns a SceneBackgroundMusic component attached to this object, or nil if none exists*
* Lua
```lua
Radio = Space.Host.ExecutingObject.Radio
```
##### Terrain[β](#terrain "Direct link to Terrain")
[STerrain](/scripting/client-scripting-api-reference/components/sterrain.md) **Terrain** `get`
*Returns a Terrain component attached to this object, or nil if none exists*
* Lua
```lua
Terrain = Space.Host.ExecutingObject.Terrain
```
##### AnalyticsEvent[β](#analyticsevent "Direct link to AnalyticsEvent")
SAnalyticsEvent **AnalyticsEvent** `get`
*Property Description*
* Lua
```lua
analyticsEvent = Space.Host.ExecutingObject.AnalyticsEvent
```
##### GraphicRaycaster[β](#graphicraycaster "Direct link to GraphicRaycaster")
[SGraphicRaycaster](/scripting/client-scripting-api-reference/components/sgraphicraycaster.md) **GraphicRaycaster** `get`
*Property Description*
* Lua
```lua
graphicRaycaster = Space.Host.ExecutingObject.GraphicRaycaster
```
##### ContentSizeFitter[β](#contentsizefitter "Direct link to ContentSizeFitter")
SContentSizeFitter **ContentSizeFitter** `get`
*Property Description*
* Lua
```lua
contentSzeFitter = Space.Host.ExecutingObject.ContentSizeFitter
```
##### Active[β](#active "Direct link to Active")
bool **Active** `get` `set`
*Is this object Active in the scene*
* Lua
```lua
Space.Host.ExecutingObject.Active = false
```
* Lua
```lua
--the below script will make this object become inactive
--after being being clicked
--(Example: picking up fruits)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
thisGameObject.Active = false
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Pick me!"
thisGameObject.Clickable.OnClick(OnClick)
```
##### ActiveSelf[β](#activeself "Direct link to ActiveSelf")
bool **ActiveSelf** `get` `set`
*Returns true if GameObject is Active (even if it's parent is not active)*
* Lua
```lua
Space.Host.ExecutingObject.ActiveSelf = false
```
##### Layer[β](#layer "Direct link to Layer")
int **Layer** `get` `set`
*Gets/Sets the object onto a particular layer (0-31)*
* Lua
```lua
Space.Host.ExecutingObject.Layer = 21
```
##### Tag[β](#tag "Direct link to Tag")
string **Tag** `get`
*Gets this objects Tag*
* Lua
```lua
objectTag = Space.Host.ExecutingObject.Tag
```
##### Name[β](#name "Direct link to Name")
string **Name** `get` `set`
*Gets/sets the name of this object*
* Lua
```lua
Space.Host.ExecutingObject.Name = 'Hello World!'
```
##### Moniker[β](#moniker "Direct link to Moniker")
string? **Moniker** `get` `set`
*Property Description*
* Lua
```lua
Space.Host.ExecutingObject.Moniker = 'New Moniker'
```
##### Parent[β](#parent "Direct link to Parent")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Parent** `get` `set`
*Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.*
* Lua
```lua
Space.Host.ExecutingObject.Parent = Space.Host.GetReference("TheOtherObject")
```
##### Root[β](#root "Direct link to Root")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **Root** `get`
*Gets the root of this object group - may be this object.*
* Lua
```lua
objectRoot = Space.Host.ExecutingObject.Root
```
##### Children[β](#children "Direct link to Children")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md)\[] **Children** `get`
*Returns the list of direct children of this object.*
* Lua
```lua
tableChildren = Space.Host.ExecutingObject.Children
```
##### WorldPosition[β](#worldposition "Direct link to WorldPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **WorldPosition** `get` `set`
*Gets or sets the current position of this object relative to the scene*
* Lua
```lua
Space.Host.ExecutingObject.WorldPosition = Vector.New(1,1,1)
```
##### LocalPosition[β](#localposition "Direct link to LocalPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **LocalPosition** `get` `set`
*Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation*
* Lua
```lua
Space.Host.ExecutingObject.LocalPosition = Vector.New(1,1,1)
```
##### WorldRotation[β](#worldrotation "Direct link to WorldRotation")
[SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) **WorldRotation** `get` `set`
*Gets or sets the current rotation of this object relative to the scene*
* Lua
```lua
Space.Host.ExecutingObject.WorldRotation = Quaternion.Euler(0,180,0)
```
##### LocalRotation[β](#localrotation "Direct link to LocalRotation")
[SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) **LocalRotation** `get` `set`
*Gets or sets the current rotation of this object relative to the parent object*
* Lua
```lua
Space.Host.ExecutingObject.LocalRotation = Quaternion.Euler(0,180,0)
```
##### LocalScale[β](#localscale "Direct link to LocalScale")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **LocalScale** `get` `set`
*Gets or sets the current scale of this object relative to the parent*
* Lua
```lua
Space.Host.ExecutingObject.LocalScale = Vector.New(2,2,2)
```
##### WorldScale[β](#worldscale "Direct link to WorldScale")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **WorldScale** `get`
*Gets the current scale of this object relative to the scene*
* Lua
```lua
worldScale = Space.Host.ExecutingObject.WorldScale
```
##### Forward[β](#forward "Direct link to Forward")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Forward** `get`
*Returns the forward direction vector of this game object (blue arrow)*
* Lua
```lua
vectorForward = Space.Host.ExecutingObject.Forward
```
##### Up[β](#up "Direct link to Up")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Up** `get`
*Returns the up direction vector of this game object (green arrow)*
* Lua
```lua
vectorUp = Space.Host.ExecutingObject.Up
```
##### Right[β](#right "Direct link to Right")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Right** `get`
*Returns the right direction vector of this game object (red arrow)*
* Lua
```lua
vectorRight = Space.Host.ExecutingObject.Right
```
##### **EventCalendar**[β](#eventcalendar "Direct link to eventcalendar")
[SEventCalendar](/scripting/client-scripting-api-reference/components/seventcalendar.md) **EventCalendar** `get`
*Returns an EventCalendar component attached to this object, or nil if none exists*
* Lua
```lua
EventCalendar = Space.Host.ExecutingObject.EventCalendar
```
---
### SGenre
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------- |
| override string [**ToString** ](/scripting/client-scripting-api-reference/types/sgenre.md#tostring)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------------- |
| string [**Name** ](/scripting/client-scripting-api-reference/types/sgenre.md#name)`get` `set` |
| string [**ID** ](/scripting/client-scripting-api-reference/types/sgenre.md#id)`get` `set` |
| string [**HasChildren** ](/scripting/client-scripting-api-reference/types/sgenre.md#haschildren)`get` `set` |
| string [**ParentID** ](/scripting/client-scripting-api-reference/types/sgenre.md#parentid)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### ToString[β](#tostring "Direct link to ToString")
override string **ToString** ()
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
#### Properties[β](#properties "Direct link to Properties")
##### Name[β](#name "Direct link to Name")
string **Name** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### ID[β](#id "Direct link to ID")
string **ID** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### HasChildren[β](#haschildren "Direct link to HasChildren")
string **HasChildren** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### ParentID[β](#parentid "Direct link to ParentID")
string **ParentID** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SGroupInfo
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------- |
| int [**ID** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#id)`get` |
| int [**OwnerID** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#ownerid)`get` |
| string [**Name** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#name)`get` |
| string [**Description** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#description)`get` |
| string [**Access** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#access)`get` |
| string [**ImageUrl** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#imageurl)`get` |
| int [**MaxAvatars** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#maxavatars)`get` |
| string [**Role** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#role)`get` |
| string [**CreateDate** ](/scripting/client-scripting-api-reference/types/sgroupinfo.md#createdate)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### ID[β](#id "Direct link to ID")
int **ID** `get`
*The ID of the group.*
* Lua
```lua
ID = Space.Groups.GetGroupInfo(350).ID
```
##### OwnerID[β](#ownerid "Direct link to OwnerID")
int **OwnerID** `get`
*The ID of the group's owner.*
* Lua
```lua
OwnerID = Space.Groups.GetGroupInfo(350).OwnerID
```
* Lua
```lua
--Clicking this object will show canvas1 if you are a group's owner
--and will show canvas2 if you are not
thisObject = Space.Host.ExecutingObject
canvas1 = Space.Host.GetReference("canvas1")--Add this object with canvas as reference in Scripting Runtime
canvas2 = Space.Host.GetReference("canvas2")--Add this object with canvas as reference in Scripting Runtime
OnClickFunction = function()
local groupInfo = Space.Groups.GetGroupInfo(350)
if groupInfo.OwnerID == Space.Scene.PlayerAvatar.ID then
canvas1.Active = true
else
canvas2.Active = true
end
end
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*The name of the group.*
* Lua
```lua
Name = Space.Groups.GetGroupInfo(350).Name
```
* Lua
```lua
--Clicking this object will show group 355's Name on a UIText object
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnClickFunction = function()
GroupInfo = Space.Groups.GetGroupInfo(350)
uiText.Text = GroupInfo.Name
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Description[β](#description "Direct link to Description")
string **Description** `get`
*The description of the group.*
* Lua
```lua
Description =Space.Groups.GetGroupInfo(350).Description
```
* Lua
```lua
--Clicking this object will show group 355's Description on a UIText object
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnClickFunction = function()
GroupInfo = Space.Groups.GetGroupInfo(350)
uiText.Text = GroupInfo.Description
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Access[β](#access "Direct link to Access")
string **Access** `get`
*The level of access the group has, e.g. public or private.*
* Lua
```lua
Access = Space.Groups.GetGroupInfo(350).Access
```
* Lua
```lua
--Clicking this object will show group 355's Access on a UIText object
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnClickFunction = function()
GroupInfo = Space.Groups.GetGroupInfo(350)
uiText.Text = GroupInfo.Access
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### ImageUrl[β](#imageurl "Direct link to ImageUrl")
string **ImageUrl** `get`
*The URL of the group's image.*
* Lua
```lua
ImageUrl = Space.Groups.GetGroupInfo(350).ImageUrl
```
* Lua
```lua
--Clicking this object will show group 355's ImageUrl on a UIText object
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnClickFunction = function()
GroupInfo = Space.Groups.GetGroupInfo(350)
uiText.Text = GroupInfo.ImageUrl
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### MaxAvatars[β](#maxavatars "Direct link to MaxAvatars")
int **MaxAvatars** `get`
*The max number of members the group can have.*
* Lua
```lua
MaxAvatars = Space.Groups.GetGroupInfo(350).MaxAvatars
```
* Lua
```lua
--Clicking this object will show group 355's MaxAvatars on a UIText object
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnClickFunction = function()
GroupInfo = Space.Groups.GetGroupInfo(350)
uiText.Text = GroupInfo.MaxAvatars
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Role[β](#role "Direct link to Role")
string **Role** `get`
*Player's role in this group.*
* Lua
```lua
Role = Space.Groups.GetGroupInfo(350).Role
```
* Lua
```lua
--Clicking this object will show canvas1 if you are a VIP in the group
--and will show canvas2 if you are a regular member
--and will show canvas3 if you are the group owner
thisObject = Space.Host.ExecutingObject
canvas1 = Space.Host.GetReference("canvas1")--Add this object with canvas as reference in Scripting Runtime
canvas2 = Space.Host.GetReference("canvas2")--Add this object with canvas as reference in Scripting Runtime
canvas3 = Space.Host.GetReference("canvas3")--Add this object with canvas as reference in Scripting Runtime
OnClickFunction = function()
local groupInfo = Space.Groups.GetGroupInfo(350)
if groupInfo.Role == "Owner" then
canvas3.Active = true
elseif groupInfo.Role == "VIP" then
canvas1.Active = true
elseif groupInfo.Role == "Normal" then
canvas2.Active = true
end
end
```
##### CreateDate[β](#createdate "Direct link to CreateDate")
string **CreateDate** `get`
*Creation date of the group.*
* Lua
```lua
CreateDate = Space.Groups.GetGroupInfo(350).CreateDate
```
* Lua
```lua
--Clicking this object will show group 355's creation date on a UIText object
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnClickFunction = function()
CreateDate = Space.Groups.GetGroupInfo(350).CreateDate
uiText.Text = CreateDate
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
---
### SInventoryItem
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------- |
| bool [**StoreCustomData** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#storecustomdata)(string data) |
| void [**Use** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#use)() |
| void [**Delete** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#delete)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------- |
| long [**MasterID** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#masterid)`get` |
| long [**PlayerItemID** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#playeritemid)`get` |
| string [**Name** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#name)`get` |
| string [**Description** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#description)`get` |
| string [**Brand** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#brand)`get` |
| string [**CustomData** ](/scripting/client-scripting-api-reference/types/sinventoryitem.md#customdata)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### StoreCustomData[β](#storecustomdata "Direct link to StoreCustomData")
bool **StoreCustomData** (string data)
*Updates the inventory items custom data, and requests a synchronisation with the inventory server. It may not update on the server immediately, but all local calls will reflect the new data. Note: this request can be rate limited and should only be called from a user initiated action (such as clicking a button). Updates to custom data must not be initiated on a timer or regular automatic event. Access to this function can be blacklisted to specific creators if abused.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Items = Space.Inventory.Items
Items[1].StoreCustomData('data1data2data3')
```
##### Use[β](#use "Direct link to Use")
void **Use** ()
*Player will 'Use' this item. (White-label only)*
* Lua
```lua
Items = Space.Inventory.Items
Items[1].Use()
```
##### Delete[β](#delete "Direct link to Delete")
void **Delete** ()
*Player will 'Delete' this item. (White-label only)*
* Lua
```lua
Items = Space.Inventory.Items
Items[1].Delete()
```
#### Properties[β](#properties "Direct link to Properties")
##### MasterID[β](#masterid "Direct link to MasterID")
long **MasterID** `get`
*The master ID for this item - also known as the Curator ID or Item ID, this is the ID for the master item from which this copy exists.*
* Lua
```lua
Items = Space.Inventory.Items
iMasterID = Items[1].MasterID
```
##### PlayerItemID[β](#playeritemid "Direct link to PlayerItemID")
long **PlayerItemID** `get`
*The instance ID for this item - this is guaranteed to be unique per inventory item*
* Lua
```lua
Items = Space.Inventory.Items
iPlayerItemID= Items[1].PlayerItemID
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Returns the name of the inventory item*
* Lua
```lua
Items = Space.Inventory.Items
iName= Items[1].Name
```
##### Description[β](#description "Direct link to Description")
string **Description** `get`
*Returns the registered description of the inventory item in the users locale*
* Lua
```lua
Items = Space.Inventory.Items
iDescription=Items[1].Description
```
##### Brand[β](#brand "Direct link to Brand")
string **Brand** `get`
*Returns brand information about the item*
* Lua
```lua
Items = Space.Inventory.Items
iBrand = Items[1].Brand
```
##### CustomData[β](#customdata "Direct link to CustomData")
string **CustomData** `get`
*Returns any custom data associated with this item, typically used for 'game' items*
* Lua
```lua
Items = Space.Inventory.Items
iCustomData = Items[1].CustomData
```
---
### SJointLimits
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| override string [**ToString** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#tostring)() |
| static SJointLimits [**New** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#new)(float min, float max, float bounciness, float bounceMinVelocity, float contactDistance) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------------------- |
| float [**Min** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#min)`get` `set` |
| float [**Max** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#max)`get` `set` |
| float [**Bounciness** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#bounciness)`get` `set` |
| float [**BounceMinVelocity** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#bounceminvelocity)`get` `set` |
| float [**ContactDistance** ](/scripting/client-scripting-api-reference/types/sjointlimits.md#contactdistance)`get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### ToString[β](#tostring "Direct link to ToString")
override string **ToString** ()
*Returns this SJointLimits's properties as a string*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
LimitsString = Space.Host.ExecutingObject.HingeJoint.Limits.ToString()
```
* Lua
```lua
--the below script will make a UI Text element display this GameObjects Hinge Joint Limits' properties
--[Add "thetext" and "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
text = Space.Host.GetReference("thetext").UIText
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnUpdateFunction()
limits = hingejoint.Limits
text.Text = limits.ToString()
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### New[β](#new "Direct link to New")
static SJointLimits **New** (float min, float max, float bounciness, float bounceMinVelocity, float contactDistance)
*Creates a new SJoinLimits with the given min, max, bounciness, bounceMinVelocity and contactDistance.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Limits = Space.Host.ExecutingObject.HingeJoint.Limits.New((1,2,3,4,5))
```
* Lua
```lua
--the below script will change all Hinge Joint Limits properties to 0 when clicked
--[Add "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnClickFunction()
limits = hingejoint.Limits
hingejoint.Limits = limits.New(0,0,0,0,0)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### Min[β](#min "Direct link to Min")
float **Min** `get` `set`
*The lower angular limit (in degrees) of the joint.*
* Lua
```lua
LimitsMin = Space.Host.ExecutingObject.HingeJoint.Limits.Min
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Limits Min property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
limits = hingejoint.Limits
limits.Min = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Limits = limits
end
slider.OnValueChanged(OVC)
```
##### Max[β](#max "Direct link to Max")
float **Max** `get` `set`
*The upper angular limit (in degrees) of the joint.*
* Lua
```lua
LimitsMax= Space.Host.ExecutingObject.HingeJoint.Limits.Max
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Limits Max property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
limits = hingejoint.Limits
limits.Max = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Limits = limits
end
slider.OnValueChanged(OVC)
```
##### Bounciness[β](#bounciness "Direct link to Bounciness")
float **Bounciness** `get` `set`
*Determines the size of the bounce when the joint hits it's limit. Also known as restitution.*
* Lua
```lua
LimitsBounciness = Space.Host.ExecutingObject.HingeJoint.Limits.Bounciness
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Limits Bounciness property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
limits = hingejoint.Limits
limits.Bounciness = (slider.Value * 1.0) -- from 0.0 to 1.0
hingejoint.Limits = limits
end
slider.OnValueChanged(OVC)
```
##### BounceMinVelocity[β](#bounceminvelocity "Direct link to BounceMinVelocity")
float **BounceMinVelocity** `get` `set`
*The minimum impact velocity which will cause the joint to bounce.*
* Lua
```lua
LimitsBounceMinVelocity = Space.Host.ExecutingObject.HingeJoint.Limits.BounceMinVelocity
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Limits BounceMinVelocity property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
limits = hingejoint.Limits
limits.BounceMinVelocity = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Limits = limits
end
slider.OnValueChanged(OVC)
```
##### ContactDistance[β](#contactdistance "Direct link to ContactDistance")
float **ContactDistance** `get` `set`
*Distance inside the limit value at which the limit will be considered to be active by the solver.*
* Lua
```lua
LimitsContactDistance = Space.Host.ExecutingObject.HingeJoint.Limits.ContactDistance
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Limits Contact Distance property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
limits = hingejoint.Limits
limits.ContactDistance = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Limits = limits
end
slider.OnValueChanged(OVC)
```
---
### SJointMotor
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------- |
| override string [**ToString** ](/scripting/client-scripting-api-reference/types/sjointmotor.md#tostring)() |
| static SJointMotor [**New** ](/scripting/client-scripting-api-reference/types/sjointmotor.md#new)(float targetVelocity, float force, bool freeSpin) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------------------- |
| float [**TargetVelocity** ](/scripting/client-scripting-api-reference/types/sjointmotor.md#targetvelocity)`get` |
| float [**Force** ](/scripting/client-scripting-api-reference/types/sjointmotor.md#force)`get` |
| bool [**FreeSpin** ](/scripting/client-scripting-api-reference/types/sjointmotor.md#freespin)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### ToString[β](#tostring "Direct link to ToString")
override string **ToString** ()
*Returns this SJointMotor's properties as a string*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
MotorString = Space.Host.ExecutingObject.HingeJoint.Motor.ToString()
```
* Lua
```lua
--the below script will make a UI Text element display this GameObjects Hinge Joint Motor properties
--[Add "thetext" and "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
text = Space.Host.GetReference("thetext").UIText
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnUpdateFunction()
motor = hingejoint.Motor
text.Text = motor.ToString()
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### New[β](#new "Direct link to New")
static SJointMotor **New** (float targetVelocity, float force, bool freeSpin)
*Creates a new SJointMotor with the given targetVelocity, force, freeSpin.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Motor= Space.Host.ExecutingObject.HingeJoint.Motor.New(1,2,true)
```
* Lua
```lua
--the below script will change all Hinge Joint Motor properties to 0 when clicked
--[Add "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnClickFunction()
motor = hingejoint.Motor
hingejoint.Motor = motor.New(0,0,false)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### TargetVelocity[β](#targetvelocity "Direct link to TargetVelocity")
float **TargetVelocity**`get`
*The motor will apply a force up to force to achieve targetVelocity.*
* Lua
```lua
MotorTargetVelocity = Space.Host.ExecutingObject.HingeJoint.Motor.TargetVelocity
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Motor TargetVelocity property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
motor = hingejoint.Motor
motor.TargetVelocity = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Motor = motor
end
slider.OnValueChanged(OVC)
```
##### Force[β](#force "Direct link to Force")
float **Force**`get`
*The motor will apply a force.*
* Lua
```lua
MotorForce= Space.Host.ExecutingObject.HingeJoint.Motor.Force
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Motor Force property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
motor = hingejoint.Motor
motor.Force = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Motor = motor
end
slider.OnValueChanged(OVC)
```
##### FreeSpin[β](#freespin "Direct link to FreeSpin")
bool **FreeSpin**`get`
*If freeSpin is enabled the motor will only accelerate but never slow down.*
* Lua
```lua
MotorFreeSpin = Space.Host.ExecutingObject.HingeJoint.Motor.FreeSpin
```
* Lua
```lua
--the below script will toggle Hinge Joint Motor FreeSpin property
--[Add "thehingejoint" reference to the Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnClickFunction()
motor = hingejoint.Motor
motor.FreeSpin = not motor.FreeSpin
hingejoint.Motor = motor
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClickFunction)
```
---
### SJointSpring
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function Name |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| override string [**ToString** ](/scripting/client-scripting-api-reference/types/sjointspring.md#tostring)() |
| static SJointSpring [**New** ](/scripting/client-scripting-api-reference/types/sjointspring.md#new)(float spring, float damper, float targetPosition) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ---------------------------------------------------------------------------------------------------------------- |
| float [**Spring** ](/scripting/client-scripting-api-reference/types/sjointspring.md#spring)`get` |
| float [**Damper** ](/scripting/client-scripting-api-reference/types/sjointspring.md#damper)`get` |
| float [**TargetPosition** ](/scripting/client-scripting-api-reference/types/sjointspring.md#targetposition)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### ToString[β](#tostring "Direct link to ToString")
override string **ToString** ()
*Returns this SJointSpring's properties as a string*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
SpringString = Space.Host.ExecutingObject.HingeJoint.Spring.ToString()
```
* Lua
```lua
--the below script will make a UI Text element display this GameObjects Hinge Joint Spring properties
--[Add "thetext" and "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
text = Space.Host.GetReference("thetext").UIText
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnUpdateFunction()
spring = hingejoint.Spring
text.Text = spring.ToString()
end
thisObject.OnUpdate(OnUpdateFunction)
```
##### New[β](#new "Direct link to New")
static SJointSpring **New** (float spring, float damper, float targetPosition)
*Creates a new SJointSpring with the given spring, damper, targetPosition.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Motor= Space.Host.ExecutingObject.HingeJoint.Spring.New(1,2,3)
```
* Lua
```lua
--the below script will change all Hinge Joint Spring properties to 0 when clicked
--[Add "thehingejoint" reference to the Scripting Runtime component]
thisObject = Space.Host.ExecutingObject
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
function OnClickFunction()
spring = hingejoint.Spring
hingejoint.Spring = spring .New(0,0,0)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### Spring[β](#spring "Direct link to Spring")
float **Spring**`get`
*The spring forces used to reach the target position.*
* Lua
```lua
SpringSpring= Space.Host.ExecutingObject.HingeJoint.Spring.Spring
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Spring Spring property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
spring = hingejoint.Spring
spring.Spring = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Spring= spring
end
slider.OnValueChanged(OVC)
```
##### Damper[β](#damper "Direct link to Damper")
float **Damper**`get`
*The damper force uses to dampen the spring.*
* Lua
```lua
SpringDamper= Space.Host.ExecutingObject.HingeJoint.Spring.Damper
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Spring Damper property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
spring = hingejoint.Spring
spring.Damper = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Spring = spring
end
slider.OnValueChanged(OVC)
```
##### TargetPosition[β](#targetposition "Direct link to TargetPosition")
float **TargetPosition**`get`
*The target position the joint attempts to reach.*
* Lua
```lua
SpringTargetPosition = Space.Host.ExecutingObject.HingeJoint.Spring.TargetPosition
```
* Lua
```lua
--the below script will make a slider change a Hinge Joint Spring TargetPosition property
--[Add "theslider" and "thehingejoint" reference to the Scripting Runtime component]
slider = Space.Host.GetReference("theslider").UISlider
hingejoint = Space.Host.GetReference("thehingejoint").HingeJoint
OVC = function()
spring = hingejoint.Spring
spring.TargetPosition = (slider.Value * 10.0) -- from 0.0 to 10.0
hingejoint.Spring = spring
end
slider.OnValueChanged(OVC)
```
---
### SLandmark
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------- |
| string [**Name** ](/scripting/client-scripting-api-reference/types/slandmark.md#name)`get` |
| SVector [**Position** ](/scripting/client-scripting-api-reference/types/slandmark.md#position)`get` |
| SQuaternion [**Rotation** ](/scripting/client-scripting-api-reference/types/slandmark.md#rotation)`get` |
| bool [**SpawnPoint** ](/scripting/client-scripting-api-reference/types/slandmark.md#spawnpoint)`get` |
| float [**SpawnRadius** ](/scripting/client-scripting-api-reference/types/slandmark.md#spawnradius)`get` |
| SLandmarkType [**Type** ](/scripting/client-scripting-api-reference/types/slandmark.md#type)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Landmark's Name*
* Lua
```lua
LandmarkName = Space.Scene.Landmarks[1].Name
```
##### Position[β](#position "Direct link to Position")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Position** `get`
*Landmark's Position*
* Lua
```lua
LandmarkPosition = Space.Scene.Landmarks[1].Position
```
##### Rotation[β](#rotation "Direct link to Rotation")
[SQuaternion](/scripting/client-scripting-api-reference/types/squaternion.md) **Rotation** `get`
*Landmark's Rotation*
* Lua
```lua
LandmarkRotation = Space.Scene.Landmarks[1].Rotation
```
##### SpawnPoint[β](#spawnpoint "Direct link to SpawnPoint")
bool **SpawnPoint** `get`
*Is this Landmark a spawn point?*
* Lua
```lua
LandmarkSpawnPoint = Space.Scene.Landmarks[1].SpawnPoint
```
##### SpawnRadius[β](#spawnradius "Direct link to SpawnRadius")
float **SpawnRadius** `get`
*The size of the radius around the Landmark where players spawn within*
* Lua
```lua
LandmarkSpawnRadius = Space.Scene.Landmarks[1].SpawnRadius
```
##### Type[β](#type "Direct link to Type")
int **Type** `get`
*The type of Landmark* *1= LandingZone, 2= Area, 3= Shop, 4= Quest,5= Activity, 6= Teleport, 7= Music, 8= Dance, 9= Clothes, 10= Vehicle, 11= Item*
* Lua
```lua
LandmarkType = Space.Scene.Landmarks[1].Type
```
---
### SLayerMask
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| --------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**SetLayers** ](slayermask#setlayers)(params string\[] layerNames) void [**SetLayers** ](slayermask#setlayers)(Table layerNames) |
| void [**AddLayer** ](/scripting/client-scripting-api-reference/types/slayermask.md#addlayer)(string layerName) |
| void [**RemoveLayer** ](/scripting/client-scripting-api-reference/types/slayermask.md#removelayer)(string layerName) |
| |
| **Static Functions** |
| static SLayerMask [**New** ](slayermask#new)(Table layerNames) static SLayerMask [**New** ](slayermask#new)(params string\[] layerNames) |
| |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property | Description |
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| bool [**Inverted** ](/scripting/client-scripting-api-reference/types/slayermask.md#new-1)`get` `set` | Is the mask exclusionary or not. |
| string\[] [**Layers** ](/scripting/client-scripting-api-reference/types/slayermask.md#layers)`get` `set` | The layer names represented in this layer mask |
#### Functions[β](#functions "Direct link to Functions")
##### SetLayers[β](#setlayers "Direct link to SetLayers")
void **SetLayers** (params string\[] layerNames) void **SetLayers** (Table layerNames)
\_Function that changes an existing layer mask \_
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Let's create a new layer mask to filter out other avatars, then overwrite it to be vehicles instead:
local mask = LayerMask.New({"Avatars"});
mask.SetLayers({"Vehicles"});
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
* Lua
```lua
-- Let's create a new layer mask to filter out other avatars, then overwrite it to be vehicles instead:
local mask = LayerMask.New("Avatars");
mask.SetLayers("Vehicles");
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
##### AddLayer[β](#addlayer "Direct link to AddLayer")
void **AddLayer** (string layerName)
*Add a new layer to an existing layer mask.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local mask = LayerMask.New("Avatars");
mask.AddLayer("Vehicles");
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
* Lua
```lua
local mask = LayerMask.New("Avatars");
mask.AddLayer("Vehicles");
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
##### RemoveLayer[β](#removelayer "Direct link to RemoveLayer")
void **RemoveLayer** (string layerName)|
*Remove a new layer from an existing layer mask.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local mask = LayerMask.New("Avatars", "Vehicles", "UI");
mask.RemoveLayer("Vehicles");
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
* Lua
```lua
local mask = LayerMask.New("Avatars", "Vehicles", "UI");
mask.RemoveLayer("Vehicles");
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
##### New[β](#new "Direct link to New")
static SLayerMask **New** (Table layerNames) static SLayerMask **New** (params string\[] layerNames)
*Static function that creates a new layer mask*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local mask = LayerMask.New({"Avatars", "Vehicles"});
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
* Lua
```lua
local mask = LayerMask.New("Avatars");
or
local mask = LayerMask.New("Avatars", "Vehicles", "UI");
local hit = Space.Physics.RaycastSingle(Space.Host.ExecutingObject.WorldPosition, Space.Host.ExecutingObject.Forward, 500.0, mask)
```
#### Properties[β](#properties "Direct link to Properties")
##### Inverted[β](#inverted "Direct link to Inverted")
bool **Inverted** `get` `set`
*Is the mask exclusionary or not.*
* Lua
```lua
local mask = LayerMask.New("Avatars");
-- Now change it to be an exclusionary mask that gets everything EXCEPT Avatars.'
mask.inverted = true;
```
##### Layers[β](#layers "Direct link to Layers")
string\[] **Layers** `get` `set`
*The layer names represented in this layer mask*
* Lua
```lua
local mask = LayerMask.New("Avatars");
-- Get
local layers = mask.Layers;
-- Set
local layers = {"Vehicles", "UI"};
mask.Layers = layers;
```
---
### SMaterial
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SMaterial **Instantiate**() |
| void [**SetFloat** ](/scripting/client-scripting-api-reference/types/smaterial.md#setfloat)(string key, float value) |
| float [**GetFloat** ](/scripting/client-scripting-api-reference/types/smaterial.md#getfloat)(string key) |
| void [**SetColor** ](smaterial#setcolor)(string key, SColor color) void [**SetColor** ](smaterial#setcolor)(string key, float r, float g, float b, float a) |
| [SColor](/scripting/client-scripting-api-reference/types/scolor.md) [**GetColor** ](/scripting/client-scripting-api-reference/types/smaterial.md#getcolor)(string key) |
| void [**SetColor32** ](/scripting/client-scripting-api-reference/types/smaterial.md#setcolor32)(string key, byte r, byte g, byte b, byte a) |
| void [**SetInt** ](/scripting/client-scripting-api-reference/types/smaterial.md#setint)(string key, int value) |
| int [**GetInt** ](/scripting/client-scripting-api-reference/types/smaterial.md#getint)(string key) |
| void [**SetTexture** ](/scripting/client-scripting-api-reference/types/smaterial.md#settexture)(string key, SResource value) |
| SResource [**GetTexture** ](/scripting/client-scripting-api-reference/types/smaterial.md#gettexture)(string key) |
| void [**SetTextureOffset** ](/scripting/client-scripting-api-reference/types/smaterial.md#settextureoffset)(string key, float x, float y) |
| void [**SetTextureScale** ](/scripting/client-scripting-api-reference/types/smaterial.md#settexturescale)(string key, float x, float y) |
| void [**SetVector** ](/scripting/client-scripting-api-reference/types/smaterial.md#setvector)(string key, SVector value) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property | Description |
| ----------------------------------------------------------------------------------------------------------- | ----------- |
| string [**Name** ](/scripting/client-scripting-api-reference/types/smaterial.md#name)`get` `set` | |
| string [**Shader** ](/scripting/client-scripting-api-reference/types/smaterial.md#shader)`get` | |
| int [**RenderQueue** ](/scripting/client-scripting-api-reference/types/smaterial.md#renderqueue)`get` `set` | |
#### Functions[β](#functions "Direct link to Functions")
##### Instantiate[β](#instantiate "Direct link to Instantiate")
SMaterial **Instantiate**()
*Return a new SMaterial from old.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local cube=Space.Host.ExecutingObject
local cube2=cube.Children[1]
local mat1=cube.Renderer.Material
local newMat=mat1.Instantiate() newMat.SetColor("_Color",Color.Red) cube2.Renderer.Material=newMat
--at this moment, cube2 will turn to red but cube will keep original color.
```
##### SetFloat[β](#setfloat "Direct link to SetFloat")
void **SetFloat** (string key, float value)
*Sets a shader property to value*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Let's set the Metallic property to 0.75:
local obj = Space.Host.ExecutingObject;
obj.Renderer.Material.SetFloat("_Metallic", 0.75);
```
##### GetFloat[β](#getfloat "Direct link to GetFloat")
float **GetFloat** (string key)
*Gets the current value of a shader property.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Let's find out the current Glosiness level
local obj = Space.Host.ExecutingObject;
Space.Log(obj.Renderer.Material.GetFloat("_Glossiness"));
-- prints "0.5" (by default) to the console.
```
##### SetColor[β](#setcolor "Direct link to SetColor")
void **SetColor** (string key, SColor color) void **SetColor** (string key, float r, float g, float b, float a)
*Sets a shader colour*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Let's change the Color to red:
local obj = Space.Host.ExecutingObject;
local newColor = Color.New(1, 0, 0, 1);
obj.Renderer.Material.SetColor("_Color", newColor);
```
* Lua
```lua
-- Let's change the Color to purple:
local obj = Space.Host.ExecutingObject;
obj.Renderer.Material.SetColor("_Color", 0.5,0,0.5,1);
```
##### GetColor[β](#getcolor "Direct link to GetColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **GetColor** (string propertyName)
Get a named color value. Many shaders use more than one color. Use GetColor to get the propertyName color.
| Parameter | Type | Description |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| propertyName | string | Common color names used by Unity's builtin shaders: "\_Color" is the main color of a material."\_SpecColor" is the specular color of a material (used in specular/glossy/vertexlit shaders)."\_EmissionColor" is the emissive color of a material (used in vertexlit shaders). "\_ReflectColor" is the reflection color of the material (used in reflective shaders). |
* Lua
```lua
Space.Host.ExecutingObject.Renderer.Material.GetColor("_Color")
```
##### SetColor32[β](#setcolor32 "Direct link to SetColor32")
void **SetColor32** (string key, byte r, byte g, byte b, byte a)
*Sets a shader colour to value (32-bit, 0..255 values)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Let's change the Color to light blue:
local obj = Space.Host.ExecutingObject;
obj.Renderer.Material.SetColor32("_Color", 53,172,232,255);
```
##### SetInt[β](#setint "Direct link to SetInt")
void **SetInt** (string key, int value)
*Sets a shader property to value. This can be a convenient way to work with Boolean values.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- For example, let's disable Specular Highlights (enabled by default in the Standard shader):
local obj = Space.Host.ExecutingObject;
obj.Renderer.Material.SetInt("_SpecularHighlights", 0);
```
##### GetInt[β](#getint "Direct link to GetInt")
int **GetInt** (string key)
*Gets the current value of a shader property. This can be a convenient way to work with Boolean values.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Let's find out if the Reflections property is enabled:
local obj = Space.Host.ExecutingObject;
Space.Log(obj.Renderer.Material.GetInt("_GlossyReflections"));
-- prints "1" (by default) to the console, which means that the Reflections property is indeed enabled.
```
##### SetTexture[β](#settexture "Direct link to SetTexture")
void **SetTexture** (string key, SResource value)
*Sets a object's specified texture map (specified in parameter 1) to the texture provided as a resource in parameter #2. The example script must be in a object with a '\_MainTex' map, and that object should be set as a resource on the scripting runtime. Additionally, that object should be called 'dispobj'.*
*note also that this function can be used to set any of the texture maps by varying the value of the first parameter accordingly.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function hithere()
image = "mrlee.jpg"
server = "https://middleware.systems/"
obj = Space.Host.GetReference("dispobj")
resrc = Space.WebServices.GetImage(server .. image)
obj.Renderer.Material.SetTexture("_MainTex", resrc)
end
```
##### GetTexture[β](#gettexture "Direct link to GetTexture")
SResource **GetTexture** (string propertyName)
*Get a named texture. Many shaders use more than one texture. Use GetTexture to get the propertyName texture.*
| Parameter | Type | Description |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| propertyName | string | Common texture names used by Unity's builtin shaders:"\_MainTex" is the main diffuse texture."\_BumpMap" is the normal map. "\_Cube" is the reflection cubemap. |
* Lua
```lua
textureResource = Space.Host.ExecutingObject.Renderer.Material.GetTexture("_MainTex")
```
##### SetTextureOffset[β](#settextureoffset "Direct link to SetTextureOffset")
void **SetTextureOffset** (string key, float x, float y)
*Sets a texture offset to a value.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Renderer.Material.SetTextureOffset("_MainTex", 0, 1)
```
##### SetTextureScale[β](#settexturescale "Direct link to SetTextureScale")
void **SetTextureScale** (string key, float x, float y)
*Sets a texture scale to a value.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Renderer.Material.SetTextureScale("_MainTex", 0, 1)
```
##### SetVector[β](#setvector "Direct link to SetVector")
void **SetVector** (string key, SVector value)
*Sets a shader property to value*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Host.ExecutingObject.Renderer.Material.SetTexture("_APropertyName", Vector.New(0,1,0))
```
#### Properties[β](#properties "Direct link to Properties")
##### Name[β](#name "Direct link to Name")
string **Name** `get` `set`
*Return a new SMaterial from old.*
* Lua
```lua
local cube=Space.Host.ExecutingObject
local mat=cube.Renderer.Material
Space.Log(mat.Name)
```
##### Shader[β](#shader "Direct link to Shader")
string **Shader** `get`
*Return the shader name of current SMaterial.*
* Lua
```lua
local cube=Space.Host.ExecutingObject
local mat=cube.Renderer.Material
Space.Log(mat.Shader)
```
##### RenderQueue[β](#renderqueue "Direct link to RenderQueue")
int **RenderQueue** `get` `set`
*Render queue of this material.*
*By default materials use render queue of the shader it uses. You can override the render queue used using this variable. Note that if a shader on the material is changed, the render queue resets to that of the shader itself.*
*Render queue value should be in \[0..5000] range to work properly; or -1 to use the render queue from the shader.*
* Lua
```lua
RenderQueue = Space.Host.ExecutingObject.Renderer.Material.RenderQueue
```
---
### SMath
#### Index[β](#index "Direct link to Index")
##### Static Functions Index[β](#static-functions-index "Direct link to Static Functions Index")
| Function Name |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| static float [**Random** ](/scripting/client-scripting-api-reference/types/smath.md#random)() |
| static float [**RandomRange** ](/scripting/client-scripting-api-reference/types/smath.md#randomrange)(float min, float max) |
| static int [**RandomInteger** ](/scripting/client-scripting-api-reference/types/smath.md#randominteger)(int min, int max) |
| static float [**Abs** ](smath#abs)(float v) static int [**Abs** ](smath#abs)(int v) |
| static float [**Acos** ](/scripting/client-scripting-api-reference/types/smath.md#acos)(float v) |
| static bool [**Approximately** ](/scripting/client-scripting-api-reference/types/smath.md#approximately)(float a, float b) |
| static float [**Asin** ](/scripting/client-scripting-api-reference/types/smath.md#asin)(float v) |
| static float [**Atan** ](/scripting/client-scripting-api-reference/types/smath.md#atan)(float v) |
| static float [**Atan2** ](/scripting/client-scripting-api-reference/types/smath.md#atan2)(float y, float x) |
| static int [**Ceil** ](/scripting/client-scripting-api-reference/types/smath.md#ceil)(float v) |
| static float [**Clamp** ](/scripting/client-scripting-api-reference/types/smath.md#clamp)(float v, float min, float max) |
| static float [**Clamp01** ](/scripting/client-scripting-api-reference/types/smath.md#clamp01)(float v) |
| static int [**ClosestPowerOfTwo** ](/scripting/client-scripting-api-reference/types/smath.md#closestpoweroftwo)(int v) |
| static float [**Cos** ](/scripting/client-scripting-api-reference/types/smath.md#cos)(float v) |
| static float [**DeltaAngle** ](/scripting/client-scripting-api-reference/types/smath.md#deltaangle)(float current, float target) |
| static float [**Exp** ](/scripting/client-scripting-api-reference/types/smath.md#exp)(float v) |
| static int [**Floor** ](/scripting/client-scripting-api-reference/types/smath.md#floor)(float v) |
| static float [**GammaToLinearSpace** ](/scripting/client-scripting-api-reference/types/smath.md#gammatolinearspace)(float v) |
| static float [**InverseLerp** ](/scripting/client-scripting-api-reference/types/smath.md#inverselerp)(float a, float b, float value) |
| static bool [**IsPowerOfTwo** ](/scripting/client-scripting-api-reference/types/smath.md#ispoweroftwo)(int v) |
| static float [**Lerp** ](/scripting/client-scripting-api-reference/types/smath.md#lerp)(float a, float b, float v) |
| static float [**LerpAngle** ](/scripting/client-scripting-api-reference/types/smath.md#lerpangle)(float a, float b, float v) |
| static float [**LerpUnclamped** ](/scripting/client-scripting-api-reference/types/smath.md#lerpunclamped)(float a, float b, float v) |
| static float [**LinearToGammaSpace** ](/scripting/client-scripting-api-reference/types/smath.md#lineartogammaspace)(float v) |
| static float [**Log** ](smath#log)(float v) static float [Log ](smath#log)(float v, float p) |
| static float [**Log10** ](/scripting/client-scripting-api-reference/types/smath.md#log10)(float v) |
| static float [**Max** ](/scripting/client-scripting-api-reference/types/smath.md#max)(float a, float b) |
| static float [**Min** ](/scripting/client-scripting-api-reference/types/smath.md#min)(float a, float b) |
| static float [**MoveTowards** ](/scripting/client-scripting-api-reference/types/smath.md#movetowards)(float value, float target, float delta) |
| static float [**MoveTowardsAngle** ](/scripting/client-scripting-api-reference/types/smath.md#movetowardsangle)(float value, float target, float delta) |
| static int [**NextPowerOfTwo** ](/scripting/client-scripting-api-reference/types/smath.md#nextpoweroftwo)(int v) |
| static float [**PerlinNoise** ](/scripting/client-scripting-api-reference/types/smath.md#perlinnoise)(float x, float y) |
| static float [**PingPong** ](/scripting/client-scripting-api-reference/types/smath.md#pingpong)(float t, float length) |
| static float [**Pow** ](/scripting/client-scripting-api-reference/types/smath.md#pow)(float value, float pow) |
| static float [**Repeat** ](/scripting/client-scripting-api-reference/types/smath.md#repeat)(float value, float length) |
| static int [**Round** ](/scripting/client-scripting-api-reference/types/smath.md#round)(float value) |
| static float [**Sign** ](/scripting/client-scripting-api-reference/types/smath.md#sign)(float value) |
| static float [**Sin** ](/scripting/client-scripting-api-reference/types/smath.md#sin)(float value) |
| static float [**SmoothStep** ](/scripting/client-scripting-api-reference/types/smath.md#smoothstep)(float from, float to, float t) |
| static float [**Sqrt** ](/scripting/client-scripting-api-reference/types/smath.md#sqrt)(float value) |
| static float [**Tan** ](/scripting/client-scripting-api-reference/types/smath.md#tan)(float value) |
##### Static Attributes Index[β](#static-attributes-index "Direct link to Static Attributes Index")
| Property Name |
| --------------------------------------------------------------------------------------------------- |
| static readonly float [**Pi**](/scripting/client-scripting-api-reference/types/smath.md#pi)\*\*\*\* |
#### Static Functions[β](#static-functions "Direct link to Static Functions")
##### Random[β](#random "Direct link to Random")
static float **Random** ()
*Returns a random float between 0 and 1 (inclusive)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local randomNumber = Space.Math.Random();
Space.Log(randomNumber);
-- prints 0.689094245433807
```
##### RandomRange[β](#randomrange "Direct link to RandomRange")
static float **RandomRange** (float min, float max)
*Returns a random float between min and max (inclusive)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local min = 100.0;
local max = 500.0;
local randomNumber = Space.Math.RandomRange(min, max );
Space.Log(randomNumber);
-- prints 0206.659149169922
```
##### RandomInteger[β](#randominteger "Direct link to RandomInteger")
static int **RandomInteger** (int min, int max)
*Returns a random float between min (inclusive) and max (exclusive)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local min = 50;
local max = 75;
local randomInteger = Space.Math.RandomInteger(min, max);
Space.Log(randomInteger);
-- prints 52
```
##### Abs[β](#abs "Direct link to Abs")
static float **Abs** (float v) static int **Abs** (int v)
*Returns the absolute value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = -4.2
local absoluteNum = Space.Math.Abs(value);
Space.Log(absoluteNum);
-- prints 4 [BUG] should be 4.2
```
##### Acos[β](#acos "Direct link to Acos")
static float **Acos** (float v)
*Returns the arc cosine value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 0.5;
local arcCosine = Space.Math.Acos(value);
Space.Log(arcCosine);
-- prints 1.04719758033752 (radians) which is 60 degrees
```
##### Approximately[β](#approximately "Direct link to Approximately")
static bool **Approximately** (float a, float b)
*True if the difference between a and b is less than epsilon*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local a = 5.0;
local b = 5;
local approx1 = Space.Math.Approximately(a, b);
Space.Log(approx1);
-- prints true
local a = 5.01;
local b = 5.0;
local approx2 = Space.Math.Approximately(a, b);
Space.Log(approx2);
-- prints false
local a = 5.01;
local b = 5.0;
local approx3 = Space.Math.Approximately(a, b);
Space.Log(approx3);
-- prints false
```
##### Asin[β](#asin "Direct link to Asin")
static float **Asin** (float v)
*Returns the arc sine value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 0.5;
local arcSine = Space.Math.Asin(value);
Space.Log(arcSine);
-- prints 0.523598790168762 (radians) which is 30 degrees
```
##### Atan[β](#atan "Direct link to Atan")
static float **Atan** (float v)
*Returns the arc tangent value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 1.732050808;
local arcTangent = Space.Math.Atan(value);
Space.Log(arcTangent);
-- prints 1.04719758033752 (radians) which is 60 degrees
```
##### Atan2[β](#atan2 "Direct link to Atan2")
static float **Atan2** (float y, float x)
*Returns the arc tangent of y/x*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local x = 0.5;
local y = 0.5;
local arcTangent = Space.Math.Atan2(y, x);
Space.Log(arcTangent);
-- prints 0.785398185253143
```
##### Ceil[β](#ceil "Direct link to Ceil")
static int **Ceil** (float v)
*Returns the ceil value of 'val' as an integer*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Ceil(4.0));
-- prints 4
Space.Log(Space.Math.Ceil(4.2));
-- prints 5
Space.Log(Space.Math.Ceil(-4.2));
-- prints -4
```
##### Clamp[β](#clamp "Direct link to Clamp")
static float **Clamp** (float v, float min, float max)
*Clamps val between min and max, and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 100.0;
local min = 20.0;
local max = 82.0;
local clampedValue = Space.Math.Clamp(value, min, max);
Space.Log(clampedValue);
-- prints 82
```
##### Clamp01[β](#clamp01 "Direct link to Clamp01")
static float **Clamp01** (float v)
*Clamps val between 0 and 1, and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = -1.0;
local clampedValue = Space.Math.Clamp01(value);
Space.Log(clampedValue);
-- prints 0
```
##### ClosestPowerOfTwo[β](#closestpoweroftwo "Direct link to ClosestPowerOfTwo")
static int **ClosestPowerOfTwo** (int v)
*Returns the closest power of two to val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 33;
local powerOfTwo = Space.Math.ClosestPowerOfTwo(value);
Space.Log(powerOfTwo);
-- prints 32
```
##### Cos[β](#cos "Direct link to Cos")
static float **Cos** (float v)
*Returns the cosine of val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local cosine = Space.Math.Cos(angle);
Space.Log(cosine);
-- prints 0.499999970197678
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local cosine2 = Space.Math.Cos(angle2);
Space.Log(cosine2);
-- prints 0.499999970197678
```
##### DeltaAngle[β](#deltaangle "Direct link to DeltaAngle")
static float **DeltaAngle** (float current, float target)
*Returns the difference in degrees between two values (e.g. 350' and 17' returns 27')*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.DeltaAngle(350.0, 17.0));
-- prints 27
```
##### Exp[β](#exp "Direct link to Exp")
static float **Exp** (float v)
*Returns e raised to val power.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Exp(3.0));
-- prints 20.0855369567871
```
##### Floor[β](#floor "Direct link to Floor")
static int **Floor** (float v)
*Returns floor of val, converted to an int*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Floor(4.0));
-- prints 4
Space.Log(Space.Math.Floor(4.2));
-- prints 4
Space.Log(Space.Math.Floor(-4.2));
-- prints -5
```
##### GammaToLinearSpace[β](#gammatolinearspace "Direct link to GammaToLinearSpace")
static float **GammaToLinearSpace** (float v)
*Converts a colour value from Gamma to Linear Space (Pow 2.2)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.GammaToLinearSpace(0.5));
-- prints 0.214041143655777
```
##### InverseLerp[β](#inverselerp "Direct link to InverseLerp")
static float **InverseLerp** (float a, float b, float value)
*Returns the percentage between a and b that 'val' is on a line (opposite of Lerp)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 0.0;
local sliderStop = 100.0;
local currentSliderPos = 75.0;
local percentage = Space.Math.InverseLerp(sliderStart, sliderStop, currentSliderPos);
Space.Log(percentage);
-- prints 0.75
```
##### IsPowerOfTwo[β](#ispoweroftwo "Direct link to IsPowerOfTwo")
static bool **IsPowerOfTwo** (int v)
*Returns true if val is a power of two*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.IsPowerOfTwo(55));
-- prints False
Space.Log(Space.Math.IsPowerOfTwo(32));
-- prints True
```
##### Lerp[β](#lerp "Direct link to Lerp")
static float **Lerp** (float a, float b, float v)
*Interpolates between 'a' and 'b' based on 'val', assuming 'val' is between 0 and 1*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 0.0;
local sliderStop = 100.0;
local percentage = 0.75;
local currentSliderPos = Space.Math.Lerp(sliderStart, sliderStop, percentage);
Space.Log(currentSliderPos);
-- prints 75
```
##### LerpAngle[β](#lerpangle "Direct link to LerpAngle")
static float **LerpAngle** (float a, float b, float v)
*Interpolates between angles 'a' and 'b' based on 'val', assuming 'val' is between 0 and 1*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStartAngle = 0.0;
local sliderStopAngle = Space.Math.Pi;-- 180 degrees
local percentage = 0.50;
local currentSliderPos = Space.Math.LerpAngle(sliderStartAngle, sliderStopAngle, percentage);
Space.Log(currentSliderPos);
-- prints 1.57079637050629 (90 degrees)
```
##### LerpUnclamped[β](#lerpunclamped "Direct link to LerpUnclamped")
static float **LerpUnclamped** (float a, float b, float v)
*Interpolates between 'a' and 'b' based on 'val', assuming 'val' is between 0 and 1, but unbounded (allowing higher/lower values)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 0.0;
local sliderStop = 100.0;
local percentage = 2.0;
local currentSliderPos = Space.Math.LerpUnclamped(sliderStart, sliderStop, percentage);
Space.Log(currentSliderPos);
-- prints 200
```
##### LinearToGammaSpace[β](#lineartogammaspace "Direct link to LinearToGammaSpace")
static float **LinearToGammaSpace** (float v)
*Converts a colour value from Linear to Gamma Space (Pow 1/2.2)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.LinearToGammaSpace(0.214041143655777));
-- prints 0.5
```
##### Log[β](#log "Direct link to Log")
static float **Log** (float v) static float **Log** (float v, float p)
*Returns the natural logarithm for 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Log(30.0));
-- prints 3.40119743347168
Space.Log(Space.Math.Log(4.0, 2.0));
-- prints 2
```
##### Log10[β](#log10 "Direct link to Log10")
static float **Log10** (float v)
*Returns the Log10 value for 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Log10(100.0));
-- prints 2
```
##### Max[β](#max "Direct link to Max")
static float **Max** (float a, float b)
*Returns higher of 'a' or 'b'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Max(20.0, 100.0));
-- prints 100
```
##### Min[β](#min "Direct link to Min")
static float **Min** (float a, float b)
*Returns lower of 'a' or 'b'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Min(20.0, 100.0));
-- prints 20
```
##### MoveTowards[β](#movetowards "Direct link to MoveTowards")
static float **MoveTowards** (float value, float target, float delta)
*Move value to target, but by no more than delta*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 5.0;
local sliderStop = 10.0;
local deltaChange = 1.0;
local currentSliderPos = Space.Math.MoveTowards(sliderStart, sliderStop, deltaChange);
Space.Log(currentSliderPos);
-- prints 6 (moves forward 1)
local sliderStart = 5.0;
local sliderStop = 10.0;
local deltaChange = 7.0;
local currentSliderPos = Space.Math.MoveTowards(sliderStart, sliderStop, deltaChange);
Space.Log(currentSliderPos); -- prints 10 (caps out at at the target value)
-- NOTE: Use negative delta to move away from target.
```
##### MoveTowardsAngle[β](#movetowardsangle "Direct link to MoveTowardsAngle")
static float **MoveTowardsAngle** (float value, float target, float delta)
*Move angle value to target, but by no more than delta*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStartAngle = Space.Math.Pi/2; -- 90 degrees
local sliderStopAngle = Space.Math.Pi; -- 180 degrees
local deltaChange = Space.Math.Pi/6; -- 30 degrees
local currentSliderPos = Space.Math.MoveTowardsAngle(sliderStartAngle, sliderStopAngle, deltaChange);
Space.Log(currentSliderPos);
-- prints 2.09439516067505 (moves forward 30 degrees to 120 degrees)
-- NOTE: Add 180 degrees (Space.Math.Pi) to move away from target.
```
##### NextPowerOfTwo[β](#nextpoweroftwo "Direct link to NextPowerOfTwo")
static int **NextPowerOfTwo** (int v)
*Return the next power of two larger or equal to val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.NextPowerOfTwo(16));
-- prints 16
Space.Log(Space.Math.NextPowerOfTwo(17));
-- prints 32
```
##### PerlinNoise[β](#perlinnoise "Direct link to PerlinNoise")
static float **PerlinNoise** (float x, float y)
*Return 2D Perlin noise for coordinates x and y*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Lua Translation of Unity C# Documentation
local ball = Space.Host.ExecutingObject;
ball.SubscribeToEvents();
-- animates this object to move upwards on the y axis with slight random movement
local animateBall = function()
local heightScale = 0.1; -- controls speed of movement
local xScale = 1.0; -- shifts x position on perlin noise plane
local height = heightScale * Space.Math.PerlinNoise(Space.Time * xScale, 0.0);
local pos = ball.LocalPosition;
pos.y = pos.y + height;
ball.LocalPosition = pos;
Space.Log(pos.y);
end
ball.OnUpdate(animateBall);
-- NOTE: If you need a guaranteed range of [0,1], make sure to clamp the value with Space.Math.Clamp01.
```
##### PingPong[β](#pingpong "Direct link to PingPong")
static float **PingPong** (float t, float length)
*Return a value between 0 and length that oscillates upwards and back based on the position of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
--[[ In this example, if you traced the output of Space.Math.PingPong(value, length),
the return values would cycle forward through the range [0,5] then cycle backwards through the range [5,0] in order. --]]
local ball = Space.Host.ExecutingObject;
local originalPos = ball.LocalPosition;
ball.SubscribeToEvents();
-- The ball object oscillates back and forth on the x-axis.
local animateBall = function()
local value = Space.Time;
local length = 5.0;
local newPos = Vector.New(Space.Math.PingPong(value, length) + originalPos.x, originalPos.y, originalPos.z);
ball.LocalPosition = newPos;
end
ball.OnUpdate(animateBall);
```
##### Pow[β](#pow "Direct link to Pow")
static float **Pow** (float value, float pow)
*Return x raised to y power*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Pow(2, 4));
-- prints 16
```
##### Repeat[β](#repeat "Direct link to Repeat")
static float **Repeat** (float value, float length)
*Return a value between 0 and length that returns to 0 after exceeding length based on 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
--[[ In this example, if you traced the output of Space.Math.Repeat(value, length),
the return values would cycle forward through the range [0,5]. The cycle is repeated again from 0.--]]
local ball = Space.Host.ExecutingObject;
local originalPos = ball.LocalPosition;
ball.SubscribeToEvents();
-- The ball object moves forward on the x-axis.
-- Then, it repeats the same motion again from the beginning.
local animateBall = function()
local value = Space.Time;
local length = 5.0;
local newPos = Vector.New(Space.Math.Repeat(value, length) + originalPos.x, originalPos.y, originalPos.z);
ball.LocalPosition = newPos;
end
ball.OnUpdate(animateBall);
```
##### Round[β](#round "Direct link to Round")
static int **Round** (float value)
*Returns the nearest integer value to val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Round(4.0));
-- prints 4
Space.Log(Space.Math.Round(4.2));
-- prints 4
Space.Log(Space.Math.Round(4.5));
-- prints 4
Space.Log(Space.Math.Round(4.55));
-- prints 5
Space.Log(Space.Math.Round(4.8));
-- prints 5
Space.Log(Space.Math.Round(-4.2));
-- prints -4
Space.Log(Space.Math.Round(-4.8));
-- prints -5
```
##### Sign[β](#sign "Direct link to Sign")
static float **Sign** (float value)
*Returns either 1 or -1 based on the sign of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Sign(4.2));
-- prints 1
Space.Log(Space.Math.Sign(-4.2));
-- prints -1
```
##### Sin[β](#sin "Direct link to Sin")
static float **Sin** (float value)
*Returns the sine of val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local sine = Space.Math.Sin(angle);
Space.Log(sine);
-- prints 0.866025447845459
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local sine2 = Space.Math.Sin(angle2);
Space.Log(sine2);
-- prints 0.866025447845459
```
##### SmoothStep[β](#smoothstep "Direct link to SmoothStep")
static float **SmoothStep** (float from, float to, float t)
*Similar to Lerp but moves slowly closer to the edges ('Spherical Lerp')*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Lua Translation of Unity C# Documentation
--[[ In this example, Space.Math.SmoothStep(min, max, time) returns values in the range [1,10] in order.
As values approach 10, the interpolation slows down. --]]
local ball = Space.Host.ExecutingObject;
local originalPos = ball.LocalPosition;
local min = 1.0;
local max = 10.0;
local duration = 5.0; --lower value to speed up; raise to slow down
local startTime;
ball.SubscribeToEvents();
local initStartTime = function()
startTime = Space.Time;
end
-- The ball jumps to min + originalPos, then it moves towards
-- max + originalPos while slowing down at the end.
local animateBall = function()
local time = (Space.Time - startTime) / duration;
local newPos = Vector.New(Space.Math.SmoothStep(min, max, time)
+ originalPos.x, originalPos.y, originalPos.z);
ball.LocalPosition = newPos;
end
ball.OnStart(initStartTime);
ball.OnUpdate(animateBall);
```
##### Sqrt[β](#sqrt "Direct link to Sqrt")
static float **Sqrt** (float value)
*Returns the square root of val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Sqrt(16));
-- prints 4
Space.Log(Space.Math.Sqrt(-16));
-- prints NaN
```
##### Tan[β](#tan "Direct link to Tan")
static float **Tan** (float value)
*Returns the tangent value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local tangent = Space.Math.Tan(angle);
Space.Log(tangent);
-- prints 1.73205089569092
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local tangent2 = Space.Math.Tan(angle2);
Space.Log(tangent2);
-- prints 1.73205089569092
```
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local tangent = Space.Math.Tan(angle);
Space.Log(tangent);
-- prints 1.73205089569092
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local tangent2 = Space.Math.Tan(angle2);
Space.Log(tangent2);
-- prints 1.73205089569092
```
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local tangent = Space.Math.Tan(angle);
Space.Log(tangent);
-- prints 1.73205089569092
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local tangent2 = Space.Math.Tan(angle2);
Space.Log(tangent2);
-- prints 1.73205089569092
```
#### Static Attributes[β](#static-attributes "Direct link to Static Attributes")
##### Pi[β](#pi "Direct link to Pi")
static readonly float **Pi** = 3.14159265358979f
*Returns the constant value of Ξ .*
* Lua
```lua
pi = Space.Math.Pi
```
---
### SMusicDirectory
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ----------------------------------------------------------------------------------------------------------------------------------------- |
| void [**GetTop100** ](/scripting/client-scripting-api-reference/types/smusicdirectory.md#gettop100)(Closure onLoad) |
| void [**GetGenreList** ](/scripting/client-scripting-api-reference/types/smusicdirectory.md#getgenrelist)(Closure onLoad, int parentId=0) |
| void [**SearchByGenre** ](/scripting/client-scripting-api-reference/types/smusicdirectory.md#searchbygenre)(SGenre genre, Closure onLoad) |
| void [**SearchByText** ](/scripting/client-scripting-api-reference/types/smusicdirectory.md#searchbytext)(string search, Closure onLoad) |
#### Functions[β](#functions "Direct link to Functions")
##### GetTop100[β](#gettop100 "Direct link to GetTop100")
void **GetTop100** (Closure onLoad)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### GetGenreList[β](#getgenrelist "Direct link to GetGenreList")
void **GetGenreList** (Closure onLoad, int parentId=0)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### SearchByGenre[β](#searchbygenre "Direct link to SearchByGenre")
void **SearchByGenre** ([SGenre](/scripting/client-scripting-api-reference/types/sgenre.md) genre, Closure onLoad)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### SearchByText[β](#searchbytext "Direct link to SearchByText")
void **SearchByText** (string search, Closure onLoad)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SMusicStation
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ------------------------------------------------------------------------------------------------------------ |
| override string [**ToString** ](/scripting/client-scripting-api-reference/types/smusicstation.md#tostring)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------------------------------------------------------------------------------------- |
| string [**Name** ](/scripting/client-scripting-api-reference/types/smusicstation.md#name)`get` `set` |
| string [**Mt**](/scripting/client-scripting-api-reference/types/smusicstation.md#mt) `get` `set` |
| string [**Id**](/scripting/client-scripting-api-reference/types/smusicstation.md#id) `get` `set` |
| string [**Br**](/scripting/client-scripting-api-reference/types/smusicstation.md#br) `get` `set` |
| string [**Genre**](/scripting/client-scripting-api-reference/types/smusicstation.md#genre) `get` `set` |
| string [**Genre2** ](/scripting/client-scripting-api-reference/types/smusicstation.md#genre2)`get` `set` |
| string [**Logo** ](/scripting/client-scripting-api-reference/types/smusicstation.md#logo)`get` `set` |
| string [**Ct**](/scripting/client-scripting-api-reference/types/smusicstation.md#ct) `get` `set` |
| string [**Lc**](/scripting/client-scripting-api-reference/types/smusicstation.md#lc) `get` `set` |
#### Functions[β](#functions "Direct link to Functions")
##### ToString[β](#tostring "Direct link to ToString")
override string **ToString** ()
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
#### Properties[β](#properties "Direct link to Properties")
##### Name[β](#name "Direct link to Name")
string **Name** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Mt[β](#mt "Direct link to Mt")
string **Mt** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Id[β](#id "Direct link to Id")
string **Id** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Br[β](#br "Direct link to Br")
string **Br** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Genre[β](#genre "Direct link to Genre")
string **Genre** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Genre2[β](#genre2 "Direct link to Genre2")
string **Genre2** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Logo[β](#logo "Direct link to Logo")
string **Logo** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Ct[β](#ct "Direct link to Ct")
string **Ct** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Lc[β](#lc "Direct link to Lc")
string **Lc** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SMusicStationList
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------------------------------------- |
| STuneIn [**TuneIn** ](/scripting/client-scripting-api-reference/types/smusicstationlist.md#tunein)`get` `set` |
| List< SMusicStation > [**Station** ](/scripting/client-scripting-api-reference/types/smusicstationlist.md#station)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### TuneIn[β](#tunein "Direct link to TuneIn")
[STuneIn](/scripting/client-scripting-api-reference/types/stunein.md) **TuneIn** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Station[β](#station "Direct link to Station")
List< [SMusicStation](/scripting/client-scripting-api-reference/types/smusicstation.md) > **Station** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SOutfit
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ----------------------------------------------------------------------------------------------------------------- |
| void [**GetPreview** ](/scripting/client-scripting-api-reference/types/soutfit.md#getpreview)(Closure onComplete) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ---------------------------------------------------------------------------------------- |
| int [**ID**](/scripting/client-scripting-api-reference/types/soutfit.md#id) `get` |
| string [**Name** ](/scripting/client-scripting-api-reference/types/soutfit.md#name)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetPreview[β](#getpreview "Direct link to GetPreview")
void **GetPreview** (Closure onComplete)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
#### Properties[β](#properties "Direct link to Properties")
##### ID[β](#id "Direct link to ID")
int **ID** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SParticle
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| --------------------------------------------------------------------------------------------------------------------------- |
| SVector [**position** ](/scripting/client-scripting-api-reference/types/sparticle.md#position)`get` `set` |
| SVector [**velocity** ](/scripting/client-scripting-api-reference/types/sparticle.md#velocity)`get` `set` |
| SVector [**animatedVelocity** ](/scripting/client-scripting-api-reference/types/sparticle.md#animatedvelocity)`get` |
| SVector [**totalVelocity** ](/scripting/client-scripting-api-reference/types/sparticle.md#totalvelocity)`get` |
| float [**remainingLifetime** ](/scripting/client-scripting-api-reference/types/sparticle.md#remaininglifetime)`get` `set` |
| float [**startLifetime** ](/scripting/client-scripting-api-reference/types/sparticle.md#startlifetime)`get` `set` |
| SColor [**startColor** ](/scripting/client-scripting-api-reference/types/sparticle.md#startcolor)`get` `set` |
| uint [**randomSeed** ](/scripting/client-scripting-api-reference/types/sparticle.md#randomseed)`get` `set` |
| SVector [**axisOfRotation** ](/scripting/client-scripting-api-reference/types/sparticle.md#axisofrotation)`get` `set` |
| float [**startSize** ](/scripting/client-scripting-api-reference/types/sparticle.md#startsize)`get` `set` |
| SVector [**startSize3D** ](/scripting/client-scripting-api-reference/types/sparticle.md#startsize3d)`get` `set` |
| float [**rotation** ](/scripting/client-scripting-api-reference/types/sparticle.md#rotation)`get` `set` |
| SVector [**rotation3D** ](/scripting/client-scripting-api-reference/types/sparticle.md#rotation3d)`get` `set` |
| float [**angularVelocity** ](/scripting/client-scripting-api-reference/types/sparticle.md#angularvelocity)`get` `set` |
| SVector [**angularVelocity3D** ](/scripting/client-scripting-api-reference/types/sparticle.md#angularvelocity3d)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### position[β](#position "Direct link to position")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **position** `get` `set`
*The position of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
position = FirstParticle.position
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
* Lua
```lua
example 2
```
##### velocity[β](#velocity "Direct link to velocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **velocity** `get` `set`
*The velocity of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
velocity= FirstParticle.velocity
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### animatedVelocity[β](#animatedvelocity "Direct link to animatedVelocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **animatedVelocity** `get`
*The animated velocity of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
animatedVelocity= FirstParticle.animatedVelocity
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
* Lua
```lua
example 2
```
##### totalVelocity[β](#totalvelocity "Direct link to totalVelocity")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **totalVelocity** `get`
*The total velocity of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
totalVelocity= FirstParticle.totalVelocity
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### remainingLifetime[β](#remaininglifetime "Direct link to remainingLifetime")
float **remainingLifetime** `get` `set`
*The remaining lifetime of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
remainingLifetime= FirstParticle.remainingLifetime
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### startLifetime[β](#startlifetime "Direct link to startLifetime")
float **startLifetime** `get` `set`
*The starting lifetime of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
startLifetime= FirstParticle.startLifetime
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### startColor[β](#startcolor "Direct link to startColor")
[SColor](/scripting/client-scripting-api-reference/types/scolor.md) **startColor** `get` `set`
*The initial color of the particle. The current color of the particle is calculated procedurally based on this value and the active color modules.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
startColor= FirstParticle.startColor
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### randomSeed[β](#randomseed "Direct link to randomSeed")
uint **randomSeed** `get` `set`
*The random seed of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
randomSeed= FirstParticle.randomSeed
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### axisOfRotation[β](#axisofrotation "Direct link to axisOfRotation")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **axisOfRotation** `get` `set`
*Mesh particles rotate around this axis.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
axisOfRotation= FirstParticle.axisOfRotation
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### startSize[β](#startsize "Direct link to startSize")
float **startSize** `get` `set`
*The initial size of the particle. The current size of the particle is calculated procedurally based on this value and the active size modules.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
startSize= FirstParticle.startSize
end
this.OnParticleTrigger(OnParticleTrigger)
```
##### startSize3D[β](#startsize3d "Direct link to startSize3D")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **startSize3D** `get` `set`
*The initial 3D size of the particle. The current size of the particle is calculated procedurally based on this value and the active size modules.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
startSize3D= FirstParticle.startSize3D
end
this.OnParticleTrigger(OnParticleTrigger)
```
##### rotation[β](#rotation "Direct link to rotation")
float **rotation** `get` `set`
*The rotation of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
rotation= FirstParticle.rotation
end
this.OnParticleTrigger(OnParticleTrigger)
```
##### rotation3D[β](#rotation3d "Direct link to rotation3D")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **rotation3D** `get` `set`
*The 3D rotation of the particle.*
* Lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject) ParticlesArray = this.ParticleSystem.GetTriggerParticles(0) FirstParticle = ParticlesArray\[1] rotation3D= FirstParticle.rotation3D
end
this.SubscribeToEvents() this.OnParticleTrigger(OnParticleTrigger)
````text
```lua
example 2
````
##### angularVelocity[β](#angularvelocity "Direct link to angularVelocity")
float **angularVelocity** `get` `set`
*The angular velocity of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
angularVelocity= FirstParticle.angularVelocity
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
##### angularVelocity3D[β](#angularvelocity3d "Direct link to angularVelocity3D")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **angularVelocity3D** `get` `set`
*The 3D angular velocity of the particle.*
* Lua
```lua
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
ParticlesArray = this.ParticleSystem.GetTriggerParticles(0)
FirstParticle = ParticlesArray[1]
angularVelocity3D= FirstParticle.angularVelocity3D
end
this.SubscribeToEvents()
this.OnParticleTrigger(OnParticleTrigger)
```
---
### SPhysicsHit
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------------------------------------------------------------------------------------- |
| SGameObject [**Object** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#object)`get` |
| SVector [**Position** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#position)`get` |
| SVector [**Normal** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#normal)`get` |
| SVector [**UV** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#uv)`get` |
| SVector [**UV2** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#uv2)`get` |
| float [**Distance** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#distance)`get` |
| bool [**ContainsHit** ](/scripting/client-scripting-api-reference/types/sphysicshit.md#containshit)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Object[β](#object "Direct link to Object")
[SGameObject ](/scripting/client-scripting-api-reference/types/sgameobject.md)**Object** `get`
*Property Description*
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitGameObject = hit.Object
```
* Lua
```lua
example 2
```
##### Position[β](#position "Direct link to Position")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Position** `get`
*Where the physics hit occurred*
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitPosition = hit.Position
```
##### Normal[β](#normal "Direct link to Normal")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Normal** `get`
*The normal of the hit*
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitNormal = hit.Normal
```
##### UV[β](#uv "Direct link to UV")
SVector **UV** `get`
*The UV coordinates of where the hit occurred on a mesh.*
danger
This property will currently always return \[0,0] due to a current bug.
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitUV = hit.UV
```
##### UV2[β](#uv2 "Direct link to UV2")
SVector **UV2** `get`
*The UV2 coordinates of where the hit occurred on a mesh.*
danger
This property will currently always return \[0,0] due to a current bug.
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitUV2 = hit.UV2
```
##### Distance[β](#distance "Direct link to Distance")
float **Distance** `get`
*How far down a ray or from the collider, the hit occurred*
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitDistance = hit.Distance
```
##### ContainsHit[β](#containshit "Direct link to ContainsHit")
bool **ContainsHit** `get`
*Whether it was a hit or not*
* Lua
```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)
hitContainsHit = hit.ContainsHit
```
---
### SPublicRegion
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------------------------------------------------------------------------------------------- |
| int [**ID**](/scripting/client-scripting-api-reference/types/spublicregion.md#id) `get` |
| int [**OwnerID** ](/scripting/client-scripting-api-reference/types/spublicregion.md#ownerid)`get` |
| string [**Name** ](/scripting/client-scripting-api-reference/types/spublicregion.md#name)`get` |
| string [**MapPath** ](/scripting/client-scripting-api-reference/types/spublicregion.md#mappath)`get` |
| string [**PreviewPath** ](/scripting/client-scripting-api-reference/types/spublicregion.md#previewpath)`get` |
| int [**RankingScore** ](/scripting/client-scripting-api-reference/types/spublicregion.md#rankingscore)`get` |
| int [**MaxAvatars** ](/scripting/client-scripting-api-reference/types/spublicregion.md#maxavatars)`get` |
| int [**FileSize** ](/scripting/client-scripting-api-reference/types/spublicregion.md#filesize)`get` |
| int [**Memory** ](/scripting/client-scripting-api-reference/types/spublicregion.md#memory)`get` |
| SLandmark\[] [**Landmarks** ](/scripting/client-scripting-api-reference/types/spublicregion.md#landmarks)`get` |
| SSubRegion\[] [**Regions** ](/scripting/client-scripting-api-reference/types/spublicregion.md#regions)`get` |
| string [**Description** ](/scripting/client-scripting-api-reference/types/spublicregion.md#description)`get` |
| SAccessType [**Access** ](/scripting/client-scripting-api-reference/types/spublicregion.md#access)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### ID[β](#id "Direct link to ID")
int **ID** `get`
*The Region ID of this region*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionID = r.ID
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### OwnerID[β](#ownerid "Direct link to OwnerID")
int **OwnerID** `get`
*The ID of the owner of this region*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionOwnerID = r.OwnerID
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*The Name of this region*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionName = r.Name
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### MapPath[β](#mappath "Direct link to MapPath")
string **MapPath** `get`
*Property Description*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionMapPath = r.MapPath
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### PreviewPath[β](#previewpath "Direct link to PreviewPath")
string **PreviewPath** `get`
*Property Description*
* Lua
```lua
--Make's a UIText show the Preview Path of the user's first available region
textObject = Space.Host.GetReference("TheTextReference")
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionPreviewPath = r.PreviewPath
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### RankingScore[β](#rankingscore "Direct link to RankingScore")
int **RankingScore** `get`
*The Ranking Score of the region.*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionRankingScore = r.RankingScore
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### MaxAvatars[β](#maxavatars "Direct link to MaxAvatars")
int **MaxAvatars** `get`
*The max number of avatars this region can hold.*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionMaxAvatars = r.MaxAvatars
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### FileSize[β](#filesize "Direct link to FileSize")
int **FileSize** `get`
*The current MBs the region is using.*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionFileSize = r.FileSize
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### Memory[β](#memory "Direct link to Memory")
int **Memory** `get`
*Property Description*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionMemory = r.Memory
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### Landmarks[β](#landmarks "Direct link to Landmarks")
[SLandmark](/scripting/client-scripting-api-reference/types/slandmark.md)\[] **Landmarks** `get`
*An array of Landmarks in the region.*
* Lua
\`\`\` function GetUserRegionsComplete(SUserRegions) local r = SUserRegions.AvailableRegions\[1] regionLandmarks = r.Landmarks end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete) \`\`\`
##### Regions[β](#regions "Direct link to Regions")
[SSubRegion](/scripting/client-scripting-api-reference/types/ssubregion.md)\[] **Regions** `get`
*Returns an array of* [*SSubRegion*](/scripting/client-scripting-api-reference/types/ssubregion.md) *in the region.*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionSubRegions = r.Regions
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### Description[β](#description "Direct link to Description")
string **Description** `get`
*Returns the description of the region.*
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionDescription = r.Description
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### Access[β](#access "Direct link to Access")
int **Access** `get`
*The access type of the region (such as "Public" or "Approved only")* *1=* Disabled, 2= FreeForall, 3= FriendsOnly, 4= ApprovedOnly, 5= GroupsOnly
* Lua
```lua
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
regionAccessType = r.Access
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
---
### SQuaternion
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| string [**ToString** ](/scripting/client-scripting-api-reference/types/squaternion.md#tostring)() |
| float [**Angle** ](/scripting/client-scripting-api-reference/types/squaternion.md#angle)(SQuaternion b) |
| SQuaternion [**Lerp** ](/scripting/client-scripting-api-reference/types/squaternion.md#lerp)(SQuaternion b, float t) |
| SQuaternion [**Slerp** ](/scripting/client-scripting-api-reference/types/squaternion.md#slerp)(SQuaternion b, float t) |
| SQuaternion [**RotateTowards** ](/scripting/client-scripting-api-reference/types/squaternion.md#rotatetowards)(SQuaternion b, float delta) |
| float [**Dot** ](/scripting/client-scripting-api-reference/types/squaternion.md#dot)(SQuaternion b) |
| bool [**Equals** ](/scripting/client-scripting-api-reference/types/squaternion.md#equals)(SQuaternion other) |
| |
| **Static Functions** |
| static SQuaternion [**New** ](/scripting/client-scripting-api-reference/types/squaternion.md#new)(float x, float y, float z, float w) |
| static SQuaternion [**Euler** ](/scripting/client-scripting-api-reference/types/squaternion.md#euler)(float x, float y, float z) |
| static SQuaternion [**AngleAxis** ](/scripting/client-scripting-api-reference/types/squaternion.md#angleaxis)(SVector axis, float angle) |
| static SQuaternion [**LookRotation** ](squaternion#lookrotation)(SVector forward) static SQuaternion [**LookRotation** ](squaternion#lookrotation)(SVector forward, SVector up) |
| static SVector [**operator**](squaternion#operator) *(SQuaternion a, SVector b)* *static SQuaternion* [***operator***](squaternion#operator) (SQuaternion a, SQuaternion b) |
| static SQuaternion **FromToRotation** (SVector a, SVector b) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ---------------------------------------------------------------------------------------------------------------- |
| float [**X**](/scripting/client-scripting-api-reference/types/squaternion.md#x) `get` `set` |
| float [**Y**](/scripting/client-scripting-api-reference/types/squaternion.md#y) `get` `set` |
| float [**Z**](/scripting/client-scripting-api-reference/types/squaternion.md#z) `get` `set` |
| float [**W**](/scripting/client-scripting-api-reference/types/squaternion.md#w) `get` `set` |
| SVector [**EulerAngles** ](/scripting/client-scripting-api-reference/types/squaternion.md#eulerangles)`get` |
| SQuaternion [**Inverse** ](/scripting/client-scripting-api-reference/types/squaternion.md#inverse)`get` |
| |
| **Static Properties** |
| static SQuaternion [**Identity** ](/scripting/client-scripting-api-reference/types/squaternion.md#identity)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### ToString[β](#tostring "Direct link to ToString")
string **ToString** ()
*Converts a quaternion to a human readable string*
* Lua
```lua
aQuaternion = Quaternion.New(0.0, 1.0, 0.0, 0.0)
theString = aQuaternion.ToString()
```
##### Angle[β](#angle "Direct link to Angle")
float **Angle** (SQuaternion b)
*Returns the angle between two quaternions*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local newQuat = Quaternion.New(0.0, 0.707, 0.0, 0.707);
local otherQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0);
angle = newQuat.Angle(otherQuat);
Space.Log(angle);
-- prints 90.0173034667969
```
##### Lerp[β](#lerp "Direct link to Lerp")
SQuaternion **Lerp** (SQuaternion b, float t)
*Linearly interpolates between this and other quaternion, by factor t and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
QuatA = Quaternion.New(0.0, 0.707, 0.0, 0.707)
QuatB = Quaternion.New(0.0, 1.0, 0.0, 0.0)
QuatLerpAB = QuatA.Lerp(QuatB, Space.Time * 0.1)
```
* Lua
```lua
local cube = Space.Host.ExecutingObject
local fromQuat = cube.LocalRotation
local toQuat = Quaternion.New(0.0, 0.707, 0.0, 0.707)
local speed = 0.1
-- The cube will rotate 90 degrees from current rotation by speed amount.
local moveCube = function()
cube.LocalRotation = fromQuat.Lerp(toQuat, Space.Time * speed);
end
cube.OnUpdate(moveCube)
```
##### Slerp[β](#slerp "Direct link to Slerp")
SQuaternion **Slerp** (SQuaternion b, float t)
*Spherically interpolates between this and other quaternion, by factor t and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
QuatA = Quaternion.New(0.0, 0.707, 0.0, 0.707)
QuatB = Quaternion.New(0.0, 1.0, 0.0, 0.0)
QuatLerpAB = QuatA.Slerp(QuatB, Space.Time * 0.1)
```
* Lua
```lua
local cube = Space.Host.ExecutingObject;
local fromQuat = cube.LocalRotation;
local toQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0);
local speed = 0.1;
-- The cube will rotate 180 degrees from current rotation by speed amount.
local moveCube = function()
cube.LocalRotation = fromQuat.Slerp(toQuat, Space.Time * speed)
end
cube.OnUpdate(moveCube)
```
##### RotateTowards[β](#rotatetowards "Direct link to RotateTowards")
SQuaternion **RotateTowards** (SQuaternion b, float delta)
*Rotates this towards other, by no more than t degrees*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
QuatA = Quaternion.New(0.0, 0.707, 0.0, 0.707)
QuatB = Quaternion.New(0.0, 1.0, 0.0, 0.0)
ARotatedTowardB = QuatA.RotateTowards(QuatB, Space.Time * 0.1)
```
* Lua
```lua
local cube = Space.Host.ExecutingObject
local fromQuat = cube.LocalRotation
local target = Quaternion.New(0.0, 0.707, 0.0, 0.707)
local speed = 10.0
-- The cube will rotate 90 degrees from current rotation by step amount.
local moveCube = function()
local step = speed * Space.Time
cube.LocalRotation = fromQuat.RotateTowards(target, step)
end
cube.OnUpdate(moveCube)
```
##### Dot[β](#dot "Direct link to Dot")
float **Dot** (SQuaternion b)
*Returns the dot product of this and another quaternion*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local quat = Quaternion.New(0.0, 0.707, 0.0, 0.707);
local quatOther = Quaternion.New(0.0, 0.0, 0.0, 1.0);
Space.Log(quat.Dot(quatOther));
-- prints 0.707000017166138
```
##### Equals[β](#equals "Direct link to Equals")
bool **Equals** (SQuaternion other)
*Function Description*
| Parameter | Type | Description |
| --------- | ----------- | ------------------------------------------------ |
| other | SQuaternion | The other Quaternion that we are comparing with. |
* Lua
```lua
QuatA = Quaternion.New(0.0, 0.707, 0.0, 0.707)
QuatB = Quaternion.New(0.0, 1.0, 0.0, 0.0)
isEqual = QuatA.Equals(QuatB)
```
##### New[β](#new "Direct link to New")
static SQuaternion **New** (float x, float y, float z, float w)
*Creates a new Quaternion*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newQuat = Quaternion.New(0.0, 0.707, 0.0, 0.707)
```
##### Euler[β](#euler "Direct link to Euler")
static SQuaternion **Euler** (float x, float y, float z)
*Creates a quaternion using Euler angles.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newQuat = Quaternion.Euler(0.0, 90.0, 0.0)
```
##### AngleAxis[β](#angleaxis "Direct link to AngleAxis")
static SQuaternion **AngleAxis** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) axis, float angle)
*Creates a quaternion from an Angle/Axis pair*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newVector = Vector.New(0.0, 90.0, 0.0)
newQuat = Quaternion.AngleAxis(newVector, 90.0)
```
##### LookRotation[β](#lookrotation "Direct link to LookRotation")
static SQuaternion **LookRotation** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) forward) static SQuaternion **LookRotation** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) forward, [SVector](/scripting/client-scripting-api-reference/types/svector.md) up)
*Creates a quaternion a forward vector; presuming up is (0,1,0)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local newQuat = Quaternion.LookRotation(Vector.Forward);
-- or
local newQuat = Quaternion.LookRotation(Vector.Forward, Vector.Up);
```
##### operator\*[β](#operator "Direct link to operator*")
static [SVector](/scripting/client-scripting-api-reference/types/svector.md) **operator**\* (SQuaternion a, [SVector](/scripting/client-scripting-api-reference/types/svector.md) b) static SQuaternion **operator**\* (SQuaternion a, SQuaternion b)
*The result of using the \* operator.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0)
newVector = Vector.Forward
rotatedVector = newQuat * newVector
--or
newQuat = Quaternion.New(0.0, 0.707, 0.0, 0.707)
newVector = Vector.New(0.0, 0.0, 0.0)
rotatedVector = newQuat * newQuat
```
##### FromToRotation[β](#fromtorotation "Direct link to FromToRotation")
static SQuaternion **FromToRotation** (SVector a, SVector b)
*Creates a rotation which rotates from a to b.*
*Usually you use this to rotate a transform so that one of its axes eg. the y-axis - follows a target direction b in world space.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
VectorA = Vector.New(0.0,1.0,0.0)
VectorB = Vector.New(1.0,0.0,0.0)
QuaternionFromToRotation = Quaternion.FromToRotation(VectorA, VectorB)
```
#### Properties[β](#properties "Direct link to Properties")
##### X[β](#x "Direct link to X")
float **X** `get` `set`
*X axis*
* Lua
```lua
newQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0)
newQuat.X = 40.0
```
* Lua
```lua
obj = Space.Host.ExecutingObject
originalRot = obj.LocalRotation
onStartMethod = function()
Space.Log(originalRot.x)
-- prints the X component of this object as a float
originalRot.x = 0.25
-- assigns 0.25 value to the X component
obj.LocalRotation = originalRot
-- sets the the new rotation
end
obj.OnStart(onStartMethod)
```
##### Y[β](#y "Direct link to Y")
float **Y** `get` `set`
*Y axis*
* Lua
```lua
newQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0)
newQuat.Y = 40.0
```
* Lua
```lua
obj = Space.Host.ExecutingObject
originalRot = obj.LocalRotation
onStartMethod = function()
Space.Log(originalRot.y);
-- prints the Y component of this object as a float
originalRot.y = 0.25;
-- assigns 0.25 value to the Y component
obj.LocalRotation = originalRot;
-- sets the the new rotation
end
obj.OnStart(onStartMethod);
```
##### Z[β](#z "Direct link to Z")
float **Z** `get` `set`
*Z axis*
* Lua
```lua
newQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0)
newQuat.Z = 40.0
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local originalRot = obj.LocalRotation;
obj.SubscribeToEvents();
local onStartMethod = function()
Space.Log(originalRot.z);
-- prints the Z component of this object as a float
originalRot.z = 0.25;
-- assigns 0.25 value to the Z component
obj.LocalRotation = originalRot;
-- sets the the new rotation
end
obj.OnStart(onStartMethod);
```
##### W[β](#w "Direct link to W")
float **W** `get` `set`
*W axis*
* Lua
```lua
newQuat = Quaternion.New(0.0, 1.0, 0.0, 0.0)
newQuat.W = 40.0
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local originalRot = obj.LocalRotation;
obj.SubscribeToEvents();
local onStartMethod = function()
Space.Log(originalRot.w);
-- prints the W component of this object as a float
originalRot.w = 0.25;
-- assigns 0.25 value to the W component
obj.LocalRotation = originalRot;
-- sets the the new rotation
end
obj.OnStart(onStartMethod);
```
##### EulerAngles[β](#eulerangles "Direct link to EulerAngles")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **EulerAngles** `get`
*Returns the Euler rotation for this Quaternion*
* Lua
```lua
newQuat = Quaternion.New(0.0, 0.707, 0.0, 0.707)
euler = newQuat.EulerAngles
```
##### Inverse[β](#inverse "Direct link to Inverse")
SQuaternion **Inverse** `get`
*Returns the inverse of this quaternion*
* Lua
```lua
quat = Quaternion.New(0.0, 0.707, 0.0, 0.707)
inverseQuat = quat.Inverse
```
##### Identity[β](#identity "Direct link to Identity")
static SQuaternion **Identity** `get`
*Equivalent of new SQuaternion(0,0,0,1)*
* Lua
```lua
identity = Quaternion.Identity
```
---
### SRay
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------ |
| SVector [**Origin** ](/scripting/client-scripting-api-reference/types/sray.md#origin)`get` |
| SVector [**Direction** ](/scripting/client-scripting-api-reference/types/sray.md#direction)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Origin[β](#origin "Direct link to Origin")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Origin** `get`
*The origin point of the ray.*
* Lua
```lua
ray=Space.Camera.ScreenCoordinatesToRay(Vector.New(0.5,0.5,0))
rayOrigin = ray.Origin
```
* Lua
```lua
--this script will make this object jump to wherever you right click
--(Example: moving objects with right click )
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseDown(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### Direction[β](#direction "Direct link to Direction")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Direction** `get`
*The direction of the ray.*
* Lua
```lua
ray=Space.Camera.ScreenCoordinatesToRay(Vector.New(0.5,0.5,0))
rayDirection = ray.Direction
```
* Lua
```lua
--this script will make this object jump to wherever you right click
--(Example: moving objects with right click )
thisGameObject = Space.Host.ExecutingObject
OnUpdate = function()
if Space.Input.GetMouseDown(1) then
clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition)
rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0)
thisGameObject.WorldPosition = rayCastHit.Position
end
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
---
### SRect
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ---------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Contains** ](srect#contains)(SVector point) bool [**Contains** ](srect#contains)(SVector point, bool allowInverse) |
| bool [**Overlaps** ](srect#overlaps)(SRect other) bool [**Overlaps** ](srect#overlaps)(SRect other, bool allowInverse) |
| bool [**Equals** ](/scripting/client-scripting-api-reference/types/srect.md#equals)(SRect other) |
| string [**ToString** ](srect#tostring)(string format) string [**ToString** ](srect#tostring)() |
| |
| **Static Functions** |
| static SRect [**New** ](/scripting/client-scripting-api-reference/types/srect.md#new)(float x, float y, float width, float height) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------- |
| float [**X**](/scripting/client-scripting-api-reference/types/srect.md#x) `get` `set` |
| float [**Y**](/scripting/client-scripting-api-reference/types/srect.md#y) `get` `set` |
| float [**Width**](/scripting/client-scripting-api-reference/types/srect.md#width) `get` `set` |
| float [**Height** ](/scripting/client-scripting-api-reference/types/srect.md#height)`get` `set` |
| SVector [**Position** ](/scripting/client-scripting-api-reference/types/srect.md#position)`get` |
| SVector [**Center** ](/scripting/client-scripting-api-reference/types/srect.md#center)`get` |
| SVector [**Min** ](/scripting/client-scripting-api-reference/types/srect.md#min)`get` |
| SVector [**Max** ](/scripting/client-scripting-api-reference/types/srect.md#max)`get` |
| SVector [**Size** ](/scripting/client-scripting-api-reference/types/srect.md#size)`get` |
| float [**XMin** ](/scripting/client-scripting-api-reference/types/srect.md#xmin)`get` |
| float [**YMin** ](/scripting/client-scripting-api-reference/types/srect.md#ymin)`get` |
| float [**XMax** ](/scripting/client-scripting-api-reference/types/srect.md#xmax)`get` |
| float [**YMax** ](/scripting/client-scripting-api-reference/types/srect.md#ymax)`get` |
| float [**Left** ](/scripting/client-scripting-api-reference/types/srect.md#left)`get` |
| float [**Right** ](/scripting/client-scripting-api-reference/types/srect.md#right)`get` |
| float [**Top** ](/scripting/client-scripting-api-reference/types/srect.md#top)`get` |
| float [**Bottom** ](/scripting/client-scripting-api-reference/types/srect.md#bottom)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Contains[β](#contains "Direct link to Contains")
bool **Contains** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) point) bool **Contains** ([SVector](/scripting/client-scripting-api-reference/types/svector.md) point, bool allowInverse)
*Returns true if the x and y components of point is a point inside this rectangle. If allowInverse is present and true, the width and height of the Rect are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
isContains = newRect.Contains(otherRect)
--or
isContains = newRect.Contains(otherRect , true)
```
##### Overlaps[β](#overlaps "Direct link to Overlaps")
bool **Overlaps** (SRect other) bool **Overlaps** (SRect other, bool allowInverse)
*Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
isOverlapping = newRect.Overlaps(otherRect)
--or
isOverlapping = newRect.Overlaps(otherRect , true)
```
##### Equals[β](#equals "Direct link to Equals")
bool **Equals** (SRect other)
Returns true if the rectangles are the same.
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
```
##### ToString[β](#tostring "Direct link to ToString")
string **ToString** (string format) string **ToString** ()
Returns string for this Rect.
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newRect=Rect.New(0,0,150,150)
otherRect = Rect.New(0,0,150,150)
AreEqual = newRect.Equals(otherRect)
```
##### New[β](#new "Direct link to New")
static SRect **New** (float x, float y, float width, float height)
*Constructs a new SRect*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newRect=Rect.New(0,0,150,150)
```
#### Properties[β](#properties "Direct link to Properties")
##### X[β](#x "Direct link to X")
float **X** `get` `set`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
newRect.X = 10.0
```
##### Y[β](#y "Direct link to Y")
float **Y** `get` `set`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
newRect.Y = 10.0
```
##### Width[β](#width "Direct link to Width")
float **Width** `get` `set`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
newRect.Width = 10.0
```
##### Height[β](#height "Direct link to Height")
float **Height** `get` `set`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
newRect.Height = 10.0
```
##### Position[β](#position "Direct link to Position")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Position** `get`
*The X and Y position of the rectangle.*
* Lua
```lua
newRect=Rect.New(50,50,150,150)
positionVector = newRect.position
```
##### Center[β](#center "Direct link to Center")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Center** `get`
*The position of the center of the rectangle.*
* Lua
```lua
newRect = Rect.New(50,50,150,150)
VectorCenter = newRect.Center
```
##### Min[β](#min "Direct link to Min")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Min** `get`
*The position of the minimum corner of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
vectorMin = newRect.Min
```
##### Max[β](#max "Direct link to Max")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Max** `get`
*The position of the maximum corner of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
vectorMax = newRect.Max
```
##### Size[β](#size "Direct link to Size")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **Size** `get`
*The width and height of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
vectorSize = newRect.Size
```
##### XMin[β](#xmin "Direct link to XMin")
float **XMin** `get`
*The minimum X coordinate of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatXMin = newRect.XMin
```
##### YMin[β](#ymin "Direct link to YMin")
float **YMin** `get`
*The minimum Y coordinate of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatYMin = newRect.YMin
```
##### XMax[β](#xmax "Direct link to XMax")
float **XMax** `get`
*The maximum Y coordinate of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatXMax = newRect.XMax
```
##### YMax[β](#ymax "Direct link to YMax")
float **YMax** `get`
*The maximum Y coordinate of the rectangle.*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatYMax = newRect.YMax
```
##### Left[β](#left "Direct link to Left")
float **Left** `get`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatLeft = newRect.Left
```
##### Right[β](#right "Direct link to Right")
float **Right** `get`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatRight = newRect.Right
```
##### Top[β](#top "Direct link to Top")
float **Top** `get`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatTop = newRect.Top
```
##### Bottom[β](#bottom "Direct link to Bottom")
float **Bottom** `get`
*Property Description*
* Lua
```lua
newRect=Rect.New(0,0,150,150)
floatBottom = newRect.Bottom
```
---
### SResource
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| --------------------------------------------------------------------------------------------------------------- |
| string [**Name** ](/scripting/client-scripting-api-reference/types/sresource.md#name)`get` |
| string [**Type** ](/scripting/client-scripting-api-reference/types/sresource.md#type)`get` |
| string [**AsText** ](/scripting/client-scripting-api-reference/types/sresource.md#astext)`get` |
| SGameObject [**AsGameObject** ](/scripting/client-scripting-api-reference/types/sresource.md#asgameobject)`get` |
| SMaterial [**AsMaterial** ](/scripting/client-scripting-api-reference/types/sresource.md#asmaterial)`get` |
| float [**TextureWidth** ](/scripting/client-scripting-api-reference/types/sresource.md#texturewidth)`get` |
| float [**TextureHeight** ](/scripting/client-scripting-api-reference/types/sresource.md#textureheight)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Returns the name of the resource as entered in the scripting runtime*
* Lua
```lua
ResourceName = Space.Resources[1].Name
```
* Lua
```lua
--the below script will search through the Scripting Runtime's resources
--and return the first instance of an Animation Clip
--[You need to add a few resources to the scripting runtime and make one of them an animation]
resources = Space.Resources
for i = 1, #resources do
if resources[i].Type == "AnimationClip" then
Space.Log("Resource #".. i .. " is an Animation Clip. The resource name is: " .. resources[i].Name)
break
end
end
```
##### Type[β](#type "Direct link to Type")
string **Type** `get`
*Returns the type of the resource as a string*
* Lua
```lua
ResourceType = Space.GetResource("Resource Name").Type
```
* Lua
```lua
--the below script will search through the Scripting Runtime's resources
--and return the first instance of an Animation Clip
--[You need to add a few resources to the scripting runtime and make one of them an animation]
resources = Space.Resources
for i = 1, #resources do
if resources[i].Type == "AnimationClip" then
Space.Log("Resource #".. i .. " is an Animation Clip. The resource name is: " .. resources[i].Name)
break
end
end
```
##### AsText[β](#astext "Direct link to AsText")
string **AsText** `get`
*Converts the resource's type from SResource type to string*
* Lua
```lua
Text = Space.GetResource("Resource Name").AsText
```
##### AsGameObject[β](#asgameobject "Direct link to AsGameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **AsGameObject** `get`
*Property Description*
* Lua
```lua
GameObject = Space.GetResource("Resource Name").AsGameObject
```
##### AsMaterial[β](#asmaterial "Direct link to AsMaterial")
[SMaterial](/scripting/client-scripting-api-reference/types/smaterial.md) **AsMaterial** `get`
*Converts the resource's type from SResource to SMaterial*
* Lua
```lua
Material = Space.GetResource("Resource Name").AsMaterial
```
##### TextureWidth[β](#texturewidth "Direct link to TextureWidth")
float **TextureWidth** `get`
*Returns the Texture Width of this resource*
* Lua
```lua
TextureWidth = Space.GetResource("Resource Name").TextureWidth
```
##### TextureHeight[β](#textureheight "Direct link to TextureHeight")
float **TextureHeight** `get`
*Returns the Texture Height of this resource*
* Lua
```lua
TextureHeight = Space.GetResource("Resource Name").TextureHeight
```
---
### SScore
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------- |
| int [**Rank** ](/scripting/client-scripting-api-reference/types/sscore.md#rank)`get` |
| long [**Score** ](/scripting/client-scripting-api-reference/types/sscore.md#score)`get` |
| string [**Username** ](/scripting/client-scripting-api-reference/types/sscore.md#username)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Rank[β](#rank "Direct link to Rank")
int **Rank** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Score[β](#score "Direct link to Score")
long **Score** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Username[β](#username "Direct link to Username")
string **Username** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SScoreRank
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------------------------------------------------------------------------------------------------------- |
| int [**Level** ](/scripting/client-scripting-api-reference/types/sscorerank.md#level)`get` |
| SScore\[] [**AllTimeLeaderboard** ](/scripting/client-scripting-api-reference/types/sscorerank.md#alltimeleaderboard)`get` |
| SScore\[] [**DailyLeaderboard** ](/scripting/client-scripting-api-reference/types/sscorerank.md#dailyleaderboard)`get` |
| SScore [**AllTimePlayerRecord** ](/scripting/client-scripting-api-reference/types/sscorerank.md#alltimeplayerrecord)`get` |
| SScore [**DailyPlayerRecord** ](/scripting/client-scripting-api-reference/types/sscorerank.md#dailyplayerrecord)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Level[β](#level "Direct link to Level")
int **Level** `get`
*The level of current activity.*
* Lua
```lua
Space.Activity.FinishActivity(99956,100,0,function (rank)
Space.Log(rank.Level)
end)
```
##### AllTimeLeaderboard[β](#alltimeleaderboard "Direct link to AllTimeLeaderboard")
SScore\[] **AllTimeLeaderboard** `get`
*The AllTimeLeaderboard of current activity.*
* Lua
```lua
Space.Activity.FinishActivity(99956,100,0,function (rank)
local leaderBoard=rank.AllTimeLeaderboard
for i=1,#leaderBoard do
Space.Log(leaderBoard[i].Rank)
Space.Log(leaderBoard[i].Score)
Space.Log(leaderBoard[i].Username)
end
end)
```
##### DailyLeaderboard[β](#dailyleaderboard "Direct link to DailyLeaderboard")
SScore\[] **DailyLeaderboard** `get`
*The daily Leaderboard of current activity.*
* Lua
```lua
Space.Activity.FinishActivity(99956,100,0,function (rank)
local leaderBoard=rank.DailyLeaderboard
for i=1,#leaderBoard do
Space.Log(leaderBoard[i].Rank)
Space.Log(leaderBoard[i].Score)
Space.Log(leaderBoard[i].Username)
end
end)
```
##### AllTimePlayerRecord[β](#alltimeplayerrecord "Direct link to AllTimePlayerRecord")
SScore **AllTimePlayerRecord** `get`
*The AllTimePlayerRecord of current activity.*
* Lua
```lua
Space.Activity.FinishActivity(99956,100,0,function (rank)
local record=rank.AllTimePlayerRecord
Space.Log(record.Rank)
Space.Log(record.Score)
Space.Log(record.Username)
end)
```
##### DailyPlayerRecord[β](#dailyplayerrecord "Direct link to DailyPlayerRecord")
SScore **DailyPlayerRecord** `get`
*The daily player records of current activity.*
* Lua
```lua
Space.Activity.FinishActivity(99956,100,0,function (rank)
local record=rank.DailyPlayerRecord
Space.Log(record.Rank)
Space.Log(record.Score)
Space.Log(record.Username)
end)
```
---
### SSocialMedia
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| --------------------------------------------------------------------------------------------------- |
| string [**Type** ](/scripting/client-scripting-api-reference/types/ssocialmedia.md#type)`get` |
| string [**MediaID** ](/scripting/client-scripting-api-reference/types/ssocialmedia.md#mediaid)`get` |
| string [**Url** ](/scripting/client-scripting-api-reference/types/ssocialmedia.md#url)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Type[β](#type "Direct link to Type")
string **Type** `get`
*Property Description*
* Lua
```lua
tableOfSSocialMedia = Space.Profile.ActivePlayerProfile.SocialMediaProfiles
profileType = tableOfSSocialMedia[1].Type
```
##### MediaID[β](#mediaid "Direct link to MediaID")
string **MediaID** `get`
*Property Description*
* Lua
```lua
tableOfSSocialMedia = Space.Profile.ActivePlayerProfile.SocialMediaProfiles
profileID = tableOfSSocialMedia[1].MediaID
```
##### Url[β](#url "Direct link to Url")
string **Url** `get`
*Property Description*
* Lua
```lua
tableOfSSocialMedia = Space.Profile.ActivePlayerProfile.SocialMediaProfiles
profileType = tableOfSSocialMedia[1].Url
```
---
### SString
#### Index[β](#index "Direct link to Index")
##### Static Functions Index[β](#static-functions-index "Direct link to Static Functions Index")
| Function Name |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| static string [**MD5** ](/scripting/client-scripting-api-reference/types/sstring.md#md5)(string input) |
| static string [**SHA1** ](/scripting/client-scripting-api-reference/types/sstring.md#sha1)(string input) |
| static string [**Replace** ](/scripting/client-scripting-api-reference/types/sstring.md#replace)(string old, string pattern, string replace) |
| static string [**GenerateGUID** ](/scripting/client-scripting-api-reference/types/sstring.md#generateguid)() |
| static string [**Base64Encode** ](sstring#base64encode)(string input) static string [**Base64Encode** ](sstring#base64encode)(byte\[] input) |
| static string [**Base64Decode** ](/scripting/client-scripting-api-reference/types/sstring.md#base64decode)(string input) |
| static byte\[] [**GetBytes** ](/scripting/client-scripting-api-reference/types/sstring.md#getbytes)(string input) |
| static string [**GetString** ](/scripting/client-scripting-api-reference/types/sstring.md#getstring)(byte\[] bytes) |
| static string [**EncodeURL** ](/scripting/client-scripting-api-reference/types/sstring.md#encodeurl)(string input) |
| static string [**DecodeURL** ](/scripting/client-scripting-api-reference/types/sstring.md#decodeurl)(string input) |
| static string [**RegexMatchResult** ](/scripting/client-scripting-api-reference/types/sstring.md#regexmatchresult)(string input, string pattern, string replacement) |
#### Static Functions[β](#static-functions "Direct link to Static Functions")
##### MD5[β](#md5 "Direct link to MD5")
static string **MD5** (string input)
*Calculates the MD5Sum of input and returns the result as a hexadecimal string*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
md5 = Space.String.MD5('AString')
```
##### SHA1[β](#sha1 "Direct link to SHA1")
static string **SHA1** (string input)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
sha1 = Space.String.SHA1('AString')
```
##### Replace[β](#replace "Direct link to Replace")
static string **Replace** (string old, string pattern, string replace)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
replaced = Space.String.Replace('AString', 'APattern', 'AReplace')
```
##### GenerateGUID[β](#generateguid "Direct link to GenerateGUID")
static string **GenerateGUID** ()
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
guid = Space.String.GenerateGUID()
```
##### Base64Encode[β](#base64encode "Direct link to Base64Encode")
static string **Base64Encode** (string input)
*Converts input to Base64 and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
baseEncodeByte = Space.String.Base64Encode{117, 116, 32, 116, 100, 101})
```
##### Base64Decode[β](#base64decode "Direct link to Base64Decode")
static string **Base64Decode** (string input)
*Converts input from Base64 and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
baseDecodedStr = Space.String.Base64Decode('aW5wdXQgdG8gZW5jb2Rl')
```
##### GetBytes[β](#getbytes "Direct link to GetBytes")
static byte\[] **GetBytes** (string input)
*Converts input to bytes using UTF8 encoding*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
stringAsByteArray = Space.String.GetBytes('A String')
```
##### GetString[β](#getstring "Direct link to GetString")
static string **GetString** (byte\[] bytes)
*Converts input to a UTF8 string*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
ByteArrayAsString = Space.String.GetString({115, 111, 109, 101, 32})
```
##### EncodeURL[β](#encodeurl "Direct link to EncodeURL")
static string **EncodeURL** (string input)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
encodedURL = Space.String.EncodeURL('A String')
```
##### DecodeURL[β](#decodeurl "Direct link to DecodeURL")
static string **DecodeURL** (string input)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
decodedURL = Space.String.DecodeURL('A String')
```
##### RegexMatchResult[β](#regexmatchresult "Direct link to RegexMatchResult")
static string **RegexMatchResult** (string input, string pattern, string replacement)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Math.RegexMatchResult('astring', 'astring','astring')
```
---
### SSubRegion
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| --------------------------------------------------------------------------------------------------------------- |
| int [**RegionID** ](/scripting/client-scripting-api-reference/types/ssubregion.md#regionid)`get` |
| int [**Count** ](/scripting/client-scripting-api-reference/types/ssubregion.md#count)`get` |
| string [**ServerLocation** ](/scripting/client-scripting-api-reference/types/ssubregion.md#serverlocation)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### RegionID[β](#regionid "Direct link to RegionID")
int **RegionID** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Count[β](#count "Direct link to Count")
int **Count** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### ServerLocation[β](#serverlocation "Direct link to ServerLocation")
string **ServerLocation** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### STrackInfo
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------- |
| string [**Title** ](/scripting/client-scripting-api-reference/types/strackinfo.md#title)`get` |
| string [**Artist** ](/scripting/client-scripting-api-reference/types/strackinfo.md#artist)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### Title[β](#title "Direct link to Title")
string **Title** `get`
*Title of the track*
* Lua
```lua
otc = function(trackInfo)
Space.Log(trackInfo.Title)
end
Space.Host.ExecutingObject.Radio.OnTrackChange(otc)
```
##### Artist[β](#artist "Direct link to Artist")
string **Artist** `get`
*Artist of the track*
* Lua
```lua
otc = function(trackInfo)
Space.Log(trackInfo.Artist)
end
Space.Host.ExecutingObject.Radio.OnTrackChange(otc)
```
---
### STuneIn
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------------ |
| string [**Base** ](/scripting/client-scripting-api-reference/types/stunein.md#base)`get` `set` |
| string [**Basem3u** ](/scripting/client-scripting-api-reference/types/stunein.md#basem3u)`get` `set` |
| string [**Basexspf** ](/scripting/client-scripting-api-reference/types/stunein.md#basexspf)`get` `set` |
#### Properties[β](#properties "Direct link to Properties")
##### Base[β](#base "Direct link to Base")
string **Base** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Basem3u[β](#basem3u "Direct link to Basem3u")
string **Basem3u** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Basexspf[β](#basexspf "Direct link to Basexspf")
string **Basexspf** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SUIRaycastResult
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ------------------------------------------------------------------------------------------------------ |
| void [**Clear** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#clear)() |
| string [**ToString** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#tostring)() |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ---------------------------------------------------------------------------------------------------------------------- |
| float [**Distance** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#distance)`get` |
| float [**Index** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#index)`get` |
| int [**Depth** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#depth)`get` |
| int [**SortingLayer** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#sortinglayer)`get` |
| int [**SortingOrder** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#sortingorder)`get` |
| SVector [**WorldPosition** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#worldposition)`get` |
| SVector [**WorldNormal** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#worldnormal)`get` |
| SVector [**ScreenPosition** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#screenposition)`get` |
| SGameObject [**GameObject** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#gameobject)`get` |
| bool [**IsValid** ](/scripting/client-scripting-api-reference/types/suiraycastresult.md#isvalid)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Clear[β](#clear "Direct link to Clear")
void **Clear** ()
*Reset all the parameters of this RaycastResult*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Result = Space.UI.Raycast()
Result.Clear()
```
##### ToString[β](#tostring "Direct link to ToString")
string **ToString** ()
*Converts all the properties of this UIRaycastResult into a string*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Result = Space.UI.Raycast().ToString()
```
* Lua
```lua
--This script will update a UIText element with the result of a UIRaycast whenever...
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.ToString()
end
end
end
thisObject.OnUpdate(OnUpdate)
```
#### Properties[β](#properties "Direct link to Properties")
##### Distance[β](#distance "Direct link to Distance")
float **Distance** `get`
*Returns the distance of the Raycast result*
* Lua
```lua
Result = Distance = Space.UI.Raycast().Distance
```
* Lua
```lua
--This script will update a UIText element with the Distance of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.Distance
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### Index[β](#index-1 "Direct link to Index")
float **Index** `get`
*Returns the Index of the Raycast result*
* Lua
```lua
Index= Space.UI.Raycast().Index
```
* Lua
```lua
--This script will update a UIText element with the Index of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.Index
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### Depth[β](#depth "Direct link to Depth")
int **Depth** `get`
*Returns the Depth of the Raycast result*
* Lua
```lua
Depth= Space.UI.Raycast().Depth
```
* Lua
```lua
--This script will update a UIText element with the Depth of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.Depth
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### SortingLayer[β](#sortinglayer "Direct link to SortingLayer")
int **SortingLayer** `get`
*Returns the Sorting Layer of the Raycast result*
* Lua
```lua
SortingLayer= Space.UI.Raycast().SortingLayer
```
* Lua
```lua
--This script will update a UIText element with the Sorting Layer of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.SortingLayer
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### SortingOrder[β](#sortingorder "Direct link to SortingOrder")
int **SortingOrder** `get`
*Returns the Sorting Order of the Raycast result*
* Lua
```lua
SortingOrder= Space.UI.Raycast().SortingOrder
```
* Lua
```lua
--This script will update a UIText element with the Sorting Order of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.SortingOrder
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### WorldPosition[β](#worldposition "Direct link to WorldPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **WorldPosition** `get`
*Returns the World Position vector of the Raycast result*
* Lua
```lua
WorldPosition= Space.UI.Raycast().WorldPosition
```
* Lua
```lua
--This script will update a UIText element with the World Position of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.WorldPosition
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### WorldNormal[β](#worldnormal "Direct link to WorldNormal")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **WorldNormal** `get`
*Returns the World Normal vector of the Raycast result*
* Lua
```lua
WorldNormal= Space.UI.Raycast().WorldNormal
```
* Lua
```lua
--This script will update a UIText element with the World Normal of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.WorldNormal
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### ScreenPosition[β](#screenposition "Direct link to ScreenPosition")
[SVector](/scripting/client-scripting-api-reference/types/svector.md) **ScreenPosition** `get`
*Returns the Screen Position vector of the Raycast result*
* Lua
```lua
ScreenPosition= Space.UI.Raycast().ScreenPosition
```
* Lua
```lua
--This script will update a UIText element with the Screen Position of the UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.ScreenPosition
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### GameObject[β](#gameobject "Direct link to GameObject")
[SGameObject](/scripting/client-scripting-api-reference/types/sgameobject.md) **GameObject** `get`
*Returns a reference to the GameObject of the Raycast result*
* Lua
```lua
GameObject= Space.UI.Raycast().GameObject
```
* Lua
```lua
--This script will update a UIText element with the name of the UIRaycast
--by accesing it's GameObject whenever the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.GameObject.Name
end
end
end
thisObject.OnUpdate(OnUpdate)
```
##### IsValid[β](#isvalid "Direct link to IsValid")
bool **IsValid** `get`
*Returns whether the Raycast hit a valid UI Raycast target. This will be true if the Raycast hits an element on Sinespace's UI*
* Lua
```lua
IsValid= Space.UI.Raycast().IsValid
```
* Lua
```lua
--This script will check if Raycast result is valid
--and update a UIText element with the result of a UIRaycast whenever
--the player clicks on a Sinespace UI element
thisObject = Space.Host.ExecutingObject
uiText = Space.Host.GetReference("text").UIText --Add this object with UIText component as reference in Scripting Runtime
OnUpdate = function()
if Space.Input.GetMouseDown(0) == true then
result = Space.UI.Raycast()
if result.IsValid then
uiText = result.ToString()
end
end
end
thisObject.OnUpdate(OnUpdate)
```
---
### SUserProfile
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ------------------------------------------------------------------------------------------------------------------------------------ |
| string [**UserName** ](/scripting/client-scripting-api-reference/types/suserprofile.md#username)`get` |
| string [**Title** ](/scripting/client-scripting-api-reference/types/suserprofile.md#title)`get` |
| string [**RealName** ](/scripting/client-scripting-api-reference/types/suserprofile.md#realname)`get` |
| string [**Gender** ](/scripting/client-scripting-api-reference/types/suserprofile.md#gender)`get` |
| string [**Since** ](/scripting/client-scripting-api-reference/types/suserprofile.md#since)`get` |
| string [**Country** ](/scripting/client-scripting-api-reference/types/suserprofile.md#country)`get` |
| string [**City** ](/scripting/client-scripting-api-reference/types/suserprofile.md#city)`get` |
| int [**SocialGold** ](/scripting/client-scripting-api-reference/types/suserprofile.md#socialgold)`get` |
| int [**SocialSilver** ](/scripting/client-scripting-api-reference/types/suserprofile.md#socialsilver)`get` |
| int [**SocialFlower** ](/scripting/client-scripting-api-reference/types/suserprofile.md#socialflower)`get` |
| string [**Interests** ](/scripting/client-scripting-api-reference/types/suserprofile.md#interests)`get` |
| string [**About** ](/scripting/client-scripting-api-reference/types/suserprofile.md#about)`get` |
| SSocialMedia\[] [**SocialMediaProfiles** ](/scripting/client-scripting-api-reference/types/suserprofile.md#socialmediaprofiles)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### UserName[β](#username "Direct link to UserName")
string **UserName** `get`
*Get player profile's Username*
* Lua
```lua
userName = Space.Profile.ActivePlayerProfile.Username
```
##### Title[β](#title "Direct link to Title")
string **Title** `get`
*Get player profile's Title*
* Lua
```lua
userTitle = Space.Profile.ActivePlayerProfile.Title
```
##### RealName[β](#realname "Direct link to RealName")
string **RealName** `get`
*Get player profile's Real Name*
* Lua
```lua
userRealName = Space.Profile.ActivePlayerProfile.RealName
```
##### Gender[β](#gender "Direct link to Gender")
string **Gender** `get`
*Get player profile's Gender*
* Lua
```lua
userGender = Space.Profile.ActivePlayerProfile.Gender
```
##### Since[β](#since "Direct link to Since")
string **Since** `get`
*Get player profile's Since*
* Lua
```lua
userSince = Space.Profile.ActivePlayerProfile.Since
```
##### Country[β](#country "Direct link to Country")
string **Country** `get`
*Get player profile's Country*
* Lua
```lua
userCountry = Space.Profile.ActivePlayerProfile.Country
```
##### City[β](#city "Direct link to City")
string **City** `get`
*Get player profile's City*
* Lua
```lua
userCity = Space.Profile.ActivePlayerProfile.City
```
##### SocialGold[β](#socialgold "Direct link to SocialGold")
int **SocialGold** `get`
*Get player profile's Gold Badge count*
* Lua
```lua
userSocialGold = Space.Profile.ActivePlayerProfile.SocialGold
```
##### SocialSilver[β](#socialsilver "Direct link to SocialSilver")
int **SocialSilver** `get`
*Get player profile's Silver Badge count*
* Lua
```lua
userSocialSilver = Space.Profile.ActivePlayerProfile.SocialSilver
```
##### SocialFlower[β](#socialflower "Direct link to SocialFlower")
int **SocialFlower** `get`
*Get player profile's Flower count*
* Lua
```lua
userSocialFlower = Space.Profile.ActivePlayerProfile.SocialFlower
```
##### Interests[β](#interests "Direct link to Interests")
string **Interests** `get`
*Get player profile's Interests*
* Lua
```lua
userInterests = Space.Profile.ActivePlayerProfile.Interests
```
##### About[β](#about "Direct link to About")
string **About** `get`
*Get player profile's About*
* Lua
```lua
userAbout = Space.Profile.ActivePlayerProfile.About
```
##### SocialMediaProfiles[β](#socialmediaprofiles "Direct link to SocialMediaProfiles")
[SSocialMedia](/scripting/client-scripting-api-reference/types/ssocialmedia.md)\[] **SocialMediaProfiles** `get`
*Get player profile's Social Media Profiles*
* Lua
```lua
tableOfSSocialMedia = Space.Profile.ActivePlayerProfile.SocialMediaProfiles
```
---
### SUserRegions
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------------------------------------- |
| int [**SubscriptionTier** ](/scripting/client-scripting-api-reference/types/suserregions.md#subscriptiontier)`get` |
| int [**NumberOfRegions** ](/scripting/client-scripting-api-reference/types/suserregions.md#numberofregions)`get` |
| int [**UsersPerRegion** ](/scripting/client-scripting-api-reference/types/suserregions.md#usersperregion)`get` |
| int [**FileSize** ](/scripting/client-scripting-api-reference/types/suserregions.md#filesize)`get` |
| string [**SubscriptionName** ](/scripting/client-scripting-api-reference/types/suserregions.md#subscriptionname)`get` |
| SPublicRegion\[] [**AvailableRegions** ](/scripting/client-scripting-api-reference/types/suserregions.md#availableregions)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### SubscriptionTier[β](#subscriptiontier "Direct link to SubscriptionTier")
int **SubscriptionTier** `get`
*The subscription tier indicates which type of premium memberhsip the player has. (As found in "Region" window)*
* Lua
```lua
--Make's a UIText show this User's Regions' current Subscription Tier
textObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting Runtime
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.SubscriptionTier
text.UIText.Text = r
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### NumberOfRegions[β](#numberofregions "Direct link to NumberOfRegions")
int **NumberOfRegions** `get`
*The number of regions the player has. (As found in "Region" window)*
* Lua
```lua
--Make's a UIText show this User's Regions' current NumberOfRegions
textObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting Runtime
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.NumberOfRegions
text.UIText.Text = r
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### UsersPerRegion[β](#usersperregion "Direct link to UsersPerRegion")
int **UsersPerRegion** `get`
*The max number of users allowed per region. ("Concurrency" as found in "Region" window).*
* Lua
```lua
--Make's a UIText show this User's Regions' current UsersPerRegion
textObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting Runtime
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.UsersPerRegion
text.UIText.Text = r
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### FileSize[β](#filesize "Direct link to FileSize")
int **FileSize** `get`
*The maximum MB size the player's regions can be. ("Max Region SizE" in the "Region" window)*
* Lua
```lua
--Make's a UIText show this User's Regions' current FileSize
textObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting Runtime
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.FileSize
text.UIText.Text = r
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### SubscriptionName[β](#subscriptionname "Direct link to SubscriptionName")
string **SubscriptionName** `get`
*The name of the current player's premium subscription (as found in "Region" window)*
* Lua
```lua
--Make's a UIText show this User's Regions' current SubscriptionName
textObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting Runtime
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.SubscriptionName
text.UIText.Text = r
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
##### AvailableRegions[β](#availableregions "Direct link to AvailableRegions")
[SPublicRegion](/scripting/client-scripting-api-reference/types/spublicregion.md)\[] **AvailableRegions** `get`
*Returns an array of SPublicRegion which is a group of data for each of the user's available regions.*
* Lua
```lua
--Make's a UIText show the Name of the user's first available region
textObject = Space.Host.GetReference("TheTextReference")
function GetUserRegionsComplete(SUserRegions)
local r = SUserRegions.AvailableRegions[1]
textObject.UIText.Text = r.Name
end
Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
```
---
### SVector
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SVector [**Add** ](svector#add)(SVector other) SVector [**Add** ](svector#add)(float other) |
| SVector [**Scale** ](svector#scale)(SVector other) SVector [**Scale** ](svector#scale)(float other) |
| SVector [**Divide** ](svector#divide)(SVector other) SVector [**Divide** ](svector#divide)(float other) |
| float [**Distance** ](/scripting/client-scripting-api-reference/types/svector.md#distance)(SVector other) |
| float [**SquareDistance** ](/scripting/client-scripting-api-reference/types/svector.md#squaredistance)(SVector other) |
| bool [**InRange** ](/scripting/client-scripting-api-reference/types/svector.md#inrange)(SVector other, float range) |
| SVector [**Cross** ](/scripting/client-scripting-api-reference/types/svector.md#cross)(SVector other) |
| SVector [**Lerp** ](/scripting/client-scripting-api-reference/types/svector.md#lerp)(SVector other, float t) |
| SVector [**Slerp** ](/scripting/client-scripting-api-reference/types/svector.md#slerp)(SVector other, float t) |
| SVector [**MoveTowards** ](/scripting/client-scripting-api-reference/types/svector.md#movetowards)(SVector other, float maxDistance) |
| float [**Dot** ](/scripting/client-scripting-api-reference/types/svector.md#dot)(SVector other) |
| bool [**Equals** ](/scripting/client-scripting-api-reference/types/svector.md#equals)(SVector other) |
| string [**ToString** ](/scripting/client-scripting-api-reference/types/svector.md#tostring)() |
| |
| **Static Functions** |
| static SVector [**New** ](/scripting/client-scripting-api-reference/types/svector.md#new)(float x, float y, float z) |
| static SVector [**operator**](svector#operator+)**+** (SVector a, SVector b) static SVector [**operator**](svector#operator+)**+** (SVector a, float b) |
| static SVector [**operator**](svector#operator)**-** (SVector a, SVector b) static SVector [**operator**](svector#operator)**-** (SVector a, float b) |
| static SVector [**operator**](svector#operator-1)\* (SVector a, SVector b) static SVector [**operator**](svector#operator-1)\* (SVector a, float b) |
| static SVector [**operator**](svector#operator-2)**/** (SVector a, SVector b) static SVector [**operator**](svector#operator-2)**/** (SVector a, float b) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------------------------------------------------------------------------------------- |
| float [**X**](/scripting/client-scripting-api-reference/types/svector.md#x) `get` `set` |
| float [**Y**](/scripting/client-scripting-api-reference/types/svector.md#y) `get` `set` |
| float [**Z**](/scripting/client-scripting-api-reference/types/svector.md#z) `get` `set` |
| float [**Magnitude** ](/scripting/client-scripting-api-reference/types/svector.md#magnitude)`get` |
| SVector [**Normalised** ](/scripting/client-scripting-api-reference/types/svector.md#normalised)`get` |
| |
| **Static Properties** |
| static SVector [**Up**](/scripting/client-scripting-api-reference/types/svector.md#up) `get` |
| static SVector [**Down** ](/scripting/client-scripting-api-reference/types/svector.md#down)`get` |
| static SVector [**Left** ](/scripting/client-scripting-api-reference/types/svector.md#left)`get` |
| static SVector [**Right** ](/scripting/client-scripting-api-reference/types/svector.md#right)`get` |
| static SVector [**Forward** ](/scripting/client-scripting-api-reference/types/svector.md#forward)`get` |
| static SVector [**Back** ](/scripting/client-scripting-api-reference/types/svector.md#back)`get` |
| static SVector [**Zero** ](/scripting/client-scripting-api-reference/types/svector.md#zero)`get` |
| static SVector [**One** ](/scripting/client-scripting-api-reference/types/svector.md#one)`get` |
| static SVector [**MaxValue** ](/scripting/client-scripting-api-reference/types/svector.md#maxvalue)`get` |
| static SVector [**MinValue** ](/scripting/client-scripting-api-reference/types/svector.md#minvalue)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### Add[β](#add "Direct link to Add")
SVector **Add** (SVector other) SVector **Add** (float other)
*Adds this Vector*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(0, 10, 0);
local vectorOther = Vector.New(40, 50, 6);
Space.Log(vector.Add(vectorOther));
-- prints [40, 60, 6]
Space.Log(vector + vectorOther);
-- prints [40, 60, 6]
```
* Lua
```lua
local vectorB = Vector.New(0, 10, 0);
Space.Log(vectorB.Add(5));
-- prints [5, 15, 5]
```
##### Scale[β](#scale "Direct link to Scale")
SVector **Scale** (SVector other) SVector **Scale** (float other)
*Multiplies this Vector*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(0, 10, 0);
local vectorOther = Vector.New(2, 5, 4);
Space.Log(vector.Scale(vectorOther));
-- prints [0, 50, 0]
Space.Log(vector * vectorOther);
-- prints [0, 50, 0]
```
* Lua
```lua
local vector = Vector.New(0, 10, 0);
Space.Log(vector.Scale(5));
-- prints [0, 50, 0]
Space.Log(vector * 5);
-- prints [0, 50, 0]
```
##### Divide[β](#divide "Direct link to Divide")
SVector **Divide** (SVector other) SVector **Divide** (float other)
*Divides this Vector*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(10, 10, 10);
local vectorOther = Vector.New(2, 2, 2);
Space.Log(vector.Divide(vectorOther));
-- prints [5, 5, 5]
Space.Log(vector / vectorOther);
-- prints [5, 5, 5]
```
* Lua
```lua
local vector = Vector.New(10, 10, 10);
Space.Log(vector.Divide(2));
-- prints [5, 5, 5]
Space.Log(vector / 2);
-- prints [5, 5, 5]
```
##### Distance[β](#distance "Direct link to Distance")
float **Distance** (SVector other)
*Returns the distance between this vector and other in meters*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(3, 3, 3.5);
local vectorOther = Vector.New(2, 2, 2);
Space.Log(vector.Distance(vectorOther));
-- prints 2.06155276298523
```
* Lua
```lua
--the below script will change the objects color to green if you are near the object
--and change color to red if you are far from the object
thisGameObject = Space.Host.ExecutingObject
function OnUpdate()
positionAvatar = Space.Scene.PlayerAvatar.GameObject.WorldPosition
positionObject = thisGameObject.WorldPosition
if positionAvatar.Distance(positionObject) < 5 then
thisGameObject.Renderer.Material.SetColor("_Color",0,1,0,1)
else
thisGameObject.Renderer.Material.SetColor("_Color",1,0,0,1)
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### SquareDistance[β](#squaredistance "Direct link to SquareDistance")
float **SquareDistance** (SVector other)
*Returns the square of the distance between this vector and other in meters, considerably faster than distance()*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(3, 3, 3.5);
local vectorOther = Vector.New(2, 2, 2);
Space.Log(vector.SquareDistance(vectorOther));
-- prints 4.25
```
* Lua
```lua
--the below script will change the objects color to green if you are near the object
--and change color to red if you are far from the object
thisGameObject = Space.Host.ExecutingObject
function OnUpdate()
positionAvatar = Space.Scene.PlayerAvatar.GameObject.WorldPosition
positionObject = thisGameObject.WorldPosition
if positionAvatar.SquareDistance(positionObject) < 25 then
thisGameObject.Renderer.Material.SetColor("_Color",0,1,0,1)
else
thisGameObject.Renderer.Material.SetColor("_Color",1,0,0,1)
end
end
thisGameObject.OnUpdate(OnUpdate)
```
##### InRange[β](#inrange "Direct link to InRange")
bool **InRange** (SVector other, float range)
*Returns if other is within range meters of this vector, inclusive*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(370, 30, 0);
local vectorOther = Vector.New(372, 30, 0);
Space.Log(vector.InRange(vectorOther, 2.0));
-- prints True
local vector2 = Vector.New(80, 30, 20);
local vectorOther2 = Vector.New(1, 15, 25);
Space.Log(vector2.InRange(vectorOther2, 1.0));
-- prints False
```
* Lua
```lua
--the below script will change the objects color to green if you are near the object
--and change color to red if you are far from the object
--(example: motion sensor lights)
thisGameObject = Space.Host.ExecutingObject
function OnUpdate()
positionAvatar = Space.Scene.PlayerAvatar.GameObject.WorldPosition
positionObject = thisGameObject.WorldPosition
if positionAvatar.InRange(positionObject, 5.0) then
thisGameObject.Renderer.Material.SetColor("_Color",0,1,0,1)
else
thisGameObject.Renderer.Material.SetColor("_Color",1,0,0,1)
end
end
thisGameObject.SubscribeToEvents()
thisGameObject.OnUpdate(OnUpdate)
```
##### Cross[β](#cross "Direct link to Cross")
SVector **Cross** (SVector other)
*Returns the cross product of this vector and other*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vector = Vector.New(0, 1, 0);
local vectorOther = Vector.New(1, 0, 0);
Space.Log(vector.Cross(vectorOther));
-- prints [0, 0, -1]
```
##### Lerp[β](#lerp "Direct link to Lerp")
SVector **Lerp** (SVector other, float t)
*Linear interpolates between this and other based on factor t (0-1)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
lerpVector = currentVector.Lerp(targetVector, 0.5)
```
* Lua
```lua
-- Lua Translation of Unity C# Documentation
--[["StartMarker" and "EndMaker" are game objects set up as endpoints.
These objects are attached to the script in the Object Reference section.
The name fields in that section should match these names for the example. --]]
local startMarker = Space.Host.GetReference("StartMarker");
local endMarker = Space.Host.GetReference("EndMarker");
local ball = Space.Host.ExecutingObject;
local speed = 1.0;
local startTime;
local journeyLength;
ball.SubscribeToEvents();
local onStartMethod = function()
startTime = Space.Time;
journeyLength = startMarker.LocalPosition.Distance(endMarker.LocalPosition);
end
-- This ball object will move from the start endpoint object to the end endpoint.
local moveBall = function()
local distCovered = (Space.Time - startTime) * speed;
local fracJourney = distCovered / journeyLength;
ball.LocalPosition = startMarker.LocalPosition.Lerp(endMarker.LocalPosition, fracJourney);
end
ball.OnStart(onStartMethod);
ball.OnUpdate(moveBall);
```
##### Slerp[β](#slerp "Direct link to Slerp")
SVector **Slerp** (SVector other, float t)
*Spherically linear interpolates between this and other based on factor t (0-1)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
slerpVector = currentVector.Slerp(targetVector, 0.5)
```
* Lua
```lua
-- Lua Translation of Unity C# Documentation
--[["Sunrise" and "Sunset" are game objects set up as endpoints.
These objects are attached to the script in the Object Reference section.
The name fields in that section should match these names for the example. --]]
local sunrise = Space.Host.GetReference("Sunrise");
local sunset = Space.Host.GetReference("Sunset");
local ball = Space.Host.ExecutingObject;
local startTime;
local journeyTime = 1.0;
ball.SubscribeToEvents();
local onStartMethod = function()
startTime = Space.Time;
end
-- This ball object will move from the start endpoint object to the end endpoint.
local moveBall = function()
local center = (sunrise.LocalPosition + sunset.LocalPosition) * 0.5;
center = center - Vector.Up;
local riseRelCenter = sunrise.LocalPosition - center;
local setRelCenter = sunset.LocalPosition - center;
local fracComplete = (Space.Time - startTime) / journeyTime;
ball.LocalPosition = riseRelCenter.Slerp(setRelCenter, fracComplete);
ball.LocalPosition = ball.LocalPosition + center;
end
ball.OnStart(onStartMethod);
ball.OnUpdate(moveBall);
```
##### MoveTowards[β](#movetowards "Direct link to MoveTowards")
SVector **MoveTowards** (SVector other, float maxDistance)
*Moves this vector closer to other by a maximum of maxDistance units*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newVector = currentVector.MoveTowards(targetVector)
```
* Lua
```lua
-- Lua Translation of Unity C# Documentation
--[["Target" is a game object set up as a target position.
This object is attached to the script in the Object Reference section.
The name field in that section should match this name for the example. --]]
local target = Space.Host.GetReference("Target");
local ball = Space.Host.ExecutingObject;
local speed = 1.0;Vecto
local onStartMethod = function()
startTime = Space.Time;
end
-- This ball object will move towards the target. Negative values for
-- the maxDistance parameter will push the ball away from the target.
local moveBall = function()
local step = speed * Space.DeltaTime;
ball.LocalPosition = ball.LocalPosition.MoveTowards(target.LocalPosition, step);
end
ball.OnStart(onStartMethod);
ball.OnUpdate(moveBall);
-- NOTE: If you use MoveTowards, the movement will not overshoot the target.
```
##### Dot[β](#dot "Direct link to Dot")
float **Dot** (SVector other)
*Returns the dot product between this and other (note - normalise your vectors first!*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local vectorA = Vector.New(0, 1, 0);
local vectorOtherA = Vector.New(1, 0, 0);
Space.Log(vectorA.Dot(vectorOtherA));
-- prints 0
local vectorB = Vector.New(0, 1, 0);
local vectorOtherB = Vector.New(0, 1, 0);
Space.Log(vectorB.Dot(vectorOtherB));
-- prints 1
local vectorC = Vector.New(0, 1, 0);
local vectorOtherC = Vector.New(0, -1, 0);
Space.Log(vectorC.Dot(vectorOtherC));
-- prints -1
```
##### Equals[β](#equals "Direct link to Equals")
bool **Equals** (SVector other)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
isEqual = Vector.Up.Equals( Vector.New(0,1,0) )
```
##### ToString[β](#tostring "Direct link to ToString")
string **ToString** ()
*Function Description*
* Lua
```lua
stringVector = Vector.New(0,0,0).ToString()
```
##### New[β](#new "Direct link to New")
static SVector **New** (float x, float y, float z)
*Initialises vector from three floats*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
newVector = Vector.New(0, 1, 0)
```
##### operator+[β](#operator "Direct link to operator+")
static SVector **operator+** (SVector a, SVector b) static SVector **operator+** (SVector a, float b)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
##### operator-[β](#operator- "Direct link to operator-")
static SVector **operator-** (SVector a, SVector b) static SVector **operator-** (SVector a, float b)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
##### operator\*[β](#operator-1 "Direct link to operator*")
static SVector **operator**\* (SVector a, SVector b) static SVector **operator**\* (SVector a, float b)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
##### operator/[β](#operator-2 "Direct link to operator/")
static SVector **operator/** (SVector a, SVector b) static SVector **operator/** (SVector a, float b)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
#### Properties[β](#properties "Direct link to Properties")
##### X[β](#x "Direct link to X")
float **X** `get` `set`
*X axis (red axis)*
* Lua
```lua
newVect = Vector.New(0,0,0)
newVect.X = 5.0
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local originalPos = obj.LocalPosition;
obj.SubscribeToEvents();
local onStartMethod = function()
Space.Log(originalPos.x);
-- prints the X axis position of this object as a float
originalPos.x = 100.0;
-- assigns 100.0 value to the X axis position of this object
obj.LocalPosition = originalPos;
-- sets the the new position
end
obj.OnStart(onStartMethod);
```
##### Y[β](#y "Direct link to Y")
float **Y** `get` `set`
*Y axis (green axis)*
* Lua
```lua
newVect = Vector.New(0,0,0)
newVect.Y = 5.0
```
* Lua
```lua
local obj = Space.Host.ExecutingObject;
local originalPos = obj.LocalPosition;
obj.SubscribeToEvents();
local onStartMethod = function()
Space.Log(originalPos.y);
-- prints the Y axis position of this object as a float
originalPos.y = 100.0;
-- assigns 100.0 value to the Y axis position of this object
obj.LocalPosition = originalPos;
-- sets the the new position
end
obj.OnStart(onStartMethod);
```
##### Z[β](#z "Direct link to Z")
float **Z** `get` `set`
*Z axis (blue axis)*
* Lua
```lua
newVect = Vector.New(0,0,0)
newVect.Z = 5.0
```
* Lua
```lua
local obj = Space.Host.ExecutingObject
local originalPos = obj.LocalPosition
local onStartMethod = function()
Space.Log(originalPos.z)
-- prints the Z axis position of this object as a float
originalPos.z = 100.0
-- assigns 100.0 value to the Z axis position of this object
obj.LocalPosition = originalPos
-- sets the the new position
end
obj.OnStart(onStartMethod)
```
##### Magnitude[β](#magnitude "Direct link to Magnitude")
float **Magnitude** `get`
*Returns the magnitude of this vector*
* Lua
```lua
vector = Vector.New(1.0, 5.0, 0.0)
vectorMagnitude = vector.Magnitude
```
##### Normalised[β](#normalised "Direct link to Normalised")
SVector **Normalised** `get`
*Returns the normalised version of this vector*
* Lua
```lua
vector = Vector.New(0.0, 10.0, 0.0)
vectorNormalised = vector.Normalised
```
##### Up[β](#up "Direct link to Up")
static SVector **Up** `get`
*Equivalent of new SVector(0,1,0)*
* Lua
```lua
up = Vector.Up
```
* Lua
```lua
--this script will make clicking this object move 2 units up on the world Y axis
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = thisObject.WorldPosition + (Vector.Up * 2)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Down[β](#down "Direct link to Down")
static SVector **Down** `get`
*Equivalent of new SVector(0,-1,0)*
* Lua
```lua
down = Vector.Down
```
* Lua
```lua
--this script will make clicking this object move 2 units down on the world Y axis
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = thisObject.WorldPosition + (Vector.Down * 2)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Left[β](#left "Direct link to Left")
static SVector **Left** `get`
*Equivalent of new SVector(-1,0,0)*
* Lua
```lua
left = Vector.Left
```
* Lua
```lua
--this script will make clicking this object move 2 units left on the world X axis
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = thisObject.WorldPosition + (Vector.Left * 2)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Right[β](#right "Direct link to Right")
static SVector **Right** `get`
*Equivalent of new SVector(1,0,0)*
* Lua
```lua
right = Vector.Right
```
* Lua
```lua
--this script will make clicking this object move 2 units right on the world X axis
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = thisObject.WorldPosition + (Vector.Right * 2)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Forward[β](#forward "Direct link to Forward")
static SVector **Forward** `get`
*Equivalent of new SVector(0,0,1)*
* Lua
```lua
forward = Vector.Forward
```
* Lua
```lua
--this script will make clicking this object move 2 units Forward on the world Z axis
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = thisObject.WorldPosition + (Vector.Forward * 2)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Back[β](#back "Direct link to Back")
static SVector **Back** `get`
*Equivalent of new SVector(0,0,-1)*
* Lua
```lua
back = Vector.Back
```
* Lua
```lua
--this script will make clicking this object move 2 units Back on the world Z axis
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = thisObject.WorldPosition + (Vector.Back * 2)
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### Zero[β](#zero "Direct link to Zero")
static SVector **Zero** `get`
*Equivalent of new SVector(0,0,0)*
* Lua
```lua
vectorZero = Vector.Zero
```
* Lua
```lua
--clicking this object move it to the center of the region <0,0,0>
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = Vector.Zero
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### One[β](#one "Direct link to One")
static SVector **One** `get`
*Equivalent of new SVector(1,1,1)*
* Lua
```lua
vectorOne = Vector.One
```
* Lua
```lua
--clicking this object move it to the <1,1,1> coordinates of the region.
thisObject = Space.Host.ExecutingObject
OnClick = function()
thisObject.WorldPosition = Vector.One
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
```
##### MaxValue[β](#maxvalue "Direct link to MaxValue")
static SVector **MaxValue** `get`
*Contains the largest possible vector* \[3.402823E+38, 3.402823E+38, 3.402823E+38]
* Lua
```lua
vectorMaxValue = Vector.MaxValue
```
##### MinValue[β](#minvalue "Direct link to MinValue")
static SVector **MinValue** `get`
*Contains the largest possible negative vector*
* Lua
```lua
vectorMinValue = Vector.MinValue
```
---
### SWebResponse
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------- |
| string [**Error**](/scripting/client-scripting-api-reference/types/swebresponse.md#propertyname) |
| string [**Response**](/scripting/client-scripting-api-reference/types/swebresponse.md#propertyname-1) |
#### Properties[β](#properties "Direct link to Properties")
##### Error[β](#error "Direct link to Error")
string **Error** `get`
*Any error, will be empty or null if the request was successful*
* Lua
```lua
function ResponseFunction(responseData)
stringError = responseData.Error
end
Space.WebServices.Get('aURL', ResponseFunction)
```
##### Response[β](#response "Direct link to Response")
string **Response** `get`
*The body text of the webpage response if error is empty or null*
* Lua
```lua
function ResponseFunction(responseData)
stringResponse = responseData.Response
end
Space.WebServices.Get('aURL', ResponseFunction)
```
---
### Guides
#### [ποΈPersistence](/scripting/guides/persistence.md)
[Guide on how to script persistence in Sinespace](/scripting/guides/persistence.md)
---
### Persistence
The Sinespace API has a range of API functions that enable us to create different types of persistence. As scripters, we have to choose the type which is more suitable for the task at hand, or even mix and match. In this guide we will go through all the the different classes and functions and explain how to use them.
#### Reference[β](#reference "Direct link to Reference")
These two tables briefly explains the difference between the different types of classes and members that have persistence functionality, and we will expand even more after that.
| Class | Member | Type of persistence |
| --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [SNetwork](../client-scripting-api-reference/network/snetwork) (client scripting) | [SetRegionProperty](../client-scripting-api-reference/network/snetwork#setregionproperty) [GetRegionProperty](../client-scripting-api-reference/network/snetwork#getregionproperty) [SetShardProperty](../client-scripting-api-reference/network/snetwork#setshardproperty) [GetShardProperty](../client-scripting-api-reference/network/snetwork#getshardproperty) [HasShardProperties](../client-scripting-api-reference/network/snetwork#hasshardproperties) | Semi-permanent Region Semi-permanent Region Semi-permanent Shard Semi-permanent Shard Semi-permanent Shard/Region |
| [SPersistence](../client-scripting-api-reference/region/spersistence) (client scripting) | [UpdateInfo ](../client-scripting-api-reference/region/spersistence#updateinfo)[RetrieveValue](../client-scripting-api-reference/region/spersistence#retrievevalue) [SetValue](../client-scripting-api-reference/region/spersistence#setvalue) [UpdateRegionInfo](../client-scripting-api-reference/region/spersistence#updateregioninfo) [RetrieveRegionValue](../client-scripting-api-reference/region/spersistence#retrieveregionvalue) [SetRegionValue](../client-scripting-api-reference/region/spersistence#setregionvalue) | Permanent Player Permanent Player Permanent Player Permanent Region Permanent Region Permanent Region |
| [SShared](../client-scripting-api-reference/client/sshared) (client scripting) | [SetSuperGlobal](../client-scripting-api-reference/client/sshared#setsuperglobal) [GetSuperGlobal](../client-scripting-api-reference/client/sshared#getsuperglobal) | Semi-permanent Viewer Semi-permanent Viewer |
| [SDatabase](../server-scripting-api-reference/storage/sdatabase) (server scripting) | [GetPlayerValue](../server-scripting-api-reference/storage/sdatabase#getplayervalue) [SetPlayerValue](../server-scripting-api-reference/storage/sdatabase#setplayervalue) [GetRegionValue](../server-scripting-api-reference/storage/sdatabase#getregionvalue) [SetRegionValue](../server-scripting-api-reference/storage/sdatabase#setregionvalue) | Permanent Player Permanent Player Permanent Region Permanent Region |
| Types of persistence | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Semi-permanent Region | Persistence will last until Region is closed (after all players leave the Region).Persistence applied region-wide (including all shards, if any are active). |
| Semi-permanent Shard | Persistence will last until Shard is closed (after all players leave the Shard).Persistence applied only to a specific Shard. |
| Semi-permanent Viewer | Persistence will last until Viewer is closed. Persistence applied to the Viewer. |
| Permanent Player | Persistence will last permanently. Persistence applied to specific Player. |
| Permanent Region | Persistence will last permanently. Persistence applied to Region. |
#### What is persistence?[β](#what-is-persistence "Direct link to What is persistence?")
Sending Network Messages is cool for one off events, for example: a player waving Hello, which is relevant for only a few seconds. However, sometimes we want to make changes that are relevant for more than just a few seconds, for example: a window being opened.
If we send a Network Message to broadcast to all players that Window A is now open, when a new player enters our region, they would have missed that Network Message, and Window A would still be closed for them in their viewer.
This is why we need the ability to make certain changes to the scene **Persist**, either permanently or at least until everyone's left the region.
#### SNetwork class[β](#snetwork-class "Direct link to SNetwork class")
The SNetwork class has a variety of networking functions but has 4 functions and 1 property which are related to persistence.
* SetRegionProperty/GetRegionProperty
* SetShardProperty/GetShardProperty
* HasShardProperties
##### Shard Vs Region[β](#shard-vs-region "Direct link to Shard Vs Region")
You'll notice some functions apply to **Shards** and some to **Regions**. What are "shards" anyways?
A Shard is a feature in Sinespace where **one** **Region** can have **multiple** **Shards** (instances), very much like parallel universes, where players on one Shard cannot see players on another Shard.
For the purpose of this beginner guide, we won't go into scripting multi-Shard experiences, but it's enough to understand the differences.
##### What are Shard/Region properties?[β](#what-are-shardregion-properties "Direct link to What are Shard/Region properties?")
For every Shard/Region that is open (there's players inside), there's a semi-permanent storage created on the server that holds **properties**. All scripts using these functions will access this same storage to read and write properties. This storage is a collection of **keys** and **values**. This storage will close after the Shard/Region is closed (after all players leave).
##### What "key" should you use?[β](#what-key-should-you-use "Direct link to What \"key\" should you use?")
You mostly want your **key** to be a private one, so other scripts cannot access it. You are also most likely to want your key to be specific to a GameObject.
We can achieve both of the above in this way:
```lua
thisGameObject = Space.Host.ExecutingObject
KEY = 'SomethingSecret' .. thisGameObject.ID
```
Now we've created a **key** which both **private** and **specific to a GameObject**. We will use it later to access the properties storage and read/write a specific value.
##### HasShardProperties[β](#hasshardproperties "Direct link to HasShardProperties")
When a player joins the region, scripts that want to immediately access the properties database might fire off during a very tiny period where we haven't yet connected to the properties storage. This is why use **HasShardProperties** to check if the storage database is connected and ready for read/write. (HasShardProperties is used for both Shard properties and Region properties)
Let's expand our previous code by adding a coroutine (run our code in a parallel thread) to take care of this:
```lua
thisGameObject = Space.Host.ExecutingObject
KEY = 'SomethingSecret' .. thisGameObject.ID
function TheCoroutineFunction()
while not Space.Network.HasShardProperties do --this while loop keeps looping until HasShardProperties returns true
coroutine.yield(0) --this ensures our loop runs once per frame, otherwise it will be crashed for running too long on a single frame
end
--At this point we have the confirmation we need to begin read/write
end
Space.Host.StartCoroutine(TheCoroutineFunction)
```
##### Setting and Getting properties[β](#setting-and-getting-properties "Direct link to Setting and Getting properties")
Shard properties and Region properties are executed in the exact same way. So for the purpose of this guide we will continue using Region properties only.
Note: The below to functions are usage limited to 10 calls per second. (20 calls per second on Breakroom)
To get a Region property: `value = Space.Network.GetRegionProperty(KEY)`
Note: Sometimes a Region property may have not been set before, so it might return **Nil**. We'll have to add a check for that.
To set a Region property: `Space.Network.SetRegionProperty(KEY, 'A Value')`
Note: Region property values are a string datatype, so you'll have to convert your numbers or tables to a string to store them.
```lua
thisGameObject = Space.Host.ExecutingObject
KEY = 'SomethingSecret' .. thisGameObject.ID
function TheCoroutineFunction()
while not Space.Network.HasShardProperties do --this while loop keeps looping until HasShardProperties returns true
coroutine.yield(0) --this ensures our loop runs once per frame, otherwise it will be crashed for running too long on a single frame
end
--below part only runs after weve got our confirmation
value = Space.Network.GetRegionProperty(KEY) --how to read
Space.Network.SetRegionProperty(KEY, 'A Value') --how to write
end
Space.Host.StartCoroutine(TheCoroutineFunction)
```
##### The window example[β](#the-window-example "Direct link to The window example")
Let's write a script for a window which when clicked opens/closes and updates it's Region property, and also keeps reading the Region property incase another player opens/closes the window.
We are going to add to our script two main parts. First part is constantly reading the Region property to monitor and react to changes. Second part reacts to clicks and updates the Region property which holds the state of the window (open/close).
###### The First Part[β](#the-first-part "Direct link to The First Part")
```lua
thisGameObject = Space.Host.ExecutingObject
KEY = 'SomethingSecret' .. thisGameObject.ID
refWindow = Space.Host.GetReference("window") -- this should be linked in the Scripting Runtime "references" section
function TheCoroutineForFirstPart()
while true do
local value = Space.Network.GetRegionProperty(KEY) --how to read
if value = nil then
--we're going to default the window to closed if Nil
refWindow.Active = true
elseif value == "Open" then
--if it's "Open" we're going to make the window disappear
refWindow.Active = false
elseif value == "Closed" then
--if it's "Closed" we're going to make the window appear
refWindow.Active = true
end
coroutine.yield(0.2) --We'll make this run every 0.2 seconds. That's should be quick enough and we also have a limit to mind.
end
end
function TheCoroutineFunction()
while not Space.Network.HasShardProperties do --this while loop keeps looping until HasShardProperties returns true
coroutine.yield(0) --this ensures our loop runs once per frame, otherwise it will be crashed for running too long on a single frame
end
--below part only runs after weve got our confirmation
Space.Host.StartCoroutine(TheCoroutineForFirstPart) -- we can no start our coroutine which consist of the first part
Space.Network.SetRegionProperty(KEY, 'A Value') --how to write
end
Space.Host.StartCoroutine(TheCoroutineFunction)
```
###### The Second Part (and final code)[β](#the-second-part-and-final-code "Direct link to The Second Part (and final code)")
```lua
thisGameObject = Space.Host.ExecutingObject
KEY = 'SomethingSecret' .. thisGameObject.ID
refWindow = Space.Host.GetReference("window") -- this should be linked in the Scripting Runtime "references" section
function TheCoroutineForFirstPart()
while true do
local value = Space.Network.GetRegionProperty(KEY) --how to read
if value = nil then
--we're going to default the window to closed if Nil
refWindow.Active = true
elseif value == "Open" then
--if it's "Open" we're going to make the window disappear
refWindow.Active = false
elseif value == "Closed" then
--if it's "Closed" we're going to make the window appear
refWindow.Active = true
end
coroutine.yield(0.2) --We'll make this run every 0.2 seconds. That's should be quick enough and we also have a limit to mind.
end
end
function TheOnClickFunctionForSecondPart() --Second Part code which will update region properties when object is clicked
local checkFirst = Space.Network.GetRegionProperty(KEY)
if checkFirst == nil then --if it's nil, this window was never used, so we update property to open
Space.Network.SetRegionProperty(KEY, "Open")
elseif checkFirst == "Open" --if its "Open" we update it to "Closed"
Space.Network.SetRegionProperty(KEY, "Closed")
elseif checkFirst == "Closed" --if its "Closed" we update it to "Open"
end
end
function TheCoroutineFunction()
while not Space.Network.HasShardProperties do --this while loop keeps looping until HasShardProperties returns true
coroutine.yield(0) --this ensures our loop runs once per frame, otherwise it will be crashed for running too long on a single frame
end
--below part only runs after weve got our confirmation
Space.Host.StartCoroutine(TheCoroutineForFirstPart) -- we can no start our coroutine which consist of the first part
Space.Network.SetRegionProperty(KEY, 'A Value') --how to write
end
thisGameObject.AddClickable() --we make this object a clickable
thisGameObject.Clickable.OnClick(TheOnClickFunctionForSecondPart) --we add our Second Part new code to be executed On cLick
Space.Host.StartCoroutine(TheCoroutineFunction)
```
#### SShared class[β](#sshared-class "Direct link to SShared class")
The SShared class (client scripting) has a variety of inter-script communication functions and local viewer storage functions but has 2 functions which are related to persistence.
* SetSuperGlobal
* GetSuperGlobal
##### What is a Super Global?[β](#what-is-a-super-global "Direct link to What is a Super Global?")
A "Global" in the SShared class is a storage within the local player's viewer accessible to all scripts.
A "Super Global" is the same storage but semi-permanent; it will keep existing even when changing regions, until the viewer is closed.
For this example, we will creator a clickable object that teleports us to a region, and on that region we will have a script that reacts depending where we came from.
##### What "namespace" and "key" should you use?[β](#what-namespace-and-key-should-you-use "Direct link to What \"namespace\" and \"key\" should you use?")
Unlike [our previous case](/scripting/guides/persistence.md#what-key-should-you-use), these functions are storing on a specific player's viewer, and they could be meant to be accessed by multiple scripts (could be our other scripts or other scripters' scripts too). It's inherently specific to a player, and likely to a specific project or operation/objective.
That's why it's accessed using a **namespace**, **key** and **value**, vs just **key** and **value**. The **namespace** could be a type of accessor which doesn't have to be private, while still having a **key** accessor that we can make private.
```lua
--SCRIPT A
NAMESPACE = 'space.sine.apidocs.persistenceguide' --this format is just a naming convention
KEY = 'Teleported From'
```
##### Setting and Getting Super Globals[β](#setting-and-getting-super-globals "Direct link to Setting and Getting Super Globals")
When Setting a Super Global, the value need not be a **string**. It accepts a value of type **DynValue**, which means it can be a **string**, **number** or **table** etc...
We set a Super Global like this:
`Space.Shared.SetSuperGlobal('namespace', 'key', AVariable)`
We get a Super Global like this:
`value = Space.Shared.GetSuperGlobal('namespace','key')`
##### The teleporter example[β](#the-teleporter-example "Direct link to The teleporter example")
We will create 2 scripts for this example. The first script will be the one teleporting us an Setting a Super Global, and the second one will be at the destination and will access our Super Global and react to where we teleported from.
We will start creating our first script by expanding on our code above by adding a clickable and make it Set a Super Global with the information we need to carry on to the second region. For the purpose of this guide we will pass our information in a Table rather than a single variable.
```lua
--Script A
NAMESPACE = 'space.sine.apidocs.persistenceguide' --this format is just a naming convention
KEY = 'Teleported From'
thisGameObject = Space.Host.ExecutingObject
function OnClickFunction()
local tableValue = {id = Space.Scene.RegionID, name = Space.Scene.Name} --we create a Table that holds both RegionID and Region Name
Space.Shared.SetSuperGlobal(NAMESPACE,KEY, tableValue) --we Set our Super Global
Space.Scene.PlayerAvatar.Teleport(0000000) -- We teleport. You'll have to replace the zeros with your region ID
end
thisGameObject.AddClickable() --we make the object clickable
thisGameObject.Clickable.OnClick(OnClickFunction) --we hook our OnClickFunction to the clickable's OnClick event
```
Now we have an object, that when clicked, Sets a Super Global and then teleports us. On the destination region we will now create the script that processes our carried over information (regiond name and ID).
```lua
--Script B
NAMESPACE = 'space.sine.apidocs.persistenceguide' --this format is just a naming convention
KEY = 'Teleported From'
getTableValue = Space.Shared.GetSuperGlobal(NAMESPACE, KEY)
Space.Log("You have arrived from region ID: ".. getTableValue.id .. " with Name: " .. getTableValue.name)
```
#### SPersistence Class[β](#spersistence-class "Direct link to SPersistence Class")
The SPersistence class has 6 functions that are all used for creating permanent persistence.
* UpdateInfo/UpdateRegionInfo
* RetrieveValue/RetrieveRegionValue
* SetValue/SetRegionValue
##### What are Region Values and Values?[β](#what-are-region-values-and-values "Direct link to What are Region Values and Values?")
Half the functions in this class create Permanent Region persistence, and the other half create Permanent Player persistence.
If the function has the word **region** in it, that means it creates Region persistence. If it does not, that means it creates Player persistence.
Region/Player values are values in a permanent storage. Region values are in a permanent storage which is linked to the region, and (Player) Values are in a permanent storage linked to the player running the script.
In terms of usage, Region Values are the equivalent to the permanent version of the[ SNetwork class](/scripting/guides/persistence.md#snetwork-class). Whereas Player values are the equivalent to the [SShared class](/scripting/guides/persistence.md#sshared-class).
##### What "key" should you use?[β](#what-key-should-you-use-1 "Direct link to What \"key\" should you use?")
In the case of Region values we will be creating keys in the same way as we did for the [SNetwork class](/scripting/guides/persistence.md#what-key-should-you-use).
In the case of (Player) values we will be creating keys in the same way as we did for the [SShared class](/scripting/guides/persistence.md#sshared-class).
##### Why do we need to "Update Region Info"?[β](#why-do-we-need-to-update-region-info "Direct link to Why do we need to \"Update Region Info\"?")
The unique feature of this class is that it is a client scripting class, but gives us the ability to create persistence without the use of a **server script.**
The storage used to achieve this is an external one, which means we have to start with using the **UpdateRegionInfo()** function to request the storage to send us a copy of it's most recent values (before trying to access these values).
We do it this way:
```lua
function WhatToDoWhenInfoIsReady()
--We access the data we need from inside here
end
Space.Persistence.UpdateRegionInfo() --or UpdateInfo() for Player version
```
Unlike semi-permanent region properties, this function call is not as instant. Because it accesses an external permanent storage, we need to hook a function which will be called once the info has arrived.
```lua
thisGameObject = Space.Host.ExecutingObject
KEY = "Secret" .. thisGameObject.GlobalID
function WhatToDoWhenInfoIsReady()
value = Space.Persistence.RetrieveRegionValue(KEY) --Getting a region value
Space.Log(value) --should print "Something"
end
Space.Persistence.SetRegionValue(KEY, "Something") --Setting a region value
Space.Persistence.UpdateRegionInfo()
```
The slower or variable response speed of this functionality means that it's not recommended to be called rapidly like we did with SNetwork region properties. Therefore we might have to mix and match our code with other types of persistence.
##### Smart Lights Example[β](#smart-lights-example "Direct link to Smart Lights Example")
[Visit our **Smart Lights** sample project page.](/scripting/sample-projects/smart-lights.md)
#### SDatabase Class[β](#sdatabase-class "Direct link to SDatabase Class")
The SDatabase class is the equivalent of the SPersistence class but the only difference being that it is accessed only through [**Server Scripts**](/scripting/guides/server-scripts.md)**.** Server scripts do not have access to the SPersistence class.
A server script is also inherently semi-persistent. That means if you do this `aVariable = 5` in a server script. This variable will be persistent until all players leave the region. This makes the usage of the SDatabase class much easier than the SPersistent class due to not having to mix and match persistent methods.
A downside to server scripts is that they can only be placed in furniture items and need to be loaded on a region to be used (unlike client scripts).
Since this class is almost an exact copy of the SPersistence class. We will only be outlining the differences below (to avoid being repetitive).
##### Differences between SDatabase and SPersistence[β](#differences-between-sdatabase-and-spersistence "Direct link to Differences between SDatabase and SPersistence")
The only two small differences between these to classes are:
1. Functions SetValue/GetValue in SPersistence, are SetPlayerValue/GetPlayerValue in SDatabase
2. GetRegionValue and GetPlayerValue have an extra **onSave** parameter which is a hook that lets us know when the value as been successfully set.
```lua
--Setting a region value using SPersistence in a client script
Space.Persistence.SetRegionValue(KEY, "Something")
--vs
--Setting a region value using SDatabase in a server script
function onSave()
--do something when set is succesful
end
Space.Database.SetRegionValue(KEY, "Something", onSave)
```
#### Thank You[β](#thank-you "Direct link to Thank You")
**Thanks for completing this guide. If you run into any issues or would like to recommend improvements,**[ **please do so on this page**](/scripting/support/report-an-issue.md)**.**
---
### Server Scripts
##### What are server scripts and why do we need them?[β](#what-are-server-scripts-and-why-do-we-need-them "Direct link to What are server scripts and why do we need them?")
The main difference between Server scripts and Client scripts is that they are running on the server.
For **Client scripts**, each player is **running their own local version of a script**, while for **Server scripts**, all players are **running the same version of a script**. Also, server scripts and client scripts **do not share the same API**.
Most of the time we should be able to achieve our task using Client scripts, specially with the availability of classes like the SNetwork or SPersistence classes, which allow scripts to communicate with each other and share data.
However, we may sometimes run into tasks that are more complex and require an independent script (a server script) to be a central hub for communication, data storage, processing information, syncing etc... A good example of an interactive object that would be done using a server script is a multiplayer board game.
##### Creating a Server script:[β](#creating-a-server-script "Direct link to Creating a Server script:")
* Create a GameObject.
* Add the server script component to the GameObject. (Add Component -> Server Script)
* Fill in the **Class ID** field with a unique identifier for your server script. (example: com.example.theserverscript)
* Drag your .lua file into the **Script** field.
* Add a Virtual Good component. (Add Component -> Virtual Good)
* Most important part in a Server Script's Virtual Good component is that the **Type** needs to be set to **Server Script.**
* Upload the GameObject .
##### Using a Server script:[β](#using-a-server-script "Direct link to Using a Server script:")
* Create a GameObject.
* Add a **Require Server Script** component.
* Set the **Virtual Good ID** field to the same virtual good ID of your above created server script.
* Set the **Class ID** field to the same class ID of your above created server script.
* Add a **Room Furniture** component (Add Component -> Room Furniture)
* Now this object will load the above created server script in the region it is placed in.
* You can also add a **Scripting Runtime** component to this GameObject. (Add Component -> Scripting Runtime).
#### Events[β](#events "Direct link to Events")
Unlike client scripting where you have to create hooks/bindings to events, Server scripts only need you to declare that function without creating any hooks/bindings.
For example:
```lua
function OnAvatarJoin(id)
Space.Log(id .. " joined the scene.")
end
```
You can find [Server script events here](/scripting/server-scripting-api-reference/region/sregionscript.md#events-index).
#### Sample Project[β](#sample-project "Direct link to Sample Project")
The **Trivia Box** sample project is a good demonstration of how to use server scripts.
[You can access it here and download it's open-source files.](/scripting/sample-projects/trivia-box.md)
#### Thank You[β](#thank-you "Direct link to Thank You")
**\[This guide is still in progress.**[ **Please report issues here**](/scripting/support/report-an-issue.md)**]**
---
### Sample Projects
#### [ποΈSmart Lights](/scripting/sample-projects/smart-lights.md)
[This sample project is a panel that has switches to turn off/on and change the colors of all lights connected to it. This project demonstrates how we](/scripting/sample-projects/smart-lights.md)
---
### Smart Lights
This sample project is a panel that has switches to turn off/on and change the colors of all lights connected to it. This project demonstrates how we can achieve permanent persistence, how a World Canvas can interface with a script and a bit of networking. Creators can access and download the project files (which are open-source) and do as they wish with it.
Note: Control of the panel is limited to Owner and Admin. This can be modified in the script.
You can demo this object live by going to the **Shop** -> **Furniture** -> Search for **Smart Lights** (it will be under **API Docs Sample Projects** as creator)**.**
###### How to use:[β](#how-to-use "Direct link to How to use:")
* Download the package using the link below
* Import into your Sinespace project (Editor Pack required)
* The project folder will be under **Sinespace Sample Projects -> Smart Lights**
* There's a demo scene in the Scenes folder
* To connect lights to the panel, make them children of the "**Lights**" object group
* In the **Virtual Goods component**, press **Clear ID** and modify the component fields with your own info
* Upload.
[Download PersistentSmartLights16July2022.unitypackage](/assets/files/PersistentSmartLights16July2022-956af536b0479562f583a94b380fc9a4.unitypackage)
Last Updated: 6/28/2022
---
### Trivia Box
This sample project is a box that when pressed will show a trivia question on screen and users will be able to attempt to answer the trivia question using local chat.
This project demonstrates how to create a server script and how client-server communications can be made to create an interactive multiplayer object. It also shows how we can access and interact with the local chat messages through scripting.
Creators can access and download the project (which is open-source) and do as they wish with it.
Note: Control of the box is limited to Owner and Admin. This can be modified in the script.
You can demo this object live by going to the **Shop** -> **Furniture** -> Search for **Trivia Box** (it will be under **API Docs Sample Projects** as creator)**.**
###### How to use:[β](#how-to-use "Direct link to How to use:")
* Download the package using the link below
* Import into your Sinespace project (Editor Pack required)
* The project folder will be under **Sinespace Sample Projects -> Trivia Box**
* There's a demo scene in the **Scenes** folder
* In the **Virtual Goods component**, press **Clear ID** and modify the component fields with your own info.
* In the **VG Trivia Box Server** object, edit the **Class ID** in the **Server Script** component.
* In the **VG Trivia Box object**, edit the **Virtual Good ID** and **Class ID** in the **Require Server Script** component.
* Modify the project and upload.
---
### Server Scripting API
#### [πLibrary](/scripting/server-scripting-api-reference/library.md)
[1 item](/scripting/server-scripting-api-reference/library.md)
---
### Library
Helper libraries available to server scripts, including math utilities.
---
### SMath
#### Index[β](#index "Direct link to Index")
##### Static Functions Index[β](#static-functions-index "Direct link to Static Functions Index")
| Function Name |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| static float [**Random** ](/scripting/server-scripting-api-reference/library/smath.md#random)() |
| static float [**RandomRange** ](/scripting/server-scripting-api-reference/library/smath.md#randomrange)(float min, float max) |
| static int [**RandomInteger** ](/scripting/server-scripting-api-reference/library/smath.md#randominteger)(int min, int max) |
| static float [**Abs** ](smath#abs)(float v) static int [**Abs** ](smath#abs)(int v) |
| static float [**Acos** ](/scripting/server-scripting-api-reference/library/smath.md#acos)(float v) |
| static bool [**Approximately** ](/scripting/server-scripting-api-reference/library/smath.md#approximately)(float a, float b) |
| static float [**Asin** ](/scripting/server-scripting-api-reference/library/smath.md#asin)(float v) |
| static float [**Atan** ](/scripting/server-scripting-api-reference/library/smath.md#atan)(float v) |
| static float [**Atan2** ](/scripting/server-scripting-api-reference/library/smath.md#atan2)(float y, float x) |
| static int [**Ceil** ](/scripting/server-scripting-api-reference/library/smath.md#ceil)(float v) |
| static float [**Clamp** ](/scripting/server-scripting-api-reference/library/smath.md#clamp)(float v, float min, float max) |
| static float [**Clamp01** ](/scripting/server-scripting-api-reference/library/smath.md#clamp01)(float v) |
| static int [**ClosestPowerOfTwo** ](/scripting/server-scripting-api-reference/library/smath.md#closestpoweroftwo)(int v) |
| static float [**Cos** ](/scripting/server-scripting-api-reference/library/smath.md#cos)(float v) |
| static float [**DeltaAngle** ](/scripting/server-scripting-api-reference/library/smath.md#deltaangle)(float current, float target) |
| static float [**Exp** ](/scripting/server-scripting-api-reference/library/smath.md#exp)(float v) |
| static int [**Floor** ](/scripting/server-scripting-api-reference/library/smath.md#floor)(float v) |
| static float [**GammaToLinearSpace** ](/scripting/server-scripting-api-reference/library/smath.md#gammatolinearspace)(float v) |
| static float [**InverseLerp** ](/scripting/server-scripting-api-reference/library/smath.md#inverselerp)(float a, float b, float value) |
| static bool [**IsPowerOfTwo** ](/scripting/server-scripting-api-reference/library/smath.md#ispoweroftwo)(int v) |
| static float [**Lerp** ](/scripting/server-scripting-api-reference/library/smath.md#lerp)(float a, float b, float v) |
| static float [**LerpAngle** ](/scripting/server-scripting-api-reference/library/smath.md#lerpangle)(float a, float b, float v) |
| static float [**LerpUnclamped** ](/scripting/server-scripting-api-reference/library/smath.md#lerpunclamped)(float a, float b, float v) |
| static float [**LinearToGammaSpace** ](/scripting/server-scripting-api-reference/library/smath.md#lineartogammaspace)(float v) |
| static float [**Log** ](smath#log)(float v) static float [Log ](smath#log)(float v, float p) |
| static float [**Log10** ](/scripting/server-scripting-api-reference/library/smath.md#log10)(float v) |
| static float [**Max** ](/scripting/server-scripting-api-reference/library/smath.md#max)(float a, float b) |
| static float [**Min** ](/scripting/server-scripting-api-reference/library/smath.md#min)(float a, float b) |
| static float [**MoveTowards** ](/scripting/server-scripting-api-reference/library/smath.md#movetowards)(float value, float target, float delta) |
| static float [**MoveTowardsAngle** ](/scripting/server-scripting-api-reference/library/smath.md#movetowardsangle)(float value, float target, float delta) |
| static int [**NextPowerOfTwo** ](/scripting/server-scripting-api-reference/library/smath.md#nextpoweroftwo)(int v) |
| static float [**PerlinNoise** ](/scripting/server-scripting-api-reference/library/smath.md#perlinnoise)(float x, float y) |
| static float [**PingPong** ](/scripting/server-scripting-api-reference/library/smath.md#pingpong)(float t, float length) |
| static float [**Pow** ](/scripting/server-scripting-api-reference/library/smath.md#pow)(float value, float pow) |
| static float [**Repeat** ](/scripting/server-scripting-api-reference/library/smath.md#repeat)(float value, float length) |
| static int [**Round** ](/scripting/server-scripting-api-reference/library/smath.md#round)(float value) |
| static float [**Sign** ](/scripting/server-scripting-api-reference/library/smath.md#sign)(float value) |
| static float [**Sin** ](/scripting/server-scripting-api-reference/library/smath.md#sin)(float value) |
| static float [**SmoothStep** ](/scripting/server-scripting-api-reference/library/smath.md#smoothstep)(float from, float to, float t) |
| static float [**Sqrt** ](/scripting/server-scripting-api-reference/library/smath.md#sqrt)(float value) |
| static float [**Tan** ](/scripting/server-scripting-api-reference/library/smath.md#tan)(float value) |
##### Static Attributes Index[β](#static-attributes-index "Direct link to Static Attributes Index")
| Property Name |
| ----------------------------------------------------------------------------------------------------- |
| static readonly float [**Pi**](/scripting/server-scripting-api-reference/library/smath.md#pi)\*\*\*\* |
#### Static Functions[β](#static-functions "Direct link to Static Functions")
##### Random[β](#random "Direct link to Random")
static float **Random** ()
*Returns a random float between 0 and 1 (inclusive)*
* Lua
```lua
local randomNumber = Space.Math.Random();
Space.Log(randomNumber);
-- prints 0.689094245433807
```
##### RandomRange[β](#randomrange "Direct link to RandomRange")
static float **RandomRange** (float min, float max)
*Returns a random float between min and max (inclusive)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local min = 100.0;
local max = 500.0;
local randomNumber = Space.Math.RandomRange(min, max );
Space.Log(randomNumber);
-- prints 0206.659149169922
```
##### RandomInteger[β](#randominteger "Direct link to RandomInteger")
static int **RandomInteger** (int min, int max)
*Returns a random float between min (inclusive) and max (exclusive)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local min = 50;
local max = 75;
local randomInteger = Space.Math.RandomInteger(min, max);
Space.Log(randomInteger);
-- prints 52
```
##### Abs[β](#abs "Direct link to Abs")
static float **Abs** (float v) static int **Abs** (int v)
*Returns the absolute value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = -4.2
local absoluteNum = Space.Math.Abs(value);
Space.Log(absoluteNum);
-- prints 4 [BUG] should be 4.2
```
##### Acos[β](#acos "Direct link to Acos")
static float **Acos** (float v)
*Returns the arc cosine value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 0.5;
local arcCosine = Space.Math.Acos(value);
Space.Log(arcCosine);
-- prints 1.04719758033752 (radians) which is 60 degrees
```
##### Approximately[β](#approximately "Direct link to Approximately")
static bool **Approximately** (float a, float b)
*True if the difference between a and b is less than epsilon*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local a = 5.0;
local b = 5;
local approx1 = Space.Math.Approximately(a, b);
Space.Log(approx1);
-- prints true
local a = 5.01;
local b = 5.0;
local approx2 = Space.Math.Approximately(a, b);
Space.Log(approx2);
-- prints false
local a = 5.01;
local b = 5.0;
local approx3 = Space.Math.Approximately(a, b);
Space.Log(approx3);
-- prints false
```
##### Asin[β](#asin "Direct link to Asin")
static float **Asin** (float v)
*Returns the arc sine value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 0.5;
local arcSine = Space.Math.Asin(value);
Space.Log(arcSine);
-- prints 0.523598790168762 (radians) which is 30 degrees
```
##### Atan[β](#atan "Direct link to Atan")
static float **Atan** (float v)
*Returns the arc tangent value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 1.732050808;
local arcTangent = Space.Math.Atan(value);
Space.Log(arcTangent);
-- prints 1.04719758033752 (radians) which is 60 degrees
```
##### Atan2[β](#atan2 "Direct link to Atan2")
static float **Atan2** (float y, float x)
*Returns the arc tangent of y/x*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local x = 0.5;
local y = 0.5;
local arcTangent = Space.Math.Atan2(y, x);
Space.Log(arcTangent);
-- prints 0.785398185253143
```
##### Ceil[β](#ceil "Direct link to Ceil")
static int **Ceil** (float v)
*Returns the ceil value of 'val' as an integer*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Ceil(4.0));
-- prints 4
Space.Log(Space.Math.Ceil(4.2));
-- prints 5
Space.Log(Space.Math.Ceil(-4.2));
-- prints -4
```
##### Clamp[β](#clamp "Direct link to Clamp")
static float **Clamp** (float v, float min, float max)
*Clamps val between min and max, and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 100.0;
local min = 20.0;
local max = 82.0;
local clampedValue = Space.Math.Clamp(value, min, max);
Space.Log(clampedValue);
-- prints 82
```
##### Clamp01[β](#clamp01 "Direct link to Clamp01")
static float **Clamp01** (float v)
*Clamps val between 0 and 1, and returns the result*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = -1.0;
local clampedValue = Space.Math.Clamp01(value);
Space.Log(clampedValue);
-- prints 0
```
##### ClosestPowerOfTwo[β](#closestpoweroftwo "Direct link to ClosestPowerOfTwo")
static int **ClosestPowerOfTwo** (int v)
*Returns the closest power of two to val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local value = 33;
local powerOfTwo = Space.Math.ClosestPowerOfTwo(value);
Space.Log(powerOfTwo);
-- prints 32
```
##### Cos[β](#cos "Direct link to Cos")
static float **Cos** (float v)
*Returns the cosine of val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local cosine = Space.Math.Cos(angle);
Space.Log(cosine);
-- prints 0.499999970197678
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local cosine2 = Space.Math.Cos(angle2);
Space.Log(cosine2);
-- prints 0.499999970197678
```
##### DeltaAngle[β](#deltaangle "Direct link to DeltaAngle")
static float **DeltaAngle** (float current, float target)
\_Returns the difference in degrees between two values (e.g. 350' and 17' returns 27') \_
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.DeltaAngle(350.0, 17.0));
-- prints 27
```
##### Exp[β](#exp "Direct link to Exp")
static float **Exp** (float v)
*Returns e raised to val power.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Exp(3.0));
-- prints 20.0855369567871
```
##### Floor[β](#floor "Direct link to Floor")
static int **Floor** (float v)
*Returns floor of val, converted to an int*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Floor(4.0));
-- prints 4
Space.Log(Space.Math.Floor(4.2));
-- prints 4
Space.Log(Space.Math.Floor(-4.2));
-- prints -5
```
##### GammaToLinearSpace[β](#gammatolinearspace "Direct link to GammaToLinearSpace")
static float **GammaToLinearSpace** (float v)
*Converts a colour value from Gamma to Linear Space (Pow 2.2)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.GammaToLinearSpace(0.5));
-- prints 0.214041143655777
```
##### InverseLerp[β](#inverselerp "Direct link to InverseLerp")
static float **InverseLerp** (float a, float b, float value)
*Returns the percentage between a and b that 'val' is on a line (opposite of Lerp)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 0.0;
local sliderStop = 100.0;
local currentSliderPos = 75.0;
local percentage = Space.Math.InverseLerp(sliderStart, sliderStop, currentSliderPos);
Space.Log(percentage);
-- prints 0.75
```
##### IsPowerOfTwo[β](#ispoweroftwo "Direct link to IsPowerOfTwo")
static bool **IsPowerOfTwo** (int v)
*Returns true if val is a power of two*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.IsPowerOfTwo(55));
-- prints False
Space.Log(Space.Math.IsPowerOfTwo(32));
-- prints True
```
##### Lerp[β](#lerp "Direct link to Lerp")
static float **Lerp** (float a, float b, float v)
*Interpolates between 'a' and 'b' based on 'val', assuming 'val' is between 0 and 1*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 0.0;
local sliderStop = 100.0;
local percentage = 0.75;
local currentSliderPos = Space.Math.Lerp(sliderStart, sliderStop, percentage);
Space.Log(currentSliderPos);
-- prints 75
```
##### LerpAngle[β](#lerpangle "Direct link to LerpAngle")
static float **LerpAngle** (float a, float b, float v)
*Interpolates between angles 'a' and 'b' based on 'val', assuming 'val' is between 0 and 1*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStartAngle = 0.0;
local sliderStopAngle = Space.Math.Pi;-- 180 degrees
local percentage = 0.50;
local currentSliderPos = Space.Math.LerpAngle(sliderStartAngle, sliderStopAngle, percentage);
Space.Log(currentSliderPos);
-- prints 1.57079637050629 (90 degrees)
```
##### LerpUnclamped[β](#lerpunclamped "Direct link to LerpUnclamped")
static float **LerpUnclamped** (float a, float b, float v)
*Interpolates between 'a' and 'b' based on 'val', assuming 'val' is between 0 and 1, but unbounded (allowing higher/lower values)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 0.0;
local sliderStop = 100.0;
local percentage = 2.0;
local currentSliderPos = Space.Math.LerpUnclamped(sliderStart, sliderStop, percentage);
Space.Log(currentSliderPos);
-- prints 200
```
##### LinearToGammaSpace[β](#lineartogammaspace "Direct link to LinearToGammaSpace")
static float **LinearToGammaSpace** (float v)
*Converts a colour value from Linear to Gamma Space (Pow 1/2.2)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.LinearToGammaSpace(0.214041143655777));
-- prints 0.5
```
##### Log[β](#log "Direct link to Log")
static float **Log** (float v) static float **Log** (float v, float p)
*Returns the natural logarithm for 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Log(30.0));
-- prints 3.40119743347168
Space.Log(Space.Math.Log(4.0, 2.0));
-- prints 2
```
##### Log10[β](#log10 "Direct link to Log10")
static float **Log10** (float v)
*Returns the Log10 value for 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Log10(100.0));
-- prints 2
```
##### Max[β](#max "Direct link to Max")
static float **Max** (float a, float b)
*Returns higher of 'a' or 'b'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Max(20.0, 100.0));
-- prints 100
```
##### Min[β](#min "Direct link to Min")
static float **Min** (float a, float b)
*Returns lower of 'a' or 'b'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Min(20.0, 100.0));
-- prints 20
```
##### MoveTowards[β](#movetowards "Direct link to MoveTowards")
static float **MoveTowards** (float value, float target, float delta)
*Move value to target, but by no more than delta*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStart = 5.0;
local sliderStop = 10.0;
local deltaChange = 1.0;
local currentSliderPos = Space.Math.MoveTowards(sliderStart, sliderStop, deltaChange);
Space.Log(currentSliderPos);
-- prints 6 (moves forward 1)
local sliderStart = 5.0;
local sliderStop = 10.0;
local deltaChange = 7.0;
local currentSliderPos = Space.Math.MoveTowards(sliderStart, sliderStop, deltaChange);
Space.Log(currentSliderPos); -- prints 10 (caps out at at the target value)
-- NOTE: Use negative delta to move away from target.
```
##### MoveTowardsAngle[β](#movetowardsangle "Direct link to MoveTowardsAngle")
static float **MoveTowardsAngle** (float value, float target, float delta)
*Move angle value to target, but by no more than delta*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local sliderStartAngle = Space.Math.Pi/2; -- 90 degrees
local sliderStopAngle = Space.Math.Pi; -- 180 degrees
local deltaChange = Space.Math.Pi/6; -- 30 degrees
local currentSliderPos = Space.Math.MoveTowardsAngle(sliderStartAngle, sliderStopAngle, deltaChange);
Space.Log(currentSliderPos);
-- prints 2.09439516067505 (moves forward 30 degrees to 120 degrees)
-- NOTE: Add 180 degrees (Space.Math.Pi) to move away from target.
```
##### NextPowerOfTwo[β](#nextpoweroftwo "Direct link to NextPowerOfTwo")
static int **NextPowerOfTwo** (int v)
*Return the next power of two larger or equal to val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.NextPowerOfTwo(16));
-- prints 16
Space.Log(Space.Math.NextPowerOfTwo(17));
-- prints 32
```
##### PerlinNoise[β](#perlinnoise "Direct link to PerlinNoise")
static float **PerlinNoise** (float x, float y)
*Return 2D Perlin noise for coordinates x and y*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Lua Translation of Unity C# Documentation
local ball = Space.Host.ExecutingObject;
ball.SubscribeToEvents();
-- animates this object to move upwards on the y axis with slight random movement
local animateBall = function()
local heightScale = 0.1; -- controls speed of movement
local xScale = 1.0; -- shifts x position on perlin noise plane
local height = heightScale * Space.Math.PerlinNoise(Space.Time * xScale, 0.0);
local pos = ball.LocalPosition;
pos.y = pos.y + height;
ball.LocalPosition = pos;
Space.Log(pos.y);
end
ball.OnUpdate(animateBall);
-- NOTE: If you need a guaranteed range of [0,1], make sure to clamp the value with Space.Math.Clamp01.
```
##### PingPong[β](#pingpong "Direct link to PingPong")
static float **PingPong** (float t, float length)
*Return a value between 0 and length that oscillates upwards and back based on the position of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
--[[ In this example, if you traced the output of Space.Math.PingPong(value, length),
the return values would cycle forward through the range [0,5] then cycle backwards through the range [5,0] in order. --]]
local ball = Space.Host.ExecutingObject;
local originalPos = ball.LocalPosition;
ball.SubscribeToEvents();
-- The ball object oscillates back and forth on the x-axis.
local animateBall = function()
local value = Space.Time;
local length = 5.0;
local newPos = Vector.New(Space.Math.PingPong(value, length) + originalPos.x, originalPos.y, originalPos.z);
ball.LocalPosition = newPos;
end
ball.OnUpdate(animateBall);
```
##### Pow[β](#pow "Direct link to Pow")
static float **Pow** (float value, float pow)
*Return x raised to y power*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Pow(2, 4));
-- prints 16
```
##### Repeat[β](#repeat "Direct link to Repeat")
static float **Repeat** (float value, float length)
*Return a value between 0 and length that returns to 0 after exceeding length based on 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
--[[ In this example, if you traced the output of Space.Math.Repeat(value, length),
the return values would cycle forward through the range [0,5]. The cycle is repeated again from 0.--]]
local ball = Space.Host.ExecutingObject;
local originalPos = ball.LocalPosition;
ball.SubscribeToEvents();
-- The ball object moves forward on the x-axis.
-- Then, it repeats the same motion again from the beginning.
local animateBall = function()
local value = Space.Time;
local length = 5.0;
local newPos = Vector.New(Space.Math.Repeat(value, length) + originalPos.x, originalPos.y, originalPos.z);
ball.LocalPosition = newPos;
end
ball.OnUpdate(animateBall);
```
##### Round[β](#round "Direct link to Round")
static int **Round** (float value)
*Returns the nearest integer value to val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Round(4.0));
-- prints 4
Space.Log(Space.Math.Round(4.2));
-- prints 4
Space.Log(Space.Math.Round(4.5));
-- prints 4
Space.Log(Space.Math.Round(4.55));
-- prints 5
Space.Log(Space.Math.Round(4.8));
-- prints 5
Space.Log(Space.Math.Round(-4.2));
-- prints -4
Space.Log(Space.Math.Round(-4.8));
-- prints -5
```
##### Sign[β](#sign "Direct link to Sign")
static float **Sign** (float value)
*Returns either 1 or -1 based on the sign of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Sign(4.2));
-- prints 1
Space.Log(Space.Math.Sign(-4.2));
-- prints -1
```
##### Sin[β](#sin "Direct link to Sin")
static float **Sin** (float value)
*Returns the sine of val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local sine = Space.Math.Sin(angle);
Space.Log(sine);
-- prints 0.866025447845459
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local sine2 = Space.Math.Sin(angle2);
Space.Log(sine2);
-- prints 0.866025447845459
```
##### SmoothStep[β](#smoothstep "Direct link to SmoothStep")
static float **SmoothStep** (float from, float to, float t)
*Similar to Lerp but moves slowly closer to the edges ('Spherical Lerp')*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
-- Lua Translation of Unity C# Documentation
--[[ In this example, Space.Math.SmoothStep(min, max, time) returns values in the range [1,10] in order.
As values approach 10, the interpolation slows down. --]]
local ball = Space.Host.ExecutingObject;
local originalPos = ball.LocalPosition;
local min = 1.0;
local max = 10.0;
local duration = 5.0; --lower value to speed up; raise to slow down
local startTime;
ball.SubscribeToEvents();
local initStartTime = function()
startTime = Space.Time;
end
-- The ball jumps to min + originalPos, then it moves towards
-- max + originalPos while slowing down at the end.
local animateBall = function()
local time = (Space.Time - startTime) / duration;
local newPos = Vector.New(Space.Math.SmoothStep(min, max, time)
+ originalPos.x, originalPos.y, originalPos.z);
ball.LocalPosition = newPos;
end
ball.OnStart(initStartTime);
ball.OnUpdate(animateBall);
```
##### Sqrt[β](#sqrt "Direct link to Sqrt")
static float **Sqrt** (float value)
*Returns the square root of val*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log(Space.Math.Sqrt(16));
-- prints 4
Space.Log(Space.Math.Sqrt(-16));
-- prints NaN
```
##### Tan[β](#tan "Direct link to Tan")
static float **Tan** (float value)
*Returns the tangent value of 'val'*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local angle = 1.04719758033752; -- converts to 60 degrees
local tangent = Space.Math.Tan(angle);
Space.Log(tangent);
-- prints 1.73205089569092
local angle2 = Space.Math.Pi/3; -- converts to 60 degrees
local tangent2 = Space.Math.Tan(angle2);
Space.Log(tangent2);
-- prints 1.73205089569092
```
#### Static Attributes[β](#static-attributes "Direct link to Static Attributes")
##### Pi[β](#pi "Direct link to Pi")
static readonly float **Pi** = 3.14159265358979f
*Returns the constant value of Ξ .*
* Lua
```lua
Space.Log(Space.Math.Pi);
-- prints 3.14159274101257
```
---
### Network
Networking APIs for server scripts, covering shared data and outbound web requests.
---
### SShared
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| void [**SetGlobal** ](/scripting/server-scripting-api-reference/network/sshared.md#setglobal)(string ns, string key, DynValue value) |
| DynValue [**GetGlobal** ](/scripting/server-scripting-api-reference/network/sshared.md#getglobal)(string ns, string key) |
| void [**RegisterFunction** ](/scripting/server-scripting-api-reference/network/sshared.md#registerfunction)(string ns, string func, Closure reference) |
| void [**RegisterBroadcastFunction** ](/scripting/server-scripting-api-reference/network/sshared.md#registerbroadcastfunction)(string ns, string func, Closure reference) |
| void [**UnregisterBroadcastFunction** ](sshared#unregisterbroadcastfunction)(string ns, string func, Closure reference) void **UnregisterBroadcastFunction** (string ns, string func) |
| void [**CallFunction** ](/scripting/server-scripting-api-reference/network/sshared.md#callfunction)(string ns, string func, IEnumerable< DynValue > args) |
| int [**CallBroadcastFunction** ](/scripting/server-scripting-api-reference/network/sshared.md#callbroadcastfunction)(string ns, string func, IEnumerable< DynValue > args) |
#### Functions[β](#functions "Direct link to Functions")
##### SetGlobal[β](#setglobal "Direct link to SetGlobal")
void **SetGlobal** (string ns, string key, DynValue value)
*Sets a global key to a value. The value can be any object type.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Shared.SetGlobal("com.someNameHere.world", "version", "1.02");
```
##### GetGlobal[β](#getglobal "Direct link to GetGlobal")
DynValue **GetGlobal** (string ns, string key)
*Retrieves a previously set global variable, or returns nil.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
local versionValue = Space.Shared.GetGlobal("com.someNameHere.world", "version")
```
##### RegisterFunction[β](#registerfunction "Direct link to RegisterFunction")
void **RegisterFunction** (string ns, string func, Closure reference)
*Makes func into a global function that can be accessed anywhere.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function someFunction(name)
Space.Log("Hello " .. name);
end
Space.Shared.RegisterFunction("com.someNameHere.world", "func", someFunction);
```
##### RegisterBroadcastFunction[β](#registerbroadcastfunction "Direct link to RegisterBroadcastFunction")
void **RegisterBroadcastFunction** (string ns, string func, Closure reference)
*Makes func into a global function that can be accessed anywhere.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
function someFunction(name)
Space.Log("Hello " .. name);
end
Space.Shared.RegisterBroadcastFunction("com.someNameHere.world", "func", someFunction);
```
##### UnregisterBroadcastFunction[β](#unregisterbroadcastfunction "Direct link to UnregisterBroadcastFunction")
void **UnregisterBroadcastFunction** (string ns, string func, Closure reference) void **UnregisterBroadcastFunction** (string ns, string func)
*Unregister Broadcast Function.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
##### CallFunction[β](#callfunction "Direct link to CallFunction")
void **CallFunction** (string ns, string func, IEnumerable< DynValue > args)
*Calls the registered function with the specified arguments.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Shared.CallFunction("com.someNameHere.world", "func",{"Smith"});
```
##### CallBroadcastFunction[β](#callbroadcastfunction "Direct link to CallBroadcastFunction")
int **CallBroadcastFunction** (string ns, string func, IEnumerable< DynValue > args)
*Calls every registered broadcast function with the specified arguments, and returns the number of calls queued.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
---
### SWebservice
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Get** ](/scripting/server-scripting-api-reference/network/swebservice.md#get)(string url, Closure onComplete, Table headers=null) |
| void [**Post** ](/scripting/server-scripting-api-reference/network/swebservice.md#post)(string url, string data, Closure onComplete, Table headers=null) |
#### Functions[β](#functions "Direct link to Functions")
##### Get[β](#get "Direct link to Get")
void **Get** (string url, Closure onComplete, Table headers=null)
*Performs an HTTP\[S] GET. The callback receives two parameters: `success` (bool) and `response` (string).*
| Parameter | Type | Description |
| ---------- | ---------------- | --------------------------------------------------------------------------------------------------------- |
| url | string | The absolute URL to request. |
| onComplete | Closure | Callback `(bool success, string response)` invoked on completion. |
| headers | Table (optional) | Supported keys: `Bearer` (maps to `Authorization: Bearer `), `Content-Type` (rarely used for GET). |
* Lua
```lua
-- Simple GET
local url = "https://httpbin.org/get"
Space.WebServices.Get(url, function(success, response)
if success then
Space.Log("OK: " .. response)
else
Space.Log("Request failed: " .. response)
end
end)
```
* Lua
```lua
-- GET with Bearer auth
local url = "https://api.example.com/me"
local headers = { ["Bearer"] = "YOUR_ACCESS_TOKEN" }
Space.WebServices.Get(url, function(success, response)
if success then
Space.Log(response)
else
Space.Log("Error: " .. response)
end
end, headers)
```
##### Post[β](#post "Direct link to Post")
void **Post** (string url, string data, Closure onComplete, Table headers=null)
*Performs an HTTP\[S] POST. The callback receives two parameters: `success` (bool) and `response` (string).*
| Parameter | Type | Description |
| ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| url | string | The absolute URL to POST to. |
| data | string | Request body string. For JSON, send a JSON string and set `Content-Type`. |
| onComplete | Closure | Callback `(bool success, string response)` invoked on completion. |
| headers | Table (optional) | Supported keys: `Content-Type` (defaults to `application/x-www-form-urlencoded`), `Bearer` (maps to `Authorization: Bearer `). |
* Lua
```lua
-- Form POST
local url = "https://httpbin.org/post"
local body = "x=1&y=2"
Space.WebServices.Post(url, body, function(success, response)
if success then
Space.Log("OK: " .. response)
else
Space.Log("Error: " .. response)
end
end)
```
* Lua
```lua
-- JSON POST with Bearer auth
local url = "https://api.example.com/widgets"
local body = '{"name":"Server Created Widget"}'
local headers = { ["Content-Type"] = "application/json", ["Bearer"] = "YOUR_ACCESS_TOKEN" }
Space.WebServices.Post(url, body, function(success, response)
if success then
Space.Log("Created: " .. response)
else
Space.Log("Error: " .. response)
end
end, headers)
```
Note:
* Server requests automatically include: `X-Sinespace-Region-ID`, `X-Sinespace-Instance-ID`, `X-Sinespace-Script-ID`, `X-Sinespace-Runtime-Type`, and `X-Sinespace-In-Editor`.
* There is no `timeout` parameter on server web requests.
---
### Scene
APIs for the region from the server's perspective β scenes, parcels, cells, objects, and the avatars present within them.
---
### SAvatar
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------------- |
| int [**ID**](/scripting/server-scripting-api-reference/region/savatar.md#id) `get` |
| Vector3 [**Position** ](/scripting/server-scripting-api-reference/region/savatar.md#position)`get` |
| Vector3 [**Velocity** ](/scripting/server-scripting-api-reference/region/savatar.md#velocity)`get` |
| Quaternion [**Rotation** ](/scripting/server-scripting-api-reference/region/savatar.md#rotation)`get` |
| string [**Username** ](/scripting/server-scripting-api-reference/region/savatar.md#username)`get` |
| string [**Title** ](/scripting/server-scripting-api-reference/region/savatar.md#title)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### ID[β](#id "Direct link to ID")
int **ID** `get`
*Avatar's ID*
* Lua
```lua
ID = Space.Scene.Avatars[1].ID
```
* Lua
```lua
--server script that prints a list of IDs of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].ID)
end
end
```
##### Position[β](#position "Direct link to Position")
Vector3 **Position** `get`
*Avatar's position*
* Lua
```lua
ID = Space.Scene.Avatars[1].Position
```
* Lua
```lua
--server script that prints a list of Positions of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Position)
end
end
```
##### Velocity[β](#velocity "Direct link to Velocity")
Vector3 **Velocity** `get`
*Avatar's Velocity*
* Lua
```lua
ID = Space.Scene.Avatars[1].Velocity
```
* Lua
```lua
--server script that prints a list of Velocitys of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Velocity)
end
end
```
##### Rotation[β](#rotation "Direct link to Rotation")
Quaternion **Rotation** `get`
*Avatar's Rotation*
* Lua
```lua
ID = Space.Scene.Avatars[1].Quaternion
```
* Lua
```lua
--server script that prints a list of Rotations of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Rotation)
end
end
```
##### Username[β](#username "Direct link to Username")
string **Username** `get`
*Avatar's Username*
* Lua
```lua
ID = Space.Scene.Avatars[1].Username
```
* Lua
```lua
--server script that prints a list of Usernames of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Username)
end
end
```
##### Title[β](#title "Direct link to Title")
string **Title** `get`
*Avatar's Title*
* Lua
```lua
ID = Space.Scene.Avatars[1].Title
```
* Lua
```lua
--server script that prints a list of Titles of players online whenever someone joins
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
for num =1 , numOfAvatars, 1 do
Space.Log(Space.Scene.Avatars[num].Title)
end
end
```
---
### SCell
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| -------------------------------------------------------------------------------------------------------- |
| SObject [**GetObject** ](/scripting/server-scripting-api-reference/region/scell.md#getobject)(string id) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| -------------------------------------------------------------------------------------------- |
| Table [**Objects** ](/scripting/server-scripting-api-reference/region/scell.md#objects)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetObject[β](#getobject "Direct link to GetObject")
[SObject](/scripting/server-scripting-api-reference/region/sobject.md) **GetObject** (string id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
#### Properties[β](#properties "Direct link to Properties")
##### Objects[β](#objects "Direct link to Objects")
Table **Objects** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SObject
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ------------------------------------------------------------------------------------------------------------------------------- |
| string [**GetProperty** ](/scripting/server-scripting-api-reference/region/sobject.md#getproperty)(string property) |
| void [**SetProperty** ](/scripting/server-scripting-api-reference/region/sobject.md#setproperty)(string property, string value) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------------------- |
| SCell [**Cell** ](/scripting/server-scripting-api-reference/region/sobject.md#cell)`get` |
| string [**ID**](/scripting/server-scripting-api-reference/region/sobject.md#id) `get` |
| string [**Floor** ](/scripting/server-scripting-api-reference/region/sobject.md#floor)`get` |
| Vector3 [**Position** ](/scripting/server-scripting-api-reference/region/sobject.md#position)`get` `set` |
| Quaternion [**Rotation** ](/scripting/server-scripting-api-reference/region/sobject.md#rotation)`get` `set` |
| Vector3 [**Scale** ](/scripting/server-scripting-api-reference/region/sobject.md#scale)`get` `set` |
| int [**Player** ](/scripting/server-scripting-api-reference/region/sobject.md#player)`get` |
| int [**InventoryID** ](/scripting/server-scripting-api-reference/region/sobject.md#inventoryid)`get` |
| int [**ItemID** ](/scripting/server-scripting-api-reference/region/sobject.md#itemid)`get` |
| Bounds [**Bounds** ](/scripting/server-scripting-api-reference/region/sobject.md#bounds)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetProperty[β](#getproperty "Direct link to GetProperty")
string **GetProperty** (string property)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### SetProperty[β](#setproperty "Direct link to SetProperty")
void **SetProperty** (string property, string value)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
#### Properties[β](#properties "Direct link to Properties")
##### Cell[β](#cell "Direct link to Cell")
SCell **Cell** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### ID[β](#id "Direct link to ID")
string **ID** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Floor[β](#floor "Direct link to Floor")
string **Floor** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Position[β](#position "Direct link to Position")
Vector3 **Position** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Rotation[β](#rotation "Direct link to Rotation")
Quaternion **Rotation** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Scale[β](#scale "Direct link to Scale")
Vector3 **Scale** `get` `set`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Player[β](#player "Direct link to Player")
int **Player** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### InventoryID[β](#inventoryid "Direct link to InventoryID")
int **InventoryID** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### ItemID[β](#itemid "Direct link to ItemID")
int **ItemID** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Bounds[β](#bounds "Direct link to Bounds")
Bounds **Bounds** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SParcel
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ---------------------------------------------------------------------------------------------------------------- |
| string [**ID**](/scripting/server-scripting-api-reference/region/sparcel.md#id) `get` |
| string [**Name** ](/scripting/server-scripting-api-reference/region/sparcel.md#name)`get` |
| string [**DescriptionName** ](/scripting/server-scripting-api-reference/region/sparcel.md#descriptionname)`get` |
| bool [**ForSale** ](/scripting/server-scripting-api-reference/region/sparcel.md#forsale)`get` |
| int [**GoldSalePrice** ](/scripting/server-scripting-api-reference/region/sparcel.md#goldsaleprice)`get` |
| int [**SilverSalePrice** ](/scripting/server-scripting-api-reference/region/sparcel.md#silversaleprice)`get` |
| int [**GoldRentalPrice** ](/scripting/server-scripting-api-reference/region/sparcel.md#goldrentalprice)`get` |
| int [**SilverRentalPrice** ](/scripting/server-scripting-api-reference/region/sparcel.md#silverrentalprice)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### ID[β](#id "Direct link to ID")
string **ID** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### Name[β](#name "Direct link to Name")
string **Name** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### DescriptionName[β](#descriptionname "Direct link to DescriptionName")
string **DescriptionName** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### ForSale[β](#forsale "Direct link to ForSale")
bool **ForSale** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### GoldSalePrice[β](#goldsaleprice "Direct link to GoldSalePrice")
int **GoldSalePrice** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### SilverSalePrice[β](#silversaleprice "Direct link to SilverSalePrice")
int **SilverSalePrice** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### GoldRentalPrice[β](#goldrentalprice "Direct link to GoldRentalPrice")
int **GoldRentalPrice** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
##### SilverRentalPrice[β](#silverrentalprice "Direct link to SilverRentalPrice")
int **SilverRentalPrice** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SParcelManager
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SParcel](/scripting/server-scripting-api-reference/region/sparcel.md) [**GetParcel** ](/scripting/server-scripting-api-reference/region/sparcelmanager.md#getparcel)(string id) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ----------------------------------------------------------------------------------------------------------- |
| Table [**AllParcels** ](/scripting/server-scripting-api-reference/region/sparcelmanager.md#allparcels)`get` |
#### Functions[β](#functions "Direct link to Functions")
##### GetParcel[β](#getparcel "Direct link to GetParcel")
SParcel **GetParcel** (string id)
*Function Description*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
#### Properties[β](#properties "Direct link to Properties")
##### AllParcels[β](#allparcels "Direct link to AllParcels")
Table **AllParcels** `get`
*Property Description*
* Lua
```lua
example 1
```
* Lua
```lua
example 2
```
---
### SRegionScript
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**Log** ](/scripting/server-scripting-api-reference/region/sregionscript.md#log)(string message) |
| void [**SubscribeToNetwork** ](/scripting/server-scripting-api-reference/region/sregionscript.md#subscribetonetwork)(string key) |
| void [**UnsubscribeFromNetwork** ](/scripting/server-scripting-api-reference/region/sregionscript.md#unsubscribefromnetwork)(string key) |
| void [**SendMessageToAllClientScripts** ](/scripting/server-scripting-api-reference/region/sregionscript.md#sendmessagetoallclientscripts)(string messageName, Table message) |
| void [**SendMessageToClientScripts** ](/scripting/server-scripting-api-reference/region/sregionscript.md#sendmessagetoclientscripts)(ulong playerID, string messageName, Table message) |
| void [**StartCoroutine** ](sregionscript#startcoroutine)(DynValue coroutine, DynValue parameter=default(DynValue)) void [**StartCoroutine** ](sregionscript#startcoroutine)(string name, DynValue parameter=default(DynValue)) |
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------------------------ |
| string [**ScriptID** ](/scripting/server-scripting-api-reference/region/sregionscript.md#scriptid)`get` |
| uint [**InstanceID** ](/scripting/server-scripting-api-reference/region/sregionscript.md#instanceid)`get` |
| ulong [**RegionID** ](/scripting/server-scripting-api-reference/region/sregionscript.md#regionid)`get` |
| SScene [**Scene** ](/scripting/server-scripting-api-reference/region/sregionscript.md#scene)`get` |
| SDatabase [**Database** ](/scripting/server-scripting-api-reference/region/sregionscript.md#database)`get` |
| SMath [**Math** ](/scripting/server-scripting-api-reference/region/sregionscript.md#math)`get` |
| SShared [**Shared** ](/scripting/server-scripting-api-reference/region/sregionscript.md#shared)`get` |
| SWebservice [**WebServices** ](/scripting/server-scripting-api-reference/region/sregionscript.md#webservices)`get` |
| string [**RuntimeType** ](/scripting/server-scripting-api-reference/region/sregionscript.md#runtimetype)`get` |
| bool [**InEditor** ](/scripting/server-scripting-api-reference/region/sregionscript.md#ineditor)`get` |
| float [**TimeSinceAwake** ](/scripting/server-scripting-api-reference/region/sregionscript.md#timesinceawake)`get` |
| string [**DateTimeUTC** ](/scripting/server-scripting-api-reference/region/sregionscript.md#datetimeutc)`get` |
| int [**LocalTimeUnix** ](/scripting/server-scripting-api-reference/region/sregionscript.md#localtimeunix)`get` |
| int [**ServerTimeUnix** ](/scripting/server-scripting-api-reference/region/sregionscript.md#servertimeunix)`get` |
##### Events Index[β](#events-index "Direct link to Events Index")
| Event |
| -------------------------------------------------------------------------------------------------------------------------------------------- |
| Action< int > [**OnAvatarJoin**](/scripting/server-scripting-api-reference/region/sregionscript.md#onavatarjoin) |
| Action< int > [**OnAvatarLeave**](/scripting/server-scripting-api-reference/region/sregionscript.md#onavatarleave) |
| Action< string, Table > [**OnScriptServerMessage**](/scripting/server-scripting-api-reference/region/sregionscript.md#onscriptservermessage) |
#### Functions[β](#functions "Direct link to Functions")
##### Log[β](#log "Direct link to Log")
void **Log** (string message)
*Log a message to console. (only works on preview grid)*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.Log("Log")
```
* Lua
```lua
--Clicking the object will make the server script log "Test Message" on all clients
--server script
function OnScriptServerMessage(key, table)
if key == "testKey" then
Space.Log("Message:" .. table[1])
end
end
--client script
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"Test Message"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### SubscribeToNetwork[β](#subscribetonetwork "Direct link to SubscribeToNetwork")
void **SubscribeToNetwork** (string key)
*Subscribe to network messages on "key".*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.SubscribeToNetwork("thekey")
```
##### UnsubscribeFromNetwork[β](#unsubscribefromnetwork "Direct link to UnsubscribeFromNetwork")
void **UnsubscribeFromNetwork** (string key)
*Unsubscribe from network messages on "key".*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.UnsubscribeFromNetwork("thekey")
```
##### SendMessageToAllClientScripts[β](#sendmessagetoallclientscripts "Direct link to SendMessageToAllClientScripts")
void **SendMessageToAllClientScripts** (string messageName, Table message)
*Sends a network message to all client scripts.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.SendMessageToAllClientScripts("thekey",{"themessage"})
```
* Lua
```lua
--Clicking the object by a single client will send a message to the server which triggers a message response to all clients
--server script--
function OnScriptServerMessage(key, table)
if key == "testKey" then
Space.SendMessageToAllClientScripts("ServerResponse",{"message response to all client scripts in region that are subscribed to this key"})
end
end
--client script--
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"Test Message"})
end
OnReceiveFunction = function(SNetworkMessage)
Space.Log(SNetworkMessage.Key)
Space.Log(SNetworkMessage.Message[1])
end
Space.Network.SubscribeToNetwork("ServerResponse", OnReceiveFunction)
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### SendMessageToClientScripts[β](#sendmessagetoclientscripts "Direct link to SendMessageToClientScripts")
void **SendMessageToClientScripts** (ulong playerID, string messageName, Table message)
*Sends a network message to a client script belonging to a specific player*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.SendMessageToClientScripts(playerID,"thekey",{"themessage"})
```
* Lua
```lua
--Clicking the object by a single client will send a message to the server which triggers...
--a message response only to that specific client
--server script--
function OnScriptServerMessage(key, table)
if key == "testKey" then
local sender = table[2]
Space.SendMessageToClientScripts(sender,"ServerResponse",{"a message response to the clicker's client script in region that is subscribed to this key"})
end
end
--client script--
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
id = Space.Scene.PlayerAvatar.ID
Space.Network.SendNetworkMessage("testKey",{"Test Message", id})
end
OnReceiveFunction = function(SNetworkMessage)
Space.Log(SNetworkMessage.Key)
Space.Log(SNetworkMessage.Message[1])
end
Space.Network.SubscribeToNetwork("ServerResponse", OnReceiveFunction)
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### StartCoroutine[β](#startcoroutine "Direct link to StartCoroutine")
void **StartCoroutine** (DynValue coroutine, DynValue parameter=default(DynValue)) void **StartCoroutine** (string name, DynValue parameter=default(DynValue))
*Runs the given function as a coroutine. A parameter is optional.*
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| | | |
* Lua
```lua
Space.StartCoroutine(AFunctionName)
```
* Lua
```lua
--Clicking the object on client will trigger a 3 second countdown on server script using coroutine
--server script--
function OnScriptServerMessage(key, table)
if key == "testKey" and table[1] == "Timer" then
Space.StartCoroutine(TimerCoroutine)
end
end
function TimerCoroutine()
local time = 0
while time < 3 do
Space.Log(3-time)
time = time + 1
coroutine.yield(1)
end
end
--client script--
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
Space.Network.SendNetworkMessage("testKey",{"Timer"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
#### Properties[β](#properties "Direct link to Properties")
##### ScriptID[β](#scriptid "Direct link to ScriptID")
string **ScriptID** `get`
*Returns a unique identifier of this script runtime. (can be found in "/list\_scripts" window on preview.)*
* Lua
```lua
scriptID = Space.ScriptID
```
* Lua
```lua
--Clicking the object on client will make the server script log it's ScriptID
--server script--
function OnScriptServerMessage(key, table)
if key == "testKey" and table[1] == "ScriptID" then
Space.Log(Space.ScriptID)
end
end
--client script--
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
Space.Network.SendNetworkMessage("testKey",{"ScriptID"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### InstanceID[β](#instanceid "Direct link to InstanceID")
uint **InstanceID** `get`
*Returns a unique identifier for the instance of the region. Useful in the case of multiple shards/instances being used. InstanceID does not necessarily equal to the RegionID, even if there's only one instance running.*
* Lua
```lua
instance = Space.InstanceID
```
* Lua
```lua
--Clicking the object on client will make the server script log only...
--if it's instanceID matches with client's instanceID
--server script--
function OnScriptServerMessage(key, table)
local instanceID = Space.InstanceID
if key == "testKey" and table[1] == "ScriptID" and table[2] == instanceID then
Space.Log(instanceID)
end
end
--client script--
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
local instanceID = Space.Scene.InstanceID
Space.Network.SendNetworkMessage("testKey",{"ScriptID", instanceID})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### RegionID[β](#regionid "Direct link to RegionID")
ulong **RegionID** `get`
*Returns a unique identifier for the region. (Same ID seen in curator)*
* Lua
```lua
region = Space.RegionID
```
* Lua
```lua
--Clicking the object on client will make the server script log only...
--if it's RegionID matches with client's RegionID
--server script--
function OnScriptServerMessage(key, table)
local RegionID = Space.RegionID
if key == "testKey" and table[1] == "ScriptID" and table[2] == RegionID then
Space.Log(RegionID)
end
end
--client script--
thisObject = Space.Host.ExecutingObject
function OnClickFunction()
local RegionID = Space.Scene.RegionID
Space.Network.SendNetworkMessage("testKey",{"ScriptID", RegionID})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### Scene[β](#scene "Direct link to Scene")
[SScene](/scripting/server-scripting-api-reference/region/sscene.md) **Scene** `get`
*Access to the SScene class methods and properties.*
* Lua
```lua
Space.Scene
```
##### Database[β](#database "Direct link to Database")
[SDatabase](/scripting/server-scripting-api-reference/storage/sdatabase.md) **Database** `get`
*Access to the SDatabase class methods and properties.*
* Lua
```lua
Space.Database
```
##### Math[β](#math "Direct link to Math")
[SMath](/scripting/server-scripting-api-reference/library/smath.md) **Math** `get`
*Access to the SMath class methods and properties.*
* Lua
```lua
Space.Math
```
##### Shared[β](#shared "Direct link to Shared")
[SShared](/scripting/server-scripting-api-reference/network/sshared.md) **Shared** `get`
*Access to the SShared class methods and properties.*
* Lua
```lua
Space.Shared
```
##### WebServices[β](#webservices "Direct link to WebServices")
[SWebservice](/scripting/server-scripting-api-reference/network/swebservice.md) **WebServices** `get`
*Access to the SWebservice class methods and properties.*
* Lua
```lua
Space.WebServices
```
##### RuntimeType[β](#runtimetype "Direct link to RuntimeType")
string **RuntimeType** `get`
*Returns "Server" if this script is a Server script*
* Lua
```lua
type = Space.RuntimeType
```
##### InEditor[β](#ineditor "Direct link to InEditor")
bool **InEditor** `get`
*Returns true if in Editor. (this will return false on server scripts)*
* Lua
```lua
IsInEditor = Space.InEditor
```
##### TimeSinceAwake[β](#timesinceawake "Direct link to TimeSinceAwake")
float **TimeSinceAwake** `get`
*Time, in seconds, since this script runtime has been awake.*
* Lua
```lua
SecondsAwake = Space.TimeSinceAwake
```
* Lua
```lua
--Clicking the object will make the server script log it's TimeSinceAwake on all clients
--server script
function OnScriptServerMessage(key, table)
if key == "testKey" and table[1] == "TimeSinceAwake" then
Space.Log(Space.TimeSinceAwake)
end
end
--client script
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"TimeSinceAwake"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### DateTimeUTC[β](#datetimeutc "Direct link to DateTimeUTC")
string **DateTimeUTC** `get`
*Returns a string of the current Date/Time in UTC*
* Lua
```lua
DateAndTime = Space.DateTimeUTC
```
* Lua
```lua
--Clicking the object will make the server script log it's DateTimeUTC on all clients
--server script
function OnScriptServerMessage(key, table)
if key == "testKey" and table[1] == "DateTimeUTC" then
Space.Log(Space.DateTimeUTC)
end
end
--client script
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"DateTimeUTC"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### LocalTimeUnix[β](#localtimeunix "Direct link to LocalTimeUnix")
int **LocalTimeUnix** `get`
*Returns the current Unix time (in seconds) (same as ServerTimeUnix)*
* Lua
```lua
unixtime = Space.LocalTimeUnix
```
* Lua
```lua
--Clicking the object will make the server script log it's LocalTimeUnix on all clients
--server script
function OnScriptServerMessage(key, table)
if key == "testKey" and table[1] == "LocalTimeUnix" then
Space.Log(Space.LocalTimeUnix)
end
end
--client script
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"LocalTimeUnix"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
##### ServerTimeUnix[β](#servertimeunix "Direct link to ServerTimeUnix")
int **ServerTimeUnix** `get`
*Returns the current Unix time (in seconds) (same as LocalTimeUnix)*
* Lua
```lua
unixtime = Space.ServerTimeUnix
```
* Lua
```lua
--Clicking the object will make the server script log it's ServerTimeUnix on all clients
--server script
function OnScriptServerMessage(key, table)
if key == "testKey" and table[1] == "ServerTimeUnix" then
Space.Log(Space.ServerTimeUnix)
end
end
--client script
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"ServerTimeUnix"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
#### Events[β](#events "Direct link to Events")
##### OnAvatarJoin[β](#onavatarjoin "Direct link to OnAvatarJoin")
Action< int > **OnAvatarJoin**
*An event function which will be called whenever an Avatar joins and will also contain the Avatar's ID as a parameter.*
* Lua
```lua
function OnAvatarJoin(playerID)
end
```
* Lua
```lua
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
Space.Log("Avatar with ID " .. id .. "has joined")
Space.Log("Number of avatars connected: " .. numOfAvatars)
end
```
##### OnAvatarLeave[β](#onavatarleave "Direct link to OnAvatarLeave")
Action< int > **OnAvatarLeave**
*An event function which will be called whenever an Avatar leaves and will also contain the Avatar's ID as a parameter.*
* Lua
```lua
function OnAvatarLeave(playerID)
end
```
* Lua
```lua
function OnAvatarLeave(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
Space.Log("Avatar with ID " .. id .. "has left")
Space.Log("Number of avatars connected: " .. numOfAvatars)
end
```
##### OnScriptServerMessage[β](#onscriptservermessage "Direct link to OnScriptServerMessage")
Action< string, Table > **OnScriptServerMessage**
*An event function which will be called whenever the server script receives a Network Message, and will contain the network message key String and message Table as a parameter.*
* Lua
```lua
function OnScriptServerMessage(key, table)
theKeyString = key
theSNetworkMessageTable = table
end
```
* Lua
```lua
--Clicking the object will make the server script log "Test Message" on all clients
--server script
function OnScriptServerMessage(key, table)
if key == "testKey" then
Space.Log("Message:" .. table[1])
end
end
--client script
thisObject = Space.Host.ExecutingObject
OnClickFunction = function()
Space.Network.SendNetworkMessage("testKey",{"Test Message"})
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClickFunction)
```
---
### SScene
#### Index[β](#index "Direct link to Index")
##### Properties Index[β](#properties-index "Direct link to Properties Index")
| Property |
| ------------------------------------------------------------------------------------------------------------- |
| int [**ConnectedAvatars** ](/scripting/server-scripting-api-reference/region/sscene.md#connectedavatars)`get` |
| Table [**Avatars** ](/scripting/server-scripting-api-reference/region/sscene.md#avatars)`get` |
| Table [**Cells** ](/scripting/server-scripting-api-reference/region/sscene.md#cells)`get` |
| SParcelManager [**Parcels** ](/scripting/server-scripting-api-reference/region/sscene.md#parcels)`get` |
#### Properties[β](#properties "Direct link to Properties")
##### ConnectedAvatars[β](#connectedavatars "Direct link to ConnectedAvatars")
int **ConnectedAvatars** `get`
*Returns the number of Avatars connected to the region.*
* Lua
```lua
numOfAvatars = Space.Scene.ConnectedAvatars
```
* Lua
```lua
function OnAvatarJoin(id)
local numOfAvatars = Space.Scene.ConnectedAvatars
Space.Log("Avatar with ID " .. id .. "has joined")
Space.Log("Number of avatars connected: " .. numOfAvatars)
end
```
##### Avatars[β](#avatars "Direct link to Avatars")
Table **Avatars** `get`
*Returns a table of SAvatar objects currently in the region*
* Lua
```lua
currentAvatars = Space.Scene.Avatars
```
##### Cells[β](#cells "Direct link to Cells")
Table **Cells** `get`
*Returns a table of SCell objects. (Not all cells are available at all times, a client on this server must be within 384m of a cell in order for it to exist.)*
* Lua
```lua
cellsTable = Space.Scene.Cells
```
##### Parcels[β](#parcels "Direct link to Parcels")
[SParcelManager](/scripting/server-scripting-api-reference/region/sparcelmanager.md) **Parcels** `get`
*Access to the SParcelManager class.*
* Lua
```lua
Space.Scene.Parcels
```
---
### Storage
Persistent server-side storage for your region, including the database API for saving and querying data.
---
### SDatabase
#### Index[β](#index "Direct link to Index")
##### Functions Index[β](#functions-index "Direct link to Functions Index")
| Function |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void [**GetRegionValue** ](/scripting/server-scripting-api-reference/storage/sdatabase.md#getregionvalue)(string key, Closure onResult) |
| void [**SetRegionValue** ](/scripting/server-scripting-api-reference/storage/sdatabase.md#setregionvalue)(string key, string value, Closure onSave) |
| void [**GetPlayerValue** ](/scripting/server-scripting-api-reference/storage/sdatabase.md#getplayervalue)(int player, string key, Closure onResult) |
| void [**SetPlayerValue** ](/scripting/server-scripting-api-reference/storage/sdatabase.md#setplayervalue)(int player, string key, string value, Closure onSave) |
#### Functions[β](#functions "Direct link to Functions")
##### GetRegionValue[β](#getregionvalue "Direct link to GetRegionValue")
void **GetRegionValue** (string key, Closure onResult)
*Get a value stored in the region database. (this does not access the same database as the SPersistence class)*
| Parameter | Type | Description |
| --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key | string | The "key" to access the record from the region database. |
| onResult | Closure | The name of the function which will be called once the results are ready. This function will be called with a string parameter containing the requested value. onResult(value) |
* Lua
```lua
function onResult(value)
yourValue = value
end
Space.Database.GetRegionValue("testKey", onResult)
```
##### SetRegionValue[β](#setregionvalue "Direct link to SetRegionValue")
void **SetRegionValue** (string key, string value, Closure onSave)
*Store a "value" in the region database. (this does not access the same database as the SPersistence class)*
| Parameter | Type | Description |
| --------- | ------- | ------------------------------------------------------------------------------------------------------ |
| key | string | The "key" to access the record from the region database. |
| value | string | The "value" that will be stored in the region database. |
| onSave | Closure | The name of the function which will be called when the "value" has been stored in the region database. |
* Lua
```lua
function onSave()
--
end
Space.Database.SetRegionValue("testKey", "testValue", onSave)
```
##### GetPlayerValue[β](#getplayervalue "Direct link to GetPlayerValue")
void **GetPlayerValue** (int player, string key, Closure onResult)
*Get a value stored in a player database. (this does not access the same database as the SPersistence class)*
| Parameter | Type | Description |
| --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| player | int | The ID of the player's database in whose record we will access. |
| key | string | The "key" to access the record from the region database. |
| onResult | Closure | The name of the function which will be called once the results are ready. This function will be called with a string parameter containing the requested value. onResult(value) |
* Lua
```lua
function onResult(value)
yourValue = value
end
Space.Database.GetPlayerValue(aPlayerID,"testKey",onResult)
```
##### SetPlayerValue[β](#setplayervalue "Direct link to SetPlayerValue")
void **SetPlayerValue** (int player, string key, string value, Closure onSave)
*Store a "value" in a player database. (this does not access the same database as the SPersistence class). (this does not access the same database as the SPersistence class)*
| Parameter | Type | Description |
| --------- | ------- | ------------------------------------------------------------------------------------------------------ |
| player | int | The ID of the player's database in whose record we will access. |
| key | string | The "key" to access the record from the region database. |
| onSave | Closure | The name of the function which will be called when the "value" has been stored in the player database. |
* Lua
```lua
function onSave()
--
end
Space.Database.SetPlayerValue(aPlayerID,"testKey", "testValue",onSave)
```
---
### Support
#### [ποΈReport An Issue](/scripting/support/report-an-issue.md)
[How to report issues within the Sinespace Scripting Documentation](/scripting/support/report-an-issue.md)
---
### Report An Issue
##### How to report an issue with this documentation[β](#how-to-report-an-issue-with-this-documentation "Direct link to How to report an issue with this documentation")
If you would like to report any issues with this documentation such as corrections, lack of documentation, or improvements in the quality, please use [this form ](https://form.asana.com/?k=foybfPQQIK5JpFVRRcPyJg\&d=634886966090241)and select **Scripting** as the type of documentation.
---
## Tips For Success
### TIPS FOR SUCCESS
#### [ποΈRegion Editor best practices](/tips-for-success/region-editor-best-practices.md)
[Breakroom's Region Editor is intuitive and powerfulβonce you get the hang of it! Here you'll find tips and shortcuts collected from some of our most skilled Region designers.](/tips-for-success/region-editor-best-practices.md)
---
### Onboarding new users
#### Overview[β](#overview "Direct link to Overview")
Breakroom is designed to be simple to learn, so that users can log in and get straight to workβwhether that work consists of attending team meetings, pursuing professional education, or manning an exposition booth. Still, with a little extra planning, you can set your Breakroom users up for success. The following resources and best practice tips are designed to help you create the ideal events schedule, design user orientation programming, and clear potential logistical hurdles. Get your users on the platform, get them oriented, and watch them thrive in the Metaverse.
#### Orienting first-time users [](#orienting-first-time-users)[β](#orienting-first-time-users- "Direct link to orienting-first-time-users-")
The Breakroom Team recommends a three-step approach for getting users logged in and chatting with coworkers or fellow event attendees.
1. **Access the platform.** First, users need to get Breakroom running! Be sure to point them to information on [World Stream](/opening-the-doors/world-stream.md) and our [desktop viewers](/opening-the-doors/desktop-viewers.md) if they need help.
2. **Enter your email address.** Remind users that unless otherwise specified, they should log in using their work email address and provided password. For [Eventbrite ticketholders](/opening-the-doors/creating-and-managing-user-accounts/eventbrite-integration.md), their login will be their email address and their Eventbrite ticket number.
3. **Switch on your microphone.** Once users are logged in, they should test their ability to use [voice chat](/getting-started/using-the-conference-system.md#voice-chat). If they encounter issues, be sure to point them toward our [troubleshooting guides](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md).
info
For the best possible experience, we recommend that users access World Stream using Google Chrome. **Please also remind users to close any other open apps or programs on their computer, and to turn off their VPNs.**
No other steps are necessary to join in the bustle of Breakroomβbut your users will definitely look forward to customizing their avatars, exploring your Regions, and connecting with other attendees. Here are some quick links to additional resources that can help.
1. [Getting Started](/getting-started.md): The first section of the Breakroom GitBook is written entirely from the user's perspective, and teaches new users how to:
* Control their [avatar](/getting-started/controlling-your-avatar.md) and [camera](/getting-started/controlling-your-camera.md)
* Pick a [starter avatar](/getting-started/customizing-your-avatar/choosing-a-starter-avatar.md) and make it their own using the [Outfit window](/getting-started/customizing-your-avatar/editing-avatars-in-the-outfit-window.md) and [Sinewave Shop](/getting-started/customizing-your-avatar/using-the-sinewave-shop.md)
* Use the conference system to [chat](/getting-started/using-the-conference-system.md#voice-chat), share their [webcam](/getting-started/using-the-conference-system.md#webcam-streaming), and [ask questions](/getting-started/using-the-conference-system.md#submitting-questions) at events
* Explore Breakroom using the Region [navigation tools](/exploring-breakroom/region-navigation-tools.md) and [Explore window](/exploring-breakroom/using-the-explore-window.md)
* ...and more!
2. Videos: Breakroom offers a [video walkthrough](https://youtube.com/playlist?list=PLMmBhuOTME3VI-DyfTsLfBAAE9tQNrEsy\&feature=shared) for beginners. Each video in the playlist is designed to quickly answer common user questions.
3. Orientation Regions: When designing your World, you may want to create one or more [Orientation Regions](/building-new-worlds/default-landing-and-orientation-regions.md#orientation-regions) where first-time visitors can take advantage of an [interactive tutorial](/creating-custom-experiences/exploring-the-breakroom-toolkit/breakroom-orientation-quest.md).
4. Triage zones: You may also consider creating [triage zones](/running-your-event/customizing-the-conference-system-components/designating-triage-zones.md) staffed with team members who can help users troubleshoot common issues.
#### Onboarding speakers and VIPs[β](#onboarding-speakers-and-vips "Direct link to Onboarding speakers and VIPs")
Breakroom's Customer Success, Sales, and Marketing Teams bring a wealth of knowledge to the table when it comes to helping World Owners host virtual events. Here are some of their top tips.
1. **Speakers will need extra attention and orientation time.** Take time before the event to connect with each speaker individually and gauge their level of comfort with the platform. Some key things to ask them are:
1. Do you understand how to get around the Region?
2. Do you want to control your avatar yourself, or do you want a member of our team to move your avatar for you?
3. Do you want to take live questions from the audience, or do you want a moderator to take questions for you?
4. How do you want to leave the stage when you are done with your presentation? Do you want to click-teleport to a chair, walk off the stage, teleport to another area?
2. **Plan on at least 45 minutes of rehearsal and tech tests for each speaker.** Hold these rehearsals prior to the day of the event, so you have plenty of time to address any issues that arise. Use this time to run through every presentation slide and video and confirm that audio is working.
3. **After coming up with a stage management plan for each speaker and panel, draw up a comprehensive event schedule for the backstage coordinators.** Be sure to include any needed buffer time and special notes.
info
During rehearsals and tech tests, make sure that speakers log in and present from the computer they plan to use on the day of the event. You don't want to encounter any surprises on your big day!
#### Device testing[β](#device-testing "Direct link to Device testing")
As part of Breakroom's [conference system](/getting-started/using-the-conference-system.md), we offer built-in device testing. To access this service, all users need to do is click the **Device Options >** **Device Testing button** at the top of the screen.

*Pictured: The troubleshooting tools available under Device Options.*
This will open a dedicated testing panel. Here users can verify if their audio and video devices are working, see which devices are currently being used by Breakroom, test their speakers, and check their audio volume. You can learn more about these functions on our [device troubleshooting page](/getting-started/using-the-conference-system/troubleshooting-audio-and-video-issues.md).
In addition to this resource, the following tips will help your users get the best possible experience.
1. If users are accessing Breakroom via the [desktop viewer](/opening-the-doors/desktop-viewers.md), we suggest that they shut down all other applications running on their computer.
2. If users are accessing Breakroom via [World Stream](/opening-the-doors/world-stream.md), they should shut down any applications other than their browser and close any unneeded browser tabs or windows.
3. **Headphones are strongly suggested**\*\*\*.\*\*\* Please ensure that your users and speakers are properly outfitted with headphones in order to avoid audio problems.
4. The balance option located within the computer sound settings can be used to cut down on unwanted audio feedback. On Windows 10 machines, you can locate this option by opening the **Settings** and searching for "**balance**." Please see our [World Stream section](/opening-the-doors/world-stream/troubleshooting-world-stream-issues-on-chrome.md) for more information about adjusting the audio balance on macOS.
---
### Region Editor best practices
[YouTube video player](https://www.youtube.com/embed/YUBB-Gwc-pM)
#### Using the desktop app [](#using-the-desktop-app)[β](#using-the-desktop-app- "Direct link to using-the-desktop-app-")
For the best possible experience when positioning objects in your Regions, we recommend using the Breakroom [desktop viewer](/opening-the-doors/desktop-viewers.md). You *can* use Region Editor with [World Stream](/opening-the-doors/world-stream.md)βthe functionality is the same. However, the desktop viewer offers faster feedback and is slightly smoother to use.
#### Positioning your camera [](#positioning-your-camera)[β](#positioning-your-camera- "Direct link to positioning-your-camera-")
##### Region Editor avatar and camera commands [](#region-editor-avatar-and-camera-commands)[β](#region-editor-avatar-and-camera-commands- "Direct link to region-editor-avatar-and-camera-commands-")
While using the Region Editor, you will most likely want to focus your camera on a particular object or area. When you open Region Editor, the camera will be in *object mode* by default. To instantly focus your camera on a particular object, **click on the item** in your [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window), then move your cursor to a scene area and press the **F key**.

*Highlighted: The location of the Avatar Move button.*
Alternatively, you can click the [**Avatar Move button**](/creating-custom-experiences/using-the-region-editor.md#object-positioning-and-editing-tools) to switch to *avatar mode*. This gives you the ability to move your avatar through the Region while you work, with the camera following you. Click the button again to lock your avatar into place.
##### Fly cam [](#fly-cam)[β](#fly-cam- "Direct link to fly-cam-")
Fly cam is another useful way to explore your surroundings. To enable it, hold down your **right mouse button (RMB)**. You can then use the **A and D keys** to pan from side, the **R and C keys** to pan up and down, and the **W and S keys** to zoom in and out. You can also orbit items in this mode by moving your mouse. The camera can be returned to its original, avatar-locked position by pressing the **Esc key** twice.
##### Latch cam [](#latch-cam)[β](#latch-cam- "Direct link to latch-cam-")
Latch cam allows you to choose a specific object as your current focus point. You can then move the camera around it using the commands detailed above. To "latch" your camera onto an object, hold down the **Alt key** and click on the object with your **right mouse button (RMB)**.
#### Undo and Redo buttons [](#undo-and-redo-buttons)[β](#undo-and-redo-buttons- "Direct link to undo-and-redo-buttons-")

*Highlighted: The location of the Undo and Redo buttons.*
The Undo and Redo buttons in the Region Editor are comparable to the undo and redo buttons in a graphics editing application, and are designed to allow you to skip forwards and backwards in time for the current editing session. You can use the Undo button to correct mistakes in the momentβfor example, if you rotate an object and decide you don't like how it looks, click the **Undo button** to restore it to its previous position. You can also undo your last step by pressing **Ctrl + Z** on your keyboard.
#### Selecting and editing multiple objects [](#selecting-and-editing-multiple-objects)[β](#selecting-and-editing-multiple-objects- "Direct link to selecting-and-editing-multiple-objects-")
To select items within a Region for editing, you can either click on the item itself or click on its name in the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window). To select multiple items at the same time, hold down the **Ctrl key** on your keyboard and click the items or item names you wish to edit.

*Pictured: Two items selected at the same time by holding down the Ctrl key.*
When two or more items are selected at once, you can edit their position as a group using the [Region Editor gizmos](/creating-custom-experiences/using-the-region-editor/editing-and-moving-objects.md). They will move, rotate, and scale together.
You can also bulk-select items using the Objects window. To do so, **click the first item** in the series you would like to select. Then, while holding down the **Shift key**, c**lick the last item** in the series. This will highlight all of the objects at once.
#### Changing object Display Names [](#changing-object-display-names)[β](#changing-object-display-names- "Direct link to changing-object-display-names-")
If you add multiple copies of any object to your Region, you will notice that every copy is identified by the same *Display Name* in the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window). By entering more descriptive object Display Names, you can make it easier to keep track of your items and locate them when needed.

*Pictured: A Region that contains three copies of the same item (Stretch Statue #1). The Display Name for one of these objects has been changed. By changing an object's Display Name, you can more efficiently locate and identify items.*
To change the Display Name of an object, follow the steps below.
1. Open the [Region Editor](https://docs.breakroom.tech/customization/using-the-region-editor) by clicking the **Edit Region button** located in the [top toolbar](/getting-started/ui-tour.md#the-top-toolbar).
2. Click the **Objects Button** to launch the [Objects window](/creating-custom-experiences/using-the-region-editor.md#the-objects-window).
3. In the Objects window, locate the object you want to edit. (Tip: You can use the search field at the top of the window to search for a specific object.) Click on the **object name** to launch the Inspector window.
4. In the Inspector window, locate the **Display Name field**. Enter the **display name** you want to use.
5. Click the **Save button** to store your changes, and the **Close button** to exit the Region Editor.
warning
You cannot change the Display Name of breakout area, voice zone, and voice zone furniture objects.
#### Changing Region templates [](#changing-region-templates)[β](#changing-region-templates- "Direct link to changing-region-templates-")
You can switch to another Region template from within the Region Editor. To do so, follow the instructions below.
1. Navigate to the Region you want to change.
2. Open the [Region Editor](https://docs.breakroom.tech/customization/using-the-region-editor) by clicking the **Edit Region button** located in the [top toolbar](/getting-started/ui-tour.md#the-top-toolbar).
3. Click the **Inventory button** to open the [Inventory window](/creating-custom-experiences/using-the-region-editor.md#the-inventory-window).
4. Along the left side of the Inventory window, you will see several category tabs. Click on the **Region category.**
5. Click on the **Region template item** that you would like to use.
6. Confirm the change by clicking the **Swap Template button**.
7. Click the **Save button** to store your changes, and the **Close button** to exit the Region Editor.
danger
When switching Region templates, all furniture objects you have set down and any custom changes you have made to the original Region will be erased. These lost changes cannot be recovered, so please consider this step carefully.
#### Giving Region editing permissions to other users[β](#giving-region-editing-permissions-to-other-users "Direct link to Giving Region editing permissions to other users")
By making another user a [Region Administrator](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md#administrator), you can grant limited in-world editing permissions. Region Administrators can access the [Region Editor](/creating-custom-experiences/using-the-region-editor.md) for their assigned Region, as well as the [moderator tools](/running-your-event/moderator-tools.md) and the [Region Information window](/building-new-worlds/region-settings.md). However, they will not be able to log in to your [Dashboard](/building-new-worlds/breakroom-dashboard-tour.md).
Alternatively, you can appoint a [Region Developer](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md#developer) for any Region that you own. Region Developers have access to the Region Editor, and can decorate and modify the Region to which they are assigned. They do not occupy a [Developer seat](/opening-the-doors/seats-and-concurrency.md), and cannot upload content to your World.
To grant these advanced [Region-level permissions](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md), follow the steps below.
1. Click on the mini map. (If not enabled, click on the **Minimap button** in the [top toolbar](/getting-started/ui-tour.md#the-top-toolbar).) This will open the Region Information window.
2. Click on the **Members tab**, and then the **Add Members button**. This will open the "Add new members" dialog box.
3. Use the **search field** to search for the user's name. When you find it, click the **Add button**.
4. Once the user is added to the Region members list, check the **box** next to their name and then click on the **Set Role drop-down menu**. From this menu, select the permissions level you'd like to assign the user.
To revoke advanced Region-level permissions, follow steps 1-4 above, and select either the *Member* or *Guest* role. If you prefer, you can also [remove](/opening-the-doors/creating-and-managing-user-accounts/region-level-user-permissions.md#removing-region-members) the user from the members list entirely.
warning
You should only assign Administrator or Developer status to trusted individuals who understand how to use the Breakroom tools. Changes made in the Region Editor may not be easy to revert.
---
|