# Sansar Docs: Complete documentation > Every page of Sansar Docs # Sansar Docs > Learn to explore worlds, build your own and sell what you make in Sansar. The Sansar docs cover the Sansar client and sansar.com: exploring worlds, building and scripting your own, the Store and Sansar Dollars, and getting help. See the [Script API reference](/scripting/api) and the [patch notes](/patch-notes) for what changed in each release. Source: https://docs.sansar.com/ --- # Get started > Install Sansar, check that your PC can run it, and take your first steps in a world. - [Installing Sansar](/get-started/install) - [Quick Start: Exploring in Sansar](/get-started/quick-start) - [System Requirements](/get-started/system-requirements) - [Sansar Compatibility FAQ](/get-started/compatibility-faq) - [Sansar on Mac](/get-started/running-sansar-on-mac) - [Configuring Firewalls](/get-started/configuring-firewalls) ## See also - [Create your Sansar account](/account/create-account) - [Using sansar.com](/help/using-sansar-com) Source: https://docs.sansar.com/get-started --- # Installing Sansar System Requirements For a list of recommended and minimum system specifications for people using desktop only or desktop with VR headsets, please see [System requirements](/get-started/system-requirements.md). Install Sansar To install Sansar: 1. Download the client from the [Sansar Download page](https://www.sansar.com/download). 2. Locate the file in your browser's download folder. 3. Double click **SansarInstaller.exe** to start the installer. 4. Agree to install the program. 5. The Sansar Installer appears. Click **Next** to begin the installation process. 6. Review the License Agreement, select the box to **Accept**, and click **Next**. 7. You may choose an alternate install location for Sansar, and choose to add shortcuts to the desktop and startup menu. 8. Click **Install** to install Sansar. 9. Click **Launch** to run the Sansar Updater. 10. The Updater installs the latest version of Sansar and launches the program. **Note:** Sansar is also available for download on the Steam platform. For information about how to install Sansar with Steam, see [Steam integration](/account/steam-integration.md) Upgrading Sansar It is not necessary to uninstall Sansar to install the latest version. The Sansar Updater automatically checks for and installs the newest version of Sansar. Uninstall Sansar To uninstall Sansar: 1. Access the Windows control panel. 2. On the control panel, select **Uninstall a program** under Programs. 3. Choose Sansar from the list of programs. 4. Click **Uninstall**. This opens the Sansar Installer. 5. Follow the prompts on the Sansar Installer to uninstall Sansar. Source: https://docs.sansar.com/get-started/install --- # Quick Start: Exploring in Sansar After you have [installed Sansar](/get-started/install.md), chosen an [Avatar Name and Avatar ID](/account/avatar-name-id.md) and customized your avatar, you may wish to explore some of the worlds created by the Sansar community. ## Finding worlds

The Prime Portal Panel

The [Prime Portal in The Nexus](/explore/nexus.md#the-prime-portal) allows you to browse through a full list of worlds [that have been made public](/explore/nexus.md#visiting-a-new-world) by their creators. If you know the name of a world you would like to visit (or the name of the world's creator), you can search for them in the Prime Portal as well. When you find a world you would like to explore, move your mouse cursor over the world's image and click the **Visit** button that appears. You can also visit worlds by clicking their direct URL, which is a special kind of hyperlink that allows you to visit a world of whether it has been listed in the Prime Portal. World URLs may often be found on web pages or in text chat. For further information about the Prime Portal and The Nexus, see [The Nexus.](/explore/nexus.md) Once you have visited a world, you can revisit it at any time by finding it in your [_Codex_](/explore/codex.md), which has a similar interface to the Prime Portal but only contains worlds you have visited. You can open the Codex by choosing **Go > Codex** from the main menu. ### Exploring a world Once you arrive in an world, you may wish to move around and explore. You can walk, run, or teleport your avatar, as well as interact with dynamic objects. For a full listing of controls, see [Sansar controls.](/explore.md#controls) ## Walking and running

Walking and running are the simplest ways to get around in a world.

Walking or running is the simplest way to move short distances in Sansar: * **Keyboard -** To make your avatar walk, use the **arrow keys** or **W**, **A**, **S**, and **D**. To run, press **Shift**. You can also jump by pressing **Spacebar**. * **VR controller or game controller -** Use the **left thumbstick** or **left trackpad**. To run, press the left thumbstick while moving or (on HTC Vive) press and hold the left trackpad. You can jump by pressing **B** on Oculus or **Right Trackpad Down** on Vive. ## Teleporting

An avatar using the targeting beam to select a teleport destination and facing.

Teleporting allows you to move longer distances easily, and lets you bypass obstacles that you would not otherwise be able to traverse on foot. * **Keyboard -** Hold the **X** key to activate a targeting beam and use your mouse to select a destination. You can adjust your facing direction at the end of the teleport by using the mouse wheel. Click the left mouse button to teleport to the targeted spot. * **Gamepad -** Hold the right trigger to activate the targeting beam, use the right stick to select your destination, and use the left stick to adjust your facing at the and of the teleport. Release the right trigger to teleport to the targeted spot. * **Oculus Rift controller -** Hold **A** or **X** to activate the targeting beam, which emanates from your hand, use the stick on the opposite controller to adjust your facing at the end of the teleport, and then release the button to teleport. * **HTC Vive controller -** Hold Forward/Up on the right trackpad to activate the targeting beam, select a facing by moving your thumb on the trackpad while still holding down, and release the trackpad to teleport. ### Interacting with dynamic objects

An avatar holding a dynamic object.

[_Dynamic_ objects](/get-started/quick-start.md#interacting-with-dynamic-objects) in Sansar obey the laws of physics and can be moved by avatars and other objects. Using VR controls or a keyboard and mouse, you can pick up and throw dynamic objects. * **Keyboard** **-** Move close to the object and **left-click** it with your mouse to pick it up. You can drop or throw the object by clicking the mouse again. The longer you hold the mouse button before releasing, the farther you throw the object. While holding **left-click**, an aiming guide appears and you can use the **scroll wheel** to modify the distance you will throw the object. * **Gamepad** - Move close to the object and press the **A** button to pick it up. If there is more than one dynamic object nearby, you can choose between them by pressing left and right on the **D-pad**. To drop or throw an object you are holding, press the **A** button again. The longer you hold the button before releasing, the farther you throw the object. * **Oculus Rift controller** - When near a dynamic object, reach for it and hold one of the **grip** buttons to grasp the object. You can drop the object again by releasing the grip button. * **HTC Vive controller** - When near a dynamic object, reach for it and hold one of the **Trigger** buttons to grasp the object. You can drop the object again by releasing the trigger button. **Note:** It is possible to grab a dynamic object from another avatar's hand. This makes it easier to hand an object back and forth, but please be respectful of other peoples' activities. ## Sharing world URLs You can use the [Codex](/explore/codex.md) to get a world's URL\_.\_ URLs allow you to share the world with others, either in chat or outside Sansar on a website, email, or messenger application. When someone clicks a world's URL, they can view the world's profile and choose to visit. To get a world's URL: * Choose **Go > Codex** to open the [Codex.](/explore/codex.md) * Select one of your visited worlds from the Codex and click on the thumbnail to bring up the world's profile. * Select the **Copy URL** button. * The link is placed on your clipboard. * You can paste the link into Chat, email, or a web page. People can click on the link to visit that world without needing to find it through the [Prime Portal in The Nexus.](/explore/nexus.md#the-prime-portal)

Click the Copy URL button to copy a world's URL to your computer's clipboard. You can then paste the link in an email, web page, or chat message.

Source: https://docs.sansar.com/get-started/quick-start --- # System Requirements ## Recommended system specs for VR users | **Operating system** | 64-bit Windows 10 or newer | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **DirectX** | DirectX 11 or higher | | **CPU** | Intel i5-4590 / AMD FX 8350 equivalent or greater | | **Memory** | 8 GB+ RAM | | **Disk space** | 3 GB, plus additional disk space for VR Headset Installation | | **Video card** | NVIDIA GTX 970 / AMD Radeon R9 290 or greater | | **Bandwidth** | 10 Mbps recommended; 5 Mbps minimum. [Check your bandwidth](https://beta.speedtest.net/). | | **VR** | To experience Sansar on Vive, you must install [Steam](https://store.steampowered.com/about/) and Steam VR. Steam and Steam VR is not required for Oculus Rift. | | **Audio** | High-quality headphones recommended for an immersive spatial audio experience. Microphone required for voice chat. | | **Other** | Compatible HDMI 1.3 video output | | 2x USB 3.0 ports | | | **Optional** | Xbox One or Xbox 360 game controller | ## Minimum system specs for VR users | **Operating system** | 64-bit Windows 10 or newer | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **DirectX** | DirectX 11 | | **CPU** | Intel i3-6100 / AMD FX4350 | | **Memory** | 8 GB RAM | | **Disk space** | 3 GB, plus additional disk space for VR Headset Installation | | **Video card** | NVIDIA GTX 960 / AMD Radeon R9 290 or greater w/ 4 GB dedicated video memory | | **Bandwidth** | 10 Mbps recommended; 5 Mbps minimum. [Check your bandwidth](https://beta.speedtest.net/). | | **VR** | To experience Sansar on Vive, you must install [Steam](https://store.steampowered.com/about/) and Steam VR. Steam and Steam VR is not required for Oculus Rift. | | **Audio** | High-quality headphones recommended for an immersive spatial audio experience. Microphone required for voice chat. | | **Other** | Compatible HDMI 1.3 video output | | 2x USB 3.0 ports | | | **Optional** | Xbox One or Xbox 360 game controller | ## Recommended system specs for desktop-only users | **Operating** **system** | 64-bit Windows 10 or newer | | ------------------------ | ------------------------------------------------------------------------------------------------------------------ | | **DirectX** | DirectX 11 or higher | | **CPU** | Intel i5-4590 / AMD FX 8350 equivalent or greater | | **Memory** | 8 GB+ RAM | | **Disk space** | 3 GB | | **Video card** | GeForce GTX 760 or greater w/ 2 GB dedicated memory | | **Bandwidth** | 10 Mbps recommended; 5 Mbps minimum. [Check your bandwidth](https://beta.speedtest.net/). | | **Audio** | High-quality headphones recommended for an immersive spatial audio experience. Microphone required for voice chat. | | **Optional** | Xbox One or Xbox 360 game controller | ## Minimum system specs for desktop-only users | **Operating system** | 64-bit Windows 10 or newer | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **DirectX** | DirectX 11 | | **CPU** | Intel Core i3-2100 / AMD Phenom II X4 945 | | **Memory** | 4 GB RAM | | **Disk Space** | 3 GB | | **Video** **card** | NVIDIA GeForce GTX 450 or greater w/ 2GB dedicated video memory, AMD R9 280 or greater w/ 2GB dedicated video memory, Intel HD Graphics 5500 w/ 2GB dedicated memory | | **Bandwidth** | 10 Mbps recommended; 5 Mbps minimum. [Check your bandwidth](https://beta.speedtest.net/). | | **Audio** | High-quality headphones recommended for an immersive spatial audio experience. Microphone required for voice chat. | | **Optional** | Xbox One or Xbox 360 game controller | Source: https://docs.sansar.com/get-started/system-requirements --- # Sansar Compatibility FAQ ## Do I need VR to play Sansar? No, you do not need VR in order to enjoy Sansar. You can play Sansar without a VR headset in desktop mode. ## Which VR headsets are compatible with Sansar? We currently support both HTC Vive and Oculus Rift, Quest 2 To experience Sansar on Vive, you must install [Steam](https://store.steampowered.com/about/) and Steam VR. Steam and Steam VR are not required to run Sansar on the Oculus Rift. ## Why does my Windows Mixed Reality headset not work? We currently do not officially support Windows Mixed Reality (WMR) headsets. There are cases where some users have made it work in Sansar, but we do not guarantee that the headset will work 100% well with Sansar. ## Does Sansar support any VR body trackers? We currently support the [VIVE Tracker](https://www.vive.com/us/vive-tracker/). See [here](/explore/vr/body-tracking-vive.md) for more information on how to set it up to work in Sansar. ## Can I use a game controller to play Sansar? Yes, you can use the Xbox One or Xbox 360 game controller. See [Game controller buttons](/explore/controls/game-controller-buttons.md) for more information. ## When will Sansar be compatible with Mac? Sansar is currently only available on PC. We are working on official support for Mac. But an unofficial way is possible. See [Running sansar on mac](/get-started/running-sansar-on-mac.md) ## Will Sansar be compatible with the Oculus Quest or Quest 2? Sansar currently doesn't support the Oculus Quest or Quest 2 standalone. There are currently no plans to support it in the immediate future since the Oculus Quest and Quest 2 is not powerful enough to run Sansar standalone. However it is possible to use these headsets in PCVR mode with a link cable or via Airlink to play sansar. Source: https://docs.sansar.com/get-started/compatibility-faq --- # Sansar on Mac This is not supported officially but we have had some success at running sansar using this method. As this is unsupported use at your own risk and expect there may be some bugs. 1. Update your OS to the latest 2. Download the game porting toolkit here: [https://developer.apple.com/download/all/?q=game%20porting%20toolkit](https://developer.apple.com/download/all/?q=game%20porting%20toolkit) 3. Copy your Sansar game client folder over to your Mac C:\Program Files\Sansar\Client 4. Download this installer that will do all the work: [https://github.com/installaware/AGPT](https://github.com/installaware/AGPT) This is the file you need: [http://www.installaware.com/iamp/agpt.dmg](https://www.installaware.com/iamp/agpt.dmg) 5. - Run the Installer you just downloaded Choose the game porting toolkit and SansarClient.exe files as shown below
- During the installation you will see a window prompt pop up that says windows 7 in bottom of it. Change that drop down to windows10 - Done. Sansar should launch - To launch Sansar another time just run the game porting toolkit installer a second time, but you only need to select the SansarClient.exe Source: https://docs.sansar.com/get-started/running-sansar-on-mac --- # Configuring Firewalls ## Ports used by Sansar If you are having trouble updating or connecting to Sansar, you may need to configure your computer's or network's firewall (typically by [port forwarding](https://en.wikipedia.org/wiki/Port\_forwarding)) to allow the use of certain ports by your computer. The ports used by our services are as follows: | TCP | | | ----------- | ----------------------------------------- | | TCP and UDP | | ## Disabling UDP You can force Sansar to run without UDP by using the command line option: **`-networking.useTcp=true`** It is not ideal to use TCP only, and you may notice degraded performance. You should only attempt this solution if you believe UDP has been blocked by your network administrator and you cannot contact them to change your firewall's rules. Source: https://docs.sansar.com/get-started/configuring-firewalls --- # Account > Set up and manage your Sansar account: your name and handle, Steam and Discord, and deleting your account. - [Create a Sansar account](/account/create-account) - [Log in to sansar.com](/account/log-in) - [Log in with Steam](/account/log-in-with-steam) - [Reset your password](/account/reset-password) - [Account dashboard](/account/account-dashboard) - [Change your email address](/account/change-email) - [Change your password](/account/change-password) - [Avatar name and ID](/account/avatar-name-id) - [Join the Sansar Discord](/account/discord-faq) - [Steam integration](/account/steam-integration) - [Delete your account](/account/delete-account) Source: https://docs.sansar.com/account --- # Create a Sansar account > Create a Sansar account on sansar.com, confirm your email address with a code, and troubleshoot confirmation issues. Create a Sansar account on sansar.com using the [Create Your Account](https://www.sansar.com/account/register) page, then confirm your email address with a code sent to your inbox. ## Before you start - **Make sure you can access your email inbox.** Sansar sends a confirmation code to the email address you register with. - **Choose your handle carefully.** Your handle is unique to your account, and you can't change it later. See [Avatar name and ID](/account/avatar-name-id) for what **Display Name** and **Handle** mean.
## Create your account 1. Open [Create Your Account](https://www.sansar.com/account/register). You can also open [sansar.com](https://www.sansar.com) and select **Sign up** in the top bar (on a phone, open **Menu** and select **Sign up**). You can also select **Sign up** at the bottom of the [login page](https://www.sansar.com/login). 2. Under **Create Your Account**, fill in the required fields: - **Email:** Enter your email address. - **Display Name:** Enter the name shown for your avatar. See [Avatar name and ID](/account/avatar-name-id). - **Handle:** Enter a unique public handle (3 to 40 characters: lowercase letters, numbers, and single dashes between them). Sansar suggests an initial handle from your **Display Name** until you edit the field yourself. Check your handle before submitting, because you can't change it later. If it's available, the form shows "That handle is available." - **Password:** Enter a password between 8 and 256 characters long that includes at least one letter and one number. 3. Select **Create Account**. The button reads **Creating Account...** while sansar.com creates your account. sansar.com sends a confirmation code to your email address and opens **Confirm Your Email** with your email address already set. ## Confirm your email address 1. Open the email sent to your address and find the confirmation code. 2. If you opened [Confirm Your Email](https://www.sansar.com/account/register/confirm) directly, enter your registration email in **Email address**. 3. Enter your code in **Enter confirmation code**. 4. Select **Confirm**. The button reads **Confirming...** while sansar.com checks your code. After confirmation, the page displays "Your account has been confirmed!" with a **Log In** button. Select **Log In** to open the login page. ## Troubleshooting ### "Invalid code. Please try again." **Confirm Your Email** shows "Invalid code. Please try again." for any confirmation error. It doesn't distinguish between a mistyped code, an expired code, a wrong email address, or another issue. - Check the code in your registration email and make sure you entered the email address you registered with, then select **Confirm** again. - If it keeps failing, [contact support](/help/contact-support). ### You didn't receive a confirmation code The **Confirm Your Email** page has no resend button. - Check your inbox and spam folder for the registration email. - If no confirmation code arrives, [contact support](/help/contact-support). ### "Registration failed. Please try again." If registration fails, the form shows a field error or "Registration failed. Please try again." Check that **Email**, **Display Name**, **Handle**, and **Password** follow the rules above, then select **Create Account** again. If it keeps failing, [contact support](/help/contact-support). ### Verification link expired The [Verification Link Expired](https://www.sansar.com/verification-expired) page says: "This verification link has expired. Please request a new verification email from your account settings." The only button on this page is **Register Again**, which opens [Create Your Account](https://www.sansar.com/account/register). If you already registered or can't complete verification, [contact support](/help/contact-support). ### Email verified The separate [Email Verified](https://www.sansar.com/email-verified) page says: "Your email address has been successfully verified. You can now log in to your Sansar account." Select **Log In** to open the login page. ### No avatar found The [No Avatar Found](https://www.sansar.com/no-avatar) page says: "It looks like you don't have an avatar set up yet. Please create one to continue using Sansar." Select **Download Sansar** to open the [Sansar download page](https://www.sansar.com/download). ## Next - [Log in to sansar.com](/account/log-in) with your email address and password. - Open the [Sansar download page](https://www.sansar.com/download) to get the Sansar client. Source: https://docs.sansar.com/account/create-account --- # Log in to sansar.com > Log in to sansar.com with your email address and password, and log out when you're done. Log in to [sansar.com](https://www.sansar.com/login) with your email address and password, and log out when you finish. ## Before you start - **Need an account?** On a computer, select **Sign up** in the top bar. On a phone, open **Menu** and select **Sign up**. You can also select **Sign up** at the bottom of the login page. See [Create a Sansar account](/account/create-account). - **Using Steam?** Select **Continue with Steam** on the login page instead. See [Log in with Steam](/account/log-in-with-steam). ## Log in 1. Open the [sansar.com login page](https://www.sansar.com/login). Or open [sansar.com](https://www.sansar.com) and select **Sign in** in the top bar (on a phone, open **Menu** and select **Sign in**). sansar.com also sends you here automatically if you open a page that requires login. 2. Under **Log in to your Sansar account**, enter your email address in **Email**. 3. Enter your password in **Password**. Passwords set before the current password rules still work. 4. Select **Log in**. The button reads **Logging in...** while sansar.com logs you in. ## What happens next - If you opened a page that requires login, sansar.com returns you to that page. If you selected **Sign in**, you go to the home page. - On a computer, the top bar shows your display name, a shopping cart badge, and your Sansar Dollar (S$) balance badge. On a phone, open **Menu** to see them. To find your profile details, balance, and account settings, see [Account dashboard](/account/account-dashboard). - If your session ends, log in again. Pages that require login send you back to the login page. ## Log out 1. On a computer, select your display name in the top bar. On a phone, open **Menu**. 2. Select **Log out** at the bottom of the menu. You return to the home page. ## If something goes wrong ### "You entered an invalid email or password. Please try again." sansar.com shows this message whenever email login fails. - Check that you typed your email address and password correctly. - If you forgot your password, select **Forgot password?** on the login page, or follow [Reset your password](/account/reset-password). - If you log in with Steam, select **Continue with Steam** instead. See [Log in with Steam](/account/log-in-with-steam). - If you still can't log in, [contact support](/help/contact-support). ### Nothing happens when you select Log in Make sure both **Email** and **Password** contain text. Fields with only spaces won't submit. Source: https://docs.sansar.com/account/log-in --- # Log in with Steam > Use Continue with Steam to log in to sansar.com with the Steam account you created your Sansar account with. Use **Continue with Steam** on the [sansar.com login page](https://www.sansar.com/login) to log in. You must use the Steam account you created your Sansar account with. ## Before you start Make sure you can access the Steam account you created your Sansar account with. To use Steam with the Sansar desktop client, see [Steam integration](/account/steam-integration). ## Log in with Steam 1. Open the [sansar.com login page](https://www.sansar.com/login). Or open [sansar.com](https://www.sansar.com) and select **Sign in** in the top bar (on a phone, open **Menu** and select **Sign in**). 2. Select **Continue with Steam**. 3. Follow the instructions on Steam. 4. Wait while sansar.com briefly shows "Completing Steam login..." and finishes logging you in. ## What happens next - sansar.com opens the page you started from, or the home page. - On a computer, the top bar shows your display name, a shopping cart badge, and your Sansar Dollar (S$) balance badge. On a phone, open **Menu** to see them. - When your session ends, select **Continue with Steam** on the login page to log back in. - To log out manually, follow the [Log out](/account/log-in#log-out) steps. ## If something goes wrong ### "Steam login failed. Please try again." If Steam login doesn't complete, sansar.com returns you to the login page with this message. - Select **Continue with Steam** and try again. - If it keeps failing, [contact support](/help/contact-support). Source: https://docs.sansar.com/account/log-in-with-steam --- # Reset your password > If you forget your password, get a reset code by email and choose a new password on sansar.com. If you forget your password, request a reset code by email on [Forgot your password?](https://www.sansar.com/forgot-password). Then choose a new password on sansar.com. ## Before you start - You don't need to be logged in to reset your password. If you're already logged in, you can [change your password](/account/change-password) from your account pages instead. - Make sure you can access the email inbox for your Sansar account. If you can't, [contact support](/help/contact-support). - If you log in with Steam, select **Continue with Steam** instead. See [Log in with Steam](/account/log-in-with-steam). ## Request a reset code 1. Open [Forgot your password?](https://www.sansar.com/forgot-password), or select **Forgot password?** on the [login page](https://www.sansar.com/login). 2. Enter your email address in **Email**. 3. Select **Send reset code**. The button reads **Sending...** while sansar.com sends your request. You see **Check your email**. If an account uses that address, you get an email with a confirmation code. ## Set a new password 1. On **Check your email**, select **Enter confirmation code**. **Reset your password** opens with your email address already filled in. 2. Check **Email**. If the box is blank, enter your email address. 3. Enter the code from your email in **Confirmation code**. 4. Enter a new password in **New password**. Your password must: - Be between 8 and 256 characters long - Include at least one letter (A–Z, a–z) and at least one number 5. Enter the same password again in **Confirm new password**. 6. Select **Reset password**. The button reads **Resetting...** while sansar.com updates your password. ## What happens next The page displays **Password changed!** and "Your password has been changed successfully. You can now log in with your new password." Select **Log in** to open the login page, then [log in to sansar.com](/account/log-in) with your new password. ## If something goes wrong ### You didn't receive a code - Check your spam folder. - Make sure you entered the email address on your Sansar account. sansar.com shows **Check your email** whether or not an account uses that address. - To request another code, select **try again** on **Check your email**, or select **Resend code** on **Reset your password**. On the request form, enter or check your email address, then select **Send reset code**. ### Password or field errors If an error message appears above the form: - **"Passwords do not match."** — Enter the same password in **New password** and **Confirm new password**. - **"Password must be at least 8 characters."**, **"Password must be 256 characters or fewer."**, or **"Password must include at least one letter and one number."** — Adjust your password to meet the rules above. - **"All fields are required."** — Fill in every field before selecting **Reset password**. ### Your code isn't accepted If the code is wrong or no longer valid, the page shows an error message or "Password reset failed. Please check your code and try again." Check the code in your email and enter it again. To get a new code, select **Resend code**, enter your email address on the request form, and select **Send reset code**. ### "Something went wrong. Please try again." Try submitting the form again. If it keeps happening, [contact support](/help/contact-support). Source: https://docs.sansar.com/account/reset-password --- # Account dashboard > What the Account Dashboard on sansar.com shows and where each account link takes you. Use your [**Account Dashboard**](https://www.sansar.com/account) on sansar.com to view your profile details, check your Sansar Dollar (S$) balance, and open common account pages. ## Open your Account Dashboard Open [**Account Dashboard**](https://www.sansar.com/account) directly, or navigate to it after logging in: - **On a computer:** Select your display name in the top bar, then select **Account**. - **On a phone:** Open **Menu**, then select **Account**. - **From any account page:** Select **Dashboard** in the account sidebar. If you aren't logged in, sansar.com sends you to the login page first and returns you afterward. ## What the dashboard shows The **Account Dashboard** displays two summary cards: - **Profile:** Shows **Name:** (your avatar display name) and **Handle:** (your Avatar ID, shown as `@handle`). It also shows **Email:** when your address is available on your account. See [Avatar name and ID](/account/avatar-name-id) for what your display name and handle mean. - **Balance:** Shows your S$ balance. On a computer, select your S$ balance in the top bar to open **Buy Sansar Dollars**; on a phone, open **Menu** first to select it. To buy S$ or cash out, see [Buy Sansar Dollars](/sansar-dollars/buy) and [Cash out your earnings](/sansar-dollars/withdraw). ## Account sidebar The account sidebar includes these links: | Account link | What it's for | |---|---| | **Dashboard** | Return to the **Account Dashboard** to view your profile details and S$ balance. | | **Buy Sansar Dollars** | See [Buy Sansar Dollars](/sansar-dollars/buy). | | **Change Password** | See [Change your password](/account/change-password). | | **Change Email** | See [Change your email address](/account/change-email). | | **Subscription** | See [Subscriptions](/sansar-dollars/subscription-faq). | | **Currency Conversion** | See [Cash out your earnings](/sansar-dollars/withdraw). | | **Withdraw USD** | See [Cash out your earnings](/sansar-dollars/withdraw). | | **Delete Account** | See [Delete your account](/account/delete-account). | ## Other links in the account menu Open the account menu by selecting your display name on a computer, or **Menu** on a phone. The menu also links to: - [**My Profile**](/explore/social/user-profiles) - [**Purchases**](/store/shopping/redelivering-lost-purchases) - **Transactions** - [**Manage Listings**](/store/selling/manage-listings) - [**My Calendar**](/events/adding-events-to-your-calendar) - **Log out** For logging in and out, see [Log in to sansar.com](/account/log-in). Source: https://docs.sansar.com/account/account-dashboard --- # Change your email address > Change the email address you log in with, then confirm it with the code sent to the new address. Change the email address on your Sansar account from [Change Email](https://www.sansar.com/account/change-email) on sansar.com. You confirm the change with a code sent to your new inbox. ## Before you start - **Log in to sansar.com** to start the change. If you aren't logged in, sansar.com sends you to the login page first and returns you afterward. You can open the confirmation page later without logging in. - **Make sure you can access your new email inbox.** Sansar sends the confirmation code to your new email address. - **Check your login method.** If you log in with Steam, the page says this option isn't valid for your account. ## Request an email change 1. Open [Change Email](https://www.sansar.com/account/change-email). Or select your display name in the top bar (or open **Menu** on a phone), select **Account**, then select **Change Email** in the account sidebar. 2. If **Current email:** appears, check that it shows the right account. 3. Under **New Email Address**, enter your new email address. 4. Select **Change Email**. The button stays unavailable while the field is empty. It reads **Submitting...** while sansar.com sends your request. sansar.com sends a confirmation code to your new email address and opens **Confirm Email Change**. ## Confirm your new email address 1. Open the email sent to your new address and find the confirmation code. 2. On **Confirm Email Change**, check **Confirming email:** to verify your new address. If you opened [Confirm Email Change](https://www.sansar.com/account/confirm-email) directly, enter your new address in **New Email Address**. 3. Under **Confirmation Code**, enter the code from your email (at least 6 characters). 4. Select **Confirm Email**. The button reads **Confirming...** while sansar.com checks your code. ## What happens next You see "Your email has been updated! Please log in with your new email." with a **Log In** button. Select **Log In** and use your new email address when you [log in to sansar.com](/account/log-in). ## If something goes wrong ### "An email change is already pending confirmation." The full message says: "An email change is already pending confirmation. Check your new email for the confirmation code." 1. Select **Go to confirmation page**. 2. Enter your new address in **New Email Address**. 3. Enter your code and select **Confirm Email**, or select **Resend confirmation code**. ### You didn't receive a confirmation code On **Confirm Email Change**, select **Resend confirmation code**. The button reads **Sending...** while sansar.com sends the request. If it succeeds, you see "Confirmation code resent!" If you still don't receive a code, [contact support](/help/contact-support). ### "Invalid code. Please try again." Check the code in your new email inbox and enter it again. Or select **Resend confirmation code** to get a new code. ### "An error occurred, please try again." Try again. If it keeps happening, [contact support](/help/contact-support). Source: https://docs.sansar.com/account/change-email --- # Change your password > Choose a new password for your Sansar account from your account pages on sansar.com. Change the password for your Sansar account from [Change Password](https://www.sansar.com/account/change-password) on sansar.com. ## Before you start - **Log in to sansar.com.** If you aren't logged in, sansar.com sends you to the login page first and returns you afterward. If you forgot your password and can't log in, [reset your password](/account/reset-password) instead. - **Check your login method.** If you log in with Steam, the page says this option isn't valid for your account. ## Change your password 1. Open [Change Password](https://www.sansar.com/account/change-password). Or select your display name in the top bar (or open **Menu** on a phone), select **Account**, then select **Change Password** in the account sidebar. 2. Under **New Password**, enter your new password. You don't need to enter your current password. Your new password must: - Be between 8 and 256 characters long - Include at least one letter (A–Z, a–z) and at least one number 3. Under **Confirm Password**, enter the same password again. 4. Select **Save**. The button reads **Saving...** while sansar.com updates your password. ## What happens next The page replaces the form with "Password successfully changed." Use your new password the next time you [log in to sansar.com](/account/log-in). ## If something goes wrong ### Save stays unavailable **Save** stays unavailable until both fields match and meet the password rules. - Check the hint below **New Password**. If your password doesn't meet a rule, the hint updates as you type. It shows "Password must be at least 8 characters.", "Password must be 256 characters or fewer.", or "Password must include at least one letter and one number." - If you see "Passwords do not match, please try again." under **Confirm Password**, re-enter your password so both boxes match. ### An error message appears after you select Save If your password change isn't accepted, the page shows an error message or "An error occurred, please try again." Try again. If it keeps happening, [contact support](/help/contact-support). Source: https://docs.sansar.com/account/change-password --- # Avatar name and ID > How your Avatar Name (Display Name) and Avatar ID (Handle) work on sansar.com and in Sansar. Learn how your Avatar Name and Avatar ID are used in Sansar, where they appear, and how to find another user's handle. ## Avatar name and avatar ID In Sansar documentation, **Avatar Name** means your **Display Name** on sansar.com. **Avatar ID** means your **Handle**, shown with `@` (for example, `@handle`). **On sansar.com:** When you register, you choose your **Display Name** and **Handle** on the registration page. On your **Account Dashboard**, they appear as **Name:** and **Handle:**. Both are tied to your account, your avatar, your Sansar Store listings, and the worlds you create. Choose your handle carefully, because you can't change it later. ## Avatar name Your Avatar Name (**Display Name**) is the public name other people see for you in Sansar. **On sansar.com:** Your profile shows your display name next to your `@handle`. On the [Sansar Store](https://www.sansar.com/store), item listings show your creator name under **Sold by**, linked to your shop. World cards also show the creator's name, linked to their worlds. ## Avatar ID Your Avatar ID (**Handle**) is a permanent, unique public identifier tied to your account. No two users can have the same handle. - **Format:** 3 to 40 characters long, using lowercase letters, numbers, and single dashes between them (for example, `johnsmith` or `sansar-studios`). - **Display:** Your handle appears with `@` in front of it (for example, `@johnsmith`). Type it without `@` when you register. - **Permanence:** You can't change your handle later. **On sansar.com:** Open a user's profile to see their display name and `@handle`. Selecting a creator's name under **Sold by** on a Store listing opens their shop, not their profile. Your handle is also part of your profile link (`/profiles/`) and links to worlds you create (`/worlds//`). For example, a world created by `sansar-studios` includes `sansar-studios` in its `/worlds/sansar-studios/...` URL. **In Sansar:** When working with scripts, you may need an Avatar ID to specify a world to teleport to. The [Teleport remote script](/scripting/guides/configuring-teleport-scripts) is one example. ## Naming your avatar **On sansar.com:** Choose your **Display Name** and **Handle** when you register. For steps, see [Create a Sansar account](/account/create-account). **On sansar.com:** If a page shows **No Avatar Found**, it says: "It looks like you don't have an avatar set up yet. Please create one to continue using Sansar." If you see this message, select **Download Sansar** to open the [Sansar download page](https://www.sansar.com/download). If you need help, [contact support](/help/contact-support). ## Identifying an avatar's name and ID **On sansar.com:** Open a user's profile to see their display name and `@handle`. **In Sansar:** To identify an avatar's name and ID in VR, see [Identifying and interacting with avatars](/explore/social/identifying-interacting-with-avatars). Source: https://docs.sansar.com/account/avatar-name-id --- # Join the Sansar Discord
Use the official Sansar Discord server to meet other players and creators, follow community news, and get help. You do not need to link your Sansar account to Discord to join.
## Join the server 1. Select **Discord** or **Community** in the footer of any sansar.com page, or open the [Sansar Discord invite](https://discord.com/invite/sansarofficial). 2. If Discord asks, sign in to your Discord account or create one. 3. Accept the server invitation. If you leave the server and want to return later, open the invite again, subject to the server's rules. ## Rules and support Follow Sansar's [Discord server rules](/guidelines/discord-server-rules), [Terms of Service](https://www.sansar.com/legal/terms-of-service), [Community Standards](https://www.sansar.com/legal/community-standards), and [Content Guidelines](https://www.sansar.com/legal/content-guidelines). For help with your Sansar account, see [Contact Support](/help/contact-support). Source: https://docs.sansar.com/account/discord-faq --- # Steam integration > Steam installation and login guidance for the Sansar client. If you have [Steam](https://store.steampowered.com/) installed on your computer, use it to install Sansar, create a Sansar account, and log in to Sansar. **Note:** Only new Sansar accounts can use your Steam credentials. You can't link an existing Sansar account to Steam. ## Installing Sansar with Steam Find Sansar in the Steam Store. On Sansar's store page, select **Play Game** to install it. **Note:** You can have Sansar installed from only one source at a time. If you already installed it from sansar.com, Viveport, or another source and try to run it from Steam, you see a message asking you to uninstall the non-Steam client. ## Creating a Sansar account using your Steam credentials If you don't have a Sansar account yet, create one with your Steam credentials: 1. While Steam is running, open Sansar. 2. On Sansar's login screen, select **Steam**. 3. If you haven't created a Sansar account with your Steam credentials before, Sansar prompts you to enter these details: - **Email**: The email address Sansar uses to verify your account and send you Sansar-related information. It doesn't need to match your Steam email address. - **Display name**: The name you use in Sansar. It doesn't need to be unique. 4. Select **Create Account**. After you create your account, Sansar prompts you to verify your email address. Once you verify it, Sansar gives you a default avatar and takes you straight to a curated first Sansar experience. | ![Log in with Steam](/media/screenshot-pending.svg) | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Select **Steam** on the login screen to log in or create an account with your Steam credentials. | ## Logging into Sansar using your Steam credentials If you created a Sansar account with your Steam credentials, log in to Sansar: 1. While Steam is running, open Sansar. 2. If you logged in with Steam before, Sansar logs you in automatically with the same credentials. Otherwise, select **Steam** on the login screen. ## Steam Wallet integration
For payment methods and instructions, see [Buy Sansar Dollars](/sansar-dollars/buy). Source: https://docs.sansar.com/account/steam-integration --- # Delete your account > Permanently delete your Sansar account from your account pages on sansar.com. Permanently delete your Sansar account from [Delete Account](https://www.sansar.com/account/delete-account) on sansar.com.
[Image: Stop sign with the words: Account deletion is permanent]
## Before you delete your account - **Deletion is permanent.** It can't be undone. All your data, worlds, purchases, and account history will be permanently deleted. - **Manage your balances first.** If you have Sansar Dollars (S$) or earnings on your account, see [Buy Sansar Dollars](/sansar-dollars/buy) and [Cash out your earnings](/sansar-dollars/withdraw). - **Log in first.** You must be logged in to delete your account. If you forgot your password, [reset your password](/account/reset-password); if you still can't access your account, [contact support](/help/contact-support). ## How to delete your account 1. Log in to your Sansar account on [sansar.com](https://www.sansar.com/). 2. Select your display name in the top bar (or, on a phone, the ☰ menu, labeled **Menu**), then select **Account**. 3. In the account sidebar, select [**Delete Account**](https://www.sansar.com/account/delete-account). 4. Under **Type DELETE to confirm**, type `DELETE` in uppercase. **Permanently Delete Account** stays unavailable until the box matches `DELETE` exactly. 5. Select **Permanently Delete Account**. The button reads **Deleting...** while sansar.com sends your request. When sansar.com accepts your request, the page displays: "Your account has been scheduled for deletion. You will be logged out shortly." ## If something goes wrong ### "Failed to delete account. Please try again." Try submitting the form again. If it keeps failing, [contact support](/help/contact-support). Source: https://docs.sansar.com/account/delete-account --- # Explore > Get around Sansar, find worlds and people, chat, take photos and stream, and set up your controls, settings and VR headset. - [The Codex](/explore/codex) - [Instances](/explore/instances) - [Interactive objects](/explore/interactive-objects) - [The Main Menu](/explore/main-menu) - [The Nexus](/explore/nexus) - [Portals](/explore/portals) - [Quests](/explore/quests) ## Worlds - [Browse and search worlds on sansar.com](/explore/worlds/browse-and-search-worlds) - [Visit a world from sansar.com](/explore/worlds/visit-a-world-from-sansar-com) - [Find your favorite worlds and your friends' worlds](/explore/worlds/favorite-and-friends-worlds) - [Claim an access link](/explore/worlds/claim-an-access-link) ## Socialize - [Chat Panel](/explore/social/chat-panel) - [Experience Points, Levels, and Titles](/explore/social/experience-points) - [Finding People in Sansar](/explore/social/finding-people-in-sansar) - [Identifying Interacting With Avatars](/explore/social/identifying-interacting-with-avatars) - [The People panel](/explore/social/people-panel) - [User profiles](/explore/social/user-profiles) - [Profiles on sansar.com](/explore/social/profiles-on-sansar-com) ## Photos and streaming - [Streaming Sansar](/explore/share/streaming-sansar) - [Taking a photo](/explore/share/taking-a-photo) - [Snapshots on sansar.com](/explore/share/snapshots-on-sansar-com) ## Controls - [FreeCam and CineCam](/explore/controls/freecam-and-cinecam) - [Game Controller Buttons](/explore/controls/game-controller-buttons) - [Keyboard Shortcuts for Editing a Scene](/explore/controls/keyboard-shortcuts-scene) - [Keyboard Shortcuts for Styling Your Avatar](/explore/controls/keyboard-shortcuts-for-styling-your-avatar) - [Keyboard Shortcuts for Visiting an Experience](/explore/controls/keyboard-shortcuts-experience) - [Mouselook Mode](/explore/controls/mouselook-mode) ## Settings - [General Settings](/explore/settings/general-settings) ## VR - [HTC VIVE controls](/explore/vr/htc-vive-controls) - [Oculus Rift Controls](/explore/vr/oculus-rift-controls) - [Vive Index Controls](/explore/vr/vive-index-controls) - [Avatar Hand Gestures in VR](/explore/vr/avatar-hand-gestures) - [Calibrating Height in VR](/explore/vr/calibrating-height) - [Body Tracking Vive](/explore/vr/body-tracking-vive) Source: https://docs.sansar.com/explore --- # The Codex Your _Codex_ is a directory of all the worlds and events you have visited (or created) in Sansar. It allows you to browse and return to those worlds or events from anywhere.
| To open the Codex, choose **Go > Codex** from the main menu. | | ------------------------------------------------------------ | ## Navigating worlds in the Codex The Worlds section of the Codex allows you to browse and revisit all the worlds you have previously visited. It also displays listings for your favorite worlds and worlds you and your friends have created. You can revisit any world listed in the Codex by moving your mouse cursor over the listing's thumbnail and clicking the **Visit** button.
| The Worlds section of the Codex contains tabs for Visited worlds, Favorites, worlds created by Friends, and worlds created by you. To visit any of these worlds, move your mouse cursor over the listing's thumbnail and click **Visit**. | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ## Adding worlds to the Codex Your Codex is updated automatically whenever you visit a new world. The most common way to visit new worlds is to discover them in [The Nexus](/explore/nexus.md) by browsing worlds accessed by the Prime Portal. You can visit The Nexus at any time by clicking **Go to The Nexus** on the Visited tab of the Codex.
| The first entry on the Visited tab of the Codex allows you to access [The Nexus,](/explore/nexus.md) where you can socialize with other people and use the Prime Portal to find new worlds to visit. | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | You may also visit a world using its direct URL, even if the world has been hidden from the Prime Portal. If the URL is on a webpage, simply click the hyperlink to visit the linked world. Otherwise, you can paste the URL into Nearby chat where it becomes a clickable link.
| You can visit any world by entering its URL in Nearby chat and clicking the resulting link. | | ------------------------------------------------------------------------------------------- | ## Viewing a world's profile You can view more information about a world in your Codex by clicking the world's thumbnail (but _not_ the **Visit** button). This open a panel displaying a brief description of the world, along with buttons to **Visit** the world, **Add this world to your favorites**, **Create a portal to this world**, and **Copy this world's URL**.
| To view more information about a world in your Codex, click its thumbnail image to open the world's profile. | | ------------------------------------------------------------------------------------------------------------ | ## Navigating events in the Codex You can use the Events section of the Codex to browse events in Sansar, even if you haven't visited the event venues before. For detailed information on finding, attending, and creating events in Sansar, please see: * [Attending events in Sansar](/events.md) * [Adding events to your calendar](/events/adding-events-to-your-calendar.md) * [Creating your own events](/events/creating-your-own-events.md) Source: https://docs.sansar.com/explore/codex --- # Instances In Sansar, you have the ability to gather a nearly-unlimited amount of people in your event. This is accomplished through our Instancing feature. When a scene reaches its designated max capacity, Sansar will automatically create a copy of that scene. These copies are called "Instances" When multiple instances are created, users can choose which Instance they want to be in. To do this: * Open your Codex, and select the world you desire by clicking the world's portrait. (**NOT** the "Visit" button) * Click on "View Instances" * Select an Instance from the list. If you and your friends become separated in different Instances you can easily find each other. Simply go to: * "View Instances" * Click on "Share my instance URL" You will then be able to copy and paste your instance URL to your friends and they can follow you to the instance that you are currently occupying. With this knowledge you can now successfully travel between Instances in Sansar and bring your friends along with you! Source: https://docs.sansar.com/explore/instances --- # Interactive objects You can interact with certain objects in an experience to trigger actions and effects. Interactive objects are created using Sansar's script API, and act as input controls for those API scripts. Some examples of interactive objects might be: a door that opens when you click it, or a button that plays an audio clip. ## Using interactive objects | ![Interactable object](/media/screenshot-pending.svg) | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Interactive objects highlight green when you move your mouse cursor over them or look at them in VR. This particular interactive object also displays the prompt text "Click Me!" when highlighted. | ### In desktop mode To use an interactive object in desktop mode, your avatar must be within 3 meters of it. When you move your mouse cursor over the object, it highlights green and some "prompt" text (if defined by the API script) may appear. Click the object to interact with it. ### In VR To use an interactive object in VR mode, look at it and point your VR controller at it to highlight it. Then, tap the "grab" trigger to interact with the object. ### Held objects Some interactive objects, such as weapons and tools, may have additional functions when held by your avatar. Controls for these objects vary depending upon how the creator designed them, but they are often activated by using the **trigger** in VR or **left mouse button** in Desktop mode. When in Desktop mode, [Mouselook](/explore/controls/mouselook-mode) (**F7** key) can provide a more comfortable experience for aiming and moving while using a handheld object. ## Creating interactive objects Interactive objects are created using the [Sansar script API](/scripting/api-overview.md). The following API documentation is specific to interaction: * [Interaction class](/scripting/api/sansar.simulation/interaction.md) - Contains methods for reading and setting the interactive properties of the scripted object. * [InteractionData class](/scripting/api/sansar.simulation/interactiondata) - Handler for Interaction events. Can provide data on any interaction events that occur, including information such as who interacted with the object and where they touched the object. **Tip:** InteractionData can determine _where_ the object was touched, so it is possible to create a single interactive object that triggers multiple effects. One way to achieve this would be to texture the object with multiple images of buttons and then use the API to detect when a touch occurs inside one of the designated button areas. **Note:** A dynamic object cannot be both interactive and grabbable. If a dynamic object becomes interactive, it can no longer be grabbed using VR controllers or the mouse. ## Example script The following example script is also included in the Sansar client's install directory, along with a full set of current API documentation. See [Working with scripts](/scripting.md#guides) for full details on the location and how to add scripts to an object: * InteractionExample.cs - Click the object to make its interaction prompt show data about the interaction. Source: https://docs.sansar.com/explore/interactive-objects --- # The Main Menu ## The Main Menu The _main menu_ provides access to most of Sansar's panels and features, including the [Codex](/explore/codex.md), avatar customization, chat, and settings. In desktop mode, the main menu appears as a set of icons at the left side of the screen. In VR mode, you can press the **Y button** (Oculus Rift) or **Left Menu button** (HTC Vive) on your VR controller to access the main menu on your left wrist. **Note:** The available functions in the main menu may vary depending upon whether you are in VR or Desktop mode, and whether you are visiting or editing a scene.

In desktop mode, the main menu can be found on the right hand side of the screen while visiting a world or editing a scene.

In VR, the main menu appears on your left wrist when you press Y or the left Menu button, depending upon your VR controller setup

The main menu is divided into five categories, each containing several functions: ## Go * **Codex** - Opens your [Codex](/explore/codex.md), a directory of worlds you have visited. * **Quests** - Opens the [Quests](/explore/quests.md) panel, which lists your current quests and objectives. * **Events** - Opens your [Codex](/explore/codex.md) to the Events section, allowing you to browse current and upcoming events in Sansar. * **My event calendar** - Opens your Codex directly to your calendar, which contains events you have previously saved. * **Favorite places** - Opens your Codex directly to the Favorites tab, which contains worlds you have bookmarked as favorites. * **Home** - Immediately transports you to your private Home space. ## Socialize * **Chat** - Opens the [Chat panel](/explore/social/chat-panel.md), which allows you to send chat messages to friends and nearby people in your current world. * **Emotes** - Opens the Emotes interface, which allows your avatar to play brief animations. * **Friends & people** - Opens the [People panel](/explore/social/people-panel.md), which displays your friends list and nearby people in your current world. * **My profile** - Allows you to edit your publicly visible [user profile](/explore/social/user-profiles.md). * **Take a photo** - Allows you to [take a screenshot](/explore/share/taking-a-photo.md). Includes specific tools for taking screenshots for the Codex and the Sansar Store. ## Create * **Style my avatar** - Opens your collection of avatar looks and customizations. From here you can [customize your existing avatars](/avatars/basics/customizing-avatar.md) or [import a new one.](/avatars/import/importing-avatar-related-items.md) * **Host an event** - Opens the Events panel and automatically opens the Create Event panel to allow you to [create your own event.](/events/creating-your-own-events.md) * **Build worlds** - Opens the [My Worlds panel](/create/worlds/my-worlds-panel.md), which lists the worlds you have created and allows you to create new ones. * **Create Quests** - Opens the Quest Creator panel, which allows you to begin [creating your own quests.](/create/worlds/creating-quests.md) * **Learn to build** - Opens your web browser to this knowledge base, specifically to the [Creating in Sansar category.](/create.md) * **Edit this scene** - If you own the scene you are visiting, you can choose this option to enter edit mode and begin editing the scene. ## Shop * **Avatar looks** - Opens the [Sansar Store](https://www.sansar.com/store/all?category=avatar-looks) to the [Avatar Looks category.](/avatars/items/managing-avatar-looks-inventory-items.md) * **Scene creation** - Opens the Sansar Store to the Scene creation category. * **Buy Sansar dollars** - Opens the Buy Sansar Dollars panel, which offers Sansar dollar bundles for US dollars. * **My items for sale** - Opens your web browser to the [Manage Listings page](https://www.sansar.com/store/dashboard), which shows all items you are currently selling in the Sansar Store. ## More options * **Full screen/Exit full screen** - Enter and exit full screen mode. * **Settings** - Opens the [Settings panel](/explore/settings/general-settings.md), which allows you to tweak and troubleshoot various options in the Sansar client. * **Desktop controls** - Shows a diagram of keyboard and mouse controls for using and navigating Sansar. * **VR controls** - Shows a diagram of VR controls for using and navigating Sansar. * **Diagnostics** - Overlays the [diagnostics toolbar](/create/world-editor/diagnostics-toolbar.md) at the top of the screen. * **Help & Reporting** - Provides specific version information about Sansar and provides links for finding help and reporting abuse. * **Log out** - Log out of Sansar. ## Turn mic on/off Toggle your microphone for voice chat. This menu object does not have any additional functions. Source: https://docs.sansar.com/explore/main-menu --- # The Nexus
_The Nexus_ is the central hub of Sansar's many worlds; only the _Prime Portal_, which is located at the center of The Nexus, provides access to all other discoverable worlds. Since The Nexus serves as a natural crossroads and gathering place, several areas have been set aside for social interaction. ## The Prime Portal
Located at the center of The Nexus, the _Prime Portal_ provides access to every discoverable world in Sansar. The Prime Portal is the primary way for you to find new worlds to add to your [_Codex_](/explore/codex.md), which automatically records the worlds you visit and allows you to revisit them later without needing to access the Prime Portal. ## Accessing the Prime Portal

Approach the Prime Portal and interact with one of its curved pillars to open the Prime Portal panel.

The Prime Portal panel provides access to all the discoverable worlds in Sansar, as well as upcoming events.

To access the Prime Portal, approach it and interact with one of its curved pillars using your mouse cursor or VR controller. This opens the Prime Portal panel, which displays a feed of different worlds sorted by different categories: * **Events** - A queue of upcoming events in Sansar, sorted by events starting soonest. For more information about events, see [Attending events in Sansar.](/events/attending-event-in-sansar.md) * **Popular** - Worlds that receive a high volume of visitors. * **Featured** - Worlds currently featured by the Sansar team. * **Community Favorites** - Worlds sorted by the number of "Favorites" they have received. * **New** - The most newly created worlds. * **Recent** - Recently updated worlds, regardless of their creation date. You may also search for a world using the world's name or the creator's name, using the **Search worlds** field at the top of the panel. Enter part or all of the name, and the matching search results appear automatically. ## Visiting a new world

To visit a world listed in the Prime Portal panel, move your mouse cursor over the world's thumbnail and click Visit.

To view more information about a world listed in the Prime Portal panel, click the world's thumbnail to open its profile.

To visit a world displayed in the Prime Portal panel, move your cursor over the world's thumbnail and click the **Visit** button. You can view additional information about the world by clicking elsewhere in the thumbnail image. This opens a panel that contains a brief description of the world, as well as statistics for the number of Favorites it has received. If you have visited the world before, you may also use the available buttons to Favorite the world, open a personal [portal](/explore/portals.md) to the world, or get the world's direct URL. When you visit a new world for the first time, it is automatically added to your [Codex](/explore/codex.md). For more information about the codex and revisiting previously-visited worlds, see [The Codex.](/explore/codex.md) ## Core Portals

Approach a dormant Core Portal to activate it.

Interact with the portal using your mouse cursor or VR controller

There are a number of smaller, secondary portals called _Core Portals_ surrounding the Prime Portal. Some of these portals allow access to one of the facets of the Prime Portal, such as the Events listing, but others can lead to venues for special events or other featured worlds. To activate a Core Portal, approach it and interact with it using your mouse cursor or VR controller. ## Gathering spaces

A table and chairs near the entrance.

Semi-enclosed meeting areas can be found around the edges

The Nexus is a natural gathering place for visitors and explorers in Sansar; everyone must pass through in order to discover and access new worlds. This makes The Nexus a fun place to linger and watch passing avatars, strike up a conversation, or make new friends. Several seating areas have been set aside at the edges of The Nexus for small social gatherings. To interact with a seat, approach it and interact with it using you mouse cursor or VR controller. Your avatar should then sit on the seat. To leave the seat, simply use the movement controls to move your avatar and they will stand up automatically. Source: https://docs.sansar.com/explore/nexus --- # Portals ## Portals _Portals_ are a way to easily travel between worlds with a group of friends. When you open a portal, it appears at your location and stays open for up to two minutes. While the portal is open, other visitors may click it to travel to the world you have provided. ## Opening a portal using the Codex The easiest way to open a portal is to use the [Codex](/explore/codex.md): 1. Choose **Go > Codex** from the main menu to open your Codex. 2. Click one of the tabs under **Worlds**. 3. Choose a world and view its details by clicking the world's thumbnail image (but _not_ the **Visit** button). 4. In the world details panel, click the **Create a portal to this world** button to open the portal at your location. The portal stays open for up to two minutes, or until you open another portal. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | View a world's details in the Codex and click **Create a portal to this world** to immediately create a portal at your location. | ## Opening a portal using Nearby Chat You can open a portal using the Nearby tab of the Chat panel by using the `/portal` command: 1. If the Chat panel is not already open, open it by choosing **Socialize > Chat** from the main menu. 2. On the Nearby tab of the Chat panel, enter the command `/portal`, followed by a valid world URL. 3. Press **Enter** or click **Send Message** to open the portal at your location. The portal stays open for up to two minutes, or until you open another portal. **Note:** You may only have one portal open at a time. If you open a second portal, the first one closes immediately. ## Getting a world's URL In order to open a portal, you must first obtain the URL of the world you would like to visit. You can easily get a world's URL from the Codex: 1. Open the Codex by choosing **Go > Codex** from the main menu. 2. Find your desired world and view its details by clicking its thumbnail (but _not_ the **Visit** button). 3. Click the **Copy this world URL** button to copy the world's URL to your clipboard. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | View a world's details in the Codex and click the **Copy this world URL** button to copy the URL to your clipboard. | ## Traveling through a portal To travel through an open portal, you must move close enough to it that the portal's name appears when you hover your mouse or VR pointer over it. Then, click the portal and agree to the prompt in order to follow the portal's creator to the new destination. | ![](/media/screenshot-pending.svg) | | ----------------------------------------------------------------------------------------------------------------------------------- | | Move close to the portal, click it. A new navigation window will appear and you can then click "Visit" to head to your destination. | ![](/media/screenshot-pending.svg) ## Teleporting to a friend You may teleport directly to one of your friends, as long as that friend is in an experience that you would normally be able to enter. **Note:** Experience creators can exercise control over whether new arrivals are allowed to bypass the experience's spawn point. If the creator has disabled this option, you may need to take extra steps to locate your friend after you arrive. ## Teleporting to a friend using the People panel There are two ways to teleport to one of your friends by using the People panel: The Friends tab, or your friend's [user profile.](/explore/social/user-profiles.md) To teleport to a friend using your friends list: 1. Choose **Socialize > Friends & People** from the main menu to open the People panel. 2. Click the **Friends** tab. 3. Choose a friend who is online and click the **Teleport to friend** button. If your friend is not in an accessible experience, the button becomes grayed out and cannot be clicked. ## To teleport to a friend using their user profile: 1. Choose **Socialize > Friends & People** from the main menu to open the People panel. 2. Open your friend's [user profile](/explore/social/user-profiles.md), accessible by clicking their name from any tab where they appear in the People panel. 3. Click **Teleport to friend** to teleport to your friend. If your friend is not in an accessible experience, the button becomes grayed out and cannot be clicked. **Note:** Although the **Teleport to friend** button appears on all profiles, you can only teleport to someone who appears on your Friends list. ## Teleporting to a friend using Nearby chat You can teleport to a friend who has entered text into Nearby chat: 1. If it is not already open, open the Chat panel by choosing **Socialize > Chat** from the main menu. 2. Click the **Nearby** tab of the Chat panel. 3. Find your friend's message and move your mouse cursor over their name to reveal additional buttons. 4. Click the **Teleport to friend** button that appears.
Source: https://docs.sansar.com/explore/portals --- # Quests _Quests_ are acquired tasks that provide you with rewards for completing their objectives. You can get quests from the _quest givers_ named **Agent Animus** and **Agent Forma** at the quest giver terminal in the [Sansar Social Hub](https://www.sansar.com/worlds/sansar-studios/social-hub). ## Getting quests You can receive quests from the quest givers **Agent Animus** and **Agent Forma** at the terminal in the Sansar Social Hub. To receive quests: 1. Visit the [Sansar Social Hub](https://www.sansar.com/worlds/sansar-studios/social-hub). You can find it in the [Codex](/explore/codex.md), or by entering the [portal](/explore/portals.md) in your Home world. 2. In the Sansar Social Hub, find and approach the quest giver terminal, which shows holograms of **Agent Animus** and **Agent Forma**. 3. Click one of the quest givers to receive a quest. 4. Review the quest information and rewards in the panel that appears. 5. Click **Start the quest** to add the quest to your Quests panel and begin tracking its objectives. If you wish do decline the quest, click **Maybe later**.

The quest giver terminal, with holograms of Agent Animus and Agent Forma. Click one of them to receive a quest.

After interacting with a quest giver, review the quest information and rewards and then click Start the quest to add the quest to your Quests panel and begin tracking your objectives. You may click Maybe later to decline the quest.

## Tracking quest objectives Your Quests panel tracks your current quests and progress on your quest objectives. To open the Quests panel, choose **Go > Quests** from the main menu. The Quests panel has two modes: All quests, and quest details. ## All quests This mode displays all of your current quests. You can view a brief description of the quest by moving your mouse over the quest's thumbnail image. Progress on quest objectives is shown in bars below the thumbnail. Gray bars represent incomplete objectives, and blue bars represent completed objectives. Click **Continue quest** to view the quest's objectives and rewards.

Showing all quests. Progress on each quest is indicated by the bars underneath the thumbnail images. Click Continue quest to view quest details.

## Quest details This mode displays all information, objectives, and rewards for completing the selected quest. You can view a brief description of the quest by clicking the **Info** tab. To view the quest's rewards, click the **Rewards** tab. To view your quest objectives, click the **Objectives** tab. Progress on quest objectives is represented visually for each objective: * **Objective appears normally** - Objective may be completed. * **Objective is grayed out** - Objective is locked or has already been completed. * **Lock icon** - Objective is locked until other requirements have been met. Usually, all other quest objectives must be completed before unlocking the final objective. While viewing quest details, you can click the **minimize** icon in the lower-right of the panel to condense it into a small tracker, with blue and gray bars representing progress on quest objectives. Blue bars represent completed objectives, and gray bars represent incomplete objectives. Click **Quests in progress** to return to the list of your current quests.

Quest details. Shows progress on all quest objectives, as well as the quest reward. Click Quests in progress to return to the list of all quests.

Source: https://docs.sansar.com/explore/quests --- # Browse and search worlds on sansar.com > Find worlds on sansar.com: featured and recommended worlds, the full list with sorting, search, and every world by one creator. Browse featured and recommended worlds, sort the full world list, search for worlds, or see every world made by one creator on sansar.com. ## Before you start - You don't need to sign in to browse, search, or view a creator's worlds. The same lists appear whether you're signed in or signed out. - On a computer, select **Explore** in the top bar (or open its menu and select **Worlds**). On a phone or narrow screen, open **Menu** and select **Worlds** under **Explore**. The world search box is only shown on wider screens. - When you sign in, extra tabs appear in the Worlds bar for [your favorites and friends' worlds](/explore/worlds/favorite-and-friends-worlds), **Access links** (where a world's owner creates access links), and [your invitations](/explore/worlds/claim-an-access-link). ## Browse featured and recommended worlds 1. Open [Worlds](https://www.sansar.com/worlds), or select the **Home** tab on any Worlds page. 2. Browse the banner of up to four featured worlds at the top. When more than one world is featured, the banner changes every 5 seconds. Select a dot to choose a world. 3. Select **Explore World** on a banner to open that world's page. 4. Browse **Recommended worlds** below the banner for up to eight more featured worlds. ## Browse and sort all worlds 1. Select the **All** tab, or open [All Worlds](https://www.sansar.com/worlds/all). The page shows **All Worlds** and the number of worlds. 2. Under **Sort:**, select **Active**, **Most Liked**, **Recently Created**, or **Recently Updated**. When no sort is selected, worlds appear in **Active** order (most visitors first). 3. Select **✕** next to the sort options to clear the sort and return to the default order. 4. Move between pages (24 worlds per page) using **‹ Prev** and **Next ›** at the top, or **Previous**, page numbers, and **Next** at the bottom. Select **...** to jump to a page number with **Go to page** and **Go**, or select **Back to top**. ## Search for worlds 1. Enter a search term in **Search the Worlds...** at the right of the Worlds tabs (available on wider screens) and select **Search**. 2. Review the result count and matching worlds. Under **Sort:**, choose **Relevance**, **Active**, **Most Liked**, **Recently Created**, or **Recently Updated**. 3. Select **Clear search** (or **✕** in the search box) to return to **All**. ## See every world by one creator 1. Select the creator's name after **by** on any world card, or select **View all worlds** in the **Creator** box on a world's page. 2. Browse the creator's worlds (20 per page). Links to a creator's worlds keep working even if the creator later changes their handle. A creator's profile also lists their worlds on its **Overview** tab. See [User profiles](/explore/social/user-profiles). ## What happens next Each world card shows a picture (or **No image**), a red **Live** badge when someone is currently in the world, the world name, the creator's name, and a star with a like count when the world has likes. Select a world card to open its page and [visit the world from sansar.com](/explore/worlds/visit-a-world-from-sansar-com). ## If something goes wrong - **"No results found":** Try a different search term, or select **Browse Worlds** to return to **Home**. - **"No worlds yet":** On a creator's worlds page, this means that creator hasn't created any worlds yet. - For other issues, [contact support](/help/contact-support). Source: https://docs.sansar.com/explore/worlds/browse-and-search-worlds --- # Visit a world from sansar.com > Open a world's page on sansar.com, like or share it, and use Visit World to open it in Sansar. Open a world's page on sansar.com to view its details, like or share it, and use **Visit World** to open it in Sansar. ## Before you start - **Install Sansar on Windows.** Visiting a world requires the Sansar client on a computer running 64-bit Windows 10 or newer. See [Installing Sansar](/get-started/install) and [System requirements](/get-started/system-requirements), or select **Don't have Sansar? Download it free** on any world's page to open [Download](https://www.sansar.com/download). - **Sign in when needed.** You don't need to sign in on sansar.com to view a world that's open to everyone or to select **Visit World**. You must sign in to like a world or to view a private world's page with an account that's allowed in. - **On a phone or narrow screen:** Open **Menu** and select **Worlds** under **Explore** to browse to a world's page. You can view, like, and share a world's page on sansar.com, but **Visit World** is meant for a Windows computer with Sansar installed. ## Visit a world 1. **On sansar.com:** Open the world's page by selecting a world card (see [Browse and search worlds on sansar.com](/explore/worlds/browse-and-search-worlds)), selecting **Explore World** in the **Home** banner, or following a shared link. 2. **On sansar.com:** Review the world's image, description, and **Snapshots** (up to 12 photos; select one for a larger view, or select **View all** when there are more than 12—see [Taking a photo](/explore/share/taking-a-photo)). A **Live Now** box appears when someone is currently in the world. 3. **On sansar.com:** Select the creator's name to open their [profile](/explore/social/user-profiles), or select **View all worlds** in the **Creator** box to see every world they made. 4. **On sansar.com:** Select **Visit World**. This button uses a link meant to open the world in Sansar on a Windows computer with Sansar installed. ## Like or share a world 1. **On sansar.com:** Select **Like** while signed in. It changes to **Liked** with a filled star, and the count appears when it is above zero. Select **Liked** again to remove your like. 2. **On sansar.com:** Select **Facebook**, **X**, **Reddit**, **Pinterest**, or **Telegram** next to **Share:** to open that site in a new tab with the world's page address, or copy the address from your browser. There is no **Copy link** button on the page. To copy a world's URL inside the Sansar app instead, see [Sharing your experiences](/create/worlds/sharing-your-experiences) or [Quick start](/get-started/quick-start#sharing-world-urls). ## What happens next If Sansar doesn't open, select **Don't have Sansar? Download it free** on the world's page to go to [Download](https://www.sansar.com/download), install Sansar, and try again. ## If something goes wrong - **Nothing happens when you select Visit World:** Install the Sansar client from [Download](https://www.sansar.com/download) (see [Installing Sansar](/get-started/install)) and try again. - **The world's page is unavailable (browser tab shows World Not Found):** If a world is private, its page only appears when you're signed in with an account that's allowed in. Make sure you're signed in to the right account, or [claim your access link](/explore/worlds/claim-an-access-link) first if someone invited you. - **Like is greyed out:** Hovering shows "Log in to like". Sign in to your Sansar account on sansar.com, then select **Like** again. - For other issues, [contact support](/help/contact-support). Source: https://docs.sansar.com/explore/worlds/visit-a-world-from-sansar-com --- # Find your favorite worlds and your friends' worlds > See the worlds you've added to your favorites in Sansar and the worlds your friends have made. Use sansar.com to view the worlds you saved as favorites in Sansar and the worlds your friends have created. ## Before you start - **Sign in on sansar.com.** The **Favorites** and **My friends** tabs only appear when you're signed in. If you open either page while signed out, sansar.com sends you to the login page and brings you back afterwards. - **On a phone or narrow screen:** Open **Menu** and select **Worlds** under **Explore** to reach the Worlds tabs. ## View your favorite worlds Favorites are added in Sansar and can't be added or removed on sansar.com. For managing favorites in Sansar, see [The Codex](/explore/codex). 1. **On sansar.com:** Open [Favorite Worlds](https://www.sansar.com/worlds/favorites), or select the **Favorites** tab in the Worlds bar. 2. **On sansar.com:** Browse **Favorite Worlds** (20 per page) and select any world card to open its page. ## View worlds your friends created 1. **On sansar.com:** Open [Friends' Worlds](https://www.sansar.com/worlds/friends), or select the **My friends** tab in the Worlds bar. 2. **On sansar.com:** Browse **Friends' Worlds** (20 per page), which lists worlds created by your friends on Sansar, and select any world card to open its page. To find and add friends in Sansar, see [Finding people in Sansar](/explore/social/finding-people-in-sansar) and [User profiles](/explore/social/user-profiles). ## What happens next Selecting any world card opens that world's page, where you can view details and select **Visit World**. See [Visit a world from sansar.com](/explore/worlds/visit-a-world-from-sansar-com). ## If something goes wrong - **"No favorites yet":** You haven't saved any worlds as favorites yet. Select **Browse Worlds** to explore worlds on sansar.com. Favorites are added in Sansar—see [The Codex](/explore/codex). - **"No friends' worlds":** Your friends haven't created any worlds yet, or you haven't added any friends. Select **Browse Worlds** to explore worlds on sansar.com, or see [Finding people in Sansar](/explore/social/finding-people-in-sansar). - **Favorites or My friends tab is missing:** Sign in to your Sansar account on sansar.com. - For other issues, [contact support](/help/contact-support). Source: https://docs.sansar.com/explore/worlds/favorite-and-friends-worlds --- # Claim an access link > Use an access link someone sent you to get into a private world, and view your invitations on sansar.com. Claim a single-use access link someone sent you to get access to a private world, and view your claimed invitations on sansar.com. ## Before you start - **Have an access link and a Sansar account.** Opening an access link while signed out sends you to the login page, then brings you back to the link. - **Install Sansar to open the world.** You claim the link on sansar.com. **Open in Sansar** is meant to open the world in Sansar on a computer running 64-bit Windows 10 or newer with Sansar installed. See [Installing Sansar](/get-started/install) and [System requirements](/get-started/system-requirements). - **On a phone or narrow screen:** Open **Menu**, select **Worlds** under **Explore**, then select the **My invitations** tab. ## Claim an access link 1. Open the access link someone sent you. The page shows **You've been invited to**, the world name, and the creator's name. If the world is hidden from you until you claim, the page shows the world and creator handles from the link with no picture. 2. Check that you're signed in to the Sansar account you want to use. Each access link is single-use and can't be reused after you claim it. 3. Select **Claim access**. While it works, the button shows **Claiming…**. ## What happens next Once claimed, the page shows **Access granted**: - **Access available now:** The page shows **Open in Sansar**, a link meant to open the world in Sansar on a Windows computer with Sansar installed (see [Visit a world from sansar.com](/explore/worlds/visit-a-world-from-sansar-com)). - For a session already in progress, the page shows **Session access.** and when your access ends. - For permanent access, the page shows **Permanent access.** You can revisit the world any time unless the owner removes your access. - **Scheduled session that hasn't started yet:** The page shows when the session opens and when your access ends. **Open in Sansar** doesn't appear until the session starts. ## Find your invitations Worlds whose access links you claim appear on **My Invitations**. 1. Open [My Invitations](https://www.sansar.com/worlds/my-invitations), or select the **My invitations** tab under Worlds while signed in. 2. Check **Sessions** for timed invitations. When you have entries, use **Sort** to order by **Upcoming first** (default, with active sessions first), **Ending soonest**, or **Name**. Each entry shows the world's picture (or **No image**), name, creator, time window, and a red **Live** badge while the window is open. The name usually opens the world's page. Entries can also show **Open in Sansar** after the session starts. 3. For sessions with start and end times, select **Add to calendar** to download a calendar file (`.ics`) with the world name and time window (plus the world's page and Sansar link when available), then open it with your calendar app. 4. Check **Permanent access** for worlds you can visit any time, unless the owner removes your access. When you have entries, use **Sort** to order by **Name** (default) or **Creator**. Each entry shows the world's picture (or **No image**), name, and creator, and usually **Open in Sansar**. 5. Select **Open in Sansar** when available. This link is meant to open the world in Sansar on a Windows computer with Sansar installed. ## If something goes wrong - **"Invalid link":** The world this link points to couldn't be found and may have been removed. Select **Browse worlds** to explore other worlds, or check with the person who sent the link. - **"Can't claim this link":** Check the message shown: - *"This access link does not exist."* — Make sure you opened the full link, or ask the sender for a new link. - *"This link has already been used, revoked, or expired."* — Each link works once and can be revoked by the world's owner, who creates access links. Ask the sender for a new link. - *"You can't access this world."* — Check that you're signed in to the right account, or contact the world's owner. - Select **Try again** to return to the **Claim access** screen, or **Browse worlds** to leave. - **"No invitations yet":** When you claim an access link, the world appears on **My Invitations**. - **Nothing happens when you select Open in Sansar:** Install the Sansar client from [Download](https://www.sansar.com/download) (see [Installing Sansar](/get-started/install)) and try again. - For other issues, [contact support](/help/contact-support). To generate and manage access links for a world you own, see [Create access links on sansar.com](/create/worlds/create-access-links). Source: https://docs.sansar.com/explore/worlds/claim-an-access-link --- # Chat Panel ## The Chat panel The Chat panel allows you to communicate with other people in your current experience and respond to direct messages. When you are visiting experiences, the Chat panel opens automatically to the **Nearby** tab. However, in Edit Scene mode, the Chat panel opens to the **Friends** tab by default. ## In desktop mode

To chat with all nearby people in your experience:

  • Open the Chat panel by choosing Socialize > Chat from the main menu.
  • Once the Nearby tab opens, write something in the Enter Message field at the bottom of the Chat panel, then click Send Message or press Enter to send a message.
  • All Nearby messages sent and received from others appears under the Nearby tab, along with the name of the experience you are visiting.

To send or reply to a private message:

  • Open the Chat panel by choosing Socialize > Chat from the main menu. If you have any private messages waiting, a green light appears on the Friends tab; click it to view your messages.
  • On the Friends tab, click the private message you want to reply to then click the > arrow to view the conversation. To start a new conversation, click New Message instead.
  • Type a message into the Say something to field, then press Enter to send a message to only that person.
  • When you are finished, you may click Back to return to your list of private messages.
**Note:** Sending and receiving private messages can only be done with friends. ### In VR ![VR keyboard](/media/screenshot-pending.svg) ### Emoji support The Chat panel supports the use of emojis in text messages. You can click the **emoji button** next to the **Enter Message** field to choose from the available emojis, or you can cut and paste one from elsewhere. You can even type emoji codes directly into the Enter Message field and the Chat panel will suggest emojis based on your partial input. ### Troubleshooting emojis on Windows 7 Windows 7 does not support emojis in Sansar by default. Windows 7 users can gain access to emojis in Sansar by installing an updated version of the font _Segoe UI_. Source: https://docs.sansar.com/explore/social/chat-panel --- # Experience Points, Levels, and Titles ## Overview By performing certain [quests](/explore/quests.md) and activities in Sansar, you can accumulate _experience points_ (usually abbreviated as _XP_). Experience points contribute to your overall _level_, which is visible for other people to see in your [user profile.](/explore/social/user-profiles.md) ## Levels and titles Your _level_, visible in your [user profile](/explore/social/user-profiles.md), is a simplified representation of your total accumulated XP. At certain XP thresholds, you "level up" and your level increases. Someone's level can be used as one possible indicator of the amount of time and experience (no pun intended) someone has invested in Sansar. Keep in mind that not everyone uses Sansar in a way that will necessarily accumulate a lot of XP, so this is by no means a definitive measure. Your _title_ is also displayed in your profile, just below your level. In later updates, you will be able to accumulate and select different titles to display as you achieve milestones in your Sansar journey.

Everyone's level and title are visible in their user profile, just under their name.

## Traits XP has three traits: **Explorer**, **Social**, and **Creator**. XP outside those traits is **General XP**. * **Explorer** - Awarded for exploration-related activities. * **Social** - Awarded for social activities. * **Creator** -Awarded for activities related to creating content for Sansar. All XP contributes to your level progress, but you (and others) can view the breakdown of your traits to see how you earned your XP and ascertain the types of activity you most often engage in. Any XP earned that does not fall under one of the three types is categorized as _General_ XP. General XP contributes towards your overall level progress, but is not included in the breakdown. To view the breakdown of someone's traits while viewing their [profile](/explore/social/user-profiles.md), hover your mouse cursor over their **Level**.

To view someone's total XP and the distribution of someone's traits, hover your mouse cursor over the Level in their user profile.

Source: https://docs.sansar.com/explore/social/experience-points --- # Finding People in Sansar ## Finding people in Sansar Find other people in Sansar by browsing popular worlds, attending events, or searching for specific friends. You can also connect with the community on Discord. ## Popular worlds When you browse worlds in the Codex or Prime Portal, you may see a small **Popular now** icon in the corner of some worlds. This icon shows that other people are visiting that world. Select **Visit** to enter the world and say hello to other visitors.
[Image: Popular now icon on a world]

The Popular now icon shows that other people are visiting a world.

## Events Attend an event to meet other people while enjoying experiences and locations in Sansar. Events include community meetups, murder mysteries, and other special activities. Find upcoming events in the Codex or browse [upcoming events on sansar.com](https://www.sansar.com/events).
[Image: List of upcoming events in the Codex]

See a list of upcoming events in the Codex, under the Events tabs.

## Search for friends While visiting or editing a scene, you can use the [People panel](/explore/social/people-panel) to search for specific friends to add to your Friends list. After a friend accepts your friend request, you can exchange chat messages and coordinate activities.
[Image: Search tab of the People panel]

Search for friends using the Search tab of the People panel.

## Join Sansar's official Discord community Join the [Sansar Discord server](https://discord.com/invite/sansarofficial) to connect with other Sansar users. You can make friends, plan meetups, ask questions, get feedback, share your ideas and creations, and more. For server rules, see [Sansar's Discord server rules](/guidelines/discord-server-rules).
## Share with the community You can share your experiences, report bugs, and request features on the [Sansar Discord server](https://discord.com/invite/sansarofficial). Before you post, read [Sansar's Discord server rules](/guidelines/discord-server-rules). Source: https://docs.sansar.com/explore/social/finding-people-in-sansar --- # Identifying Interacting With Avatars ## Identifying and interacting with avatars While visiting a scene, you can identify and interact with other visitors. The way in which you perform these actions depends upon whether you are in desktop mode or VR mode. ## Desktop mode Interaction between avatars in desktop mode is accomplished through the [Chat](/explore/social/chat-panel) and [People](/explore/social/people-panel) apps and voice chat. The Nearby tab of the [People app](/explore/social/people-panel) identifies other avatars in the scene by [Avatar Name and Avatar ID](/account/avatar-name-id), and provides controls to **Message** (privately), **Add Friend**, and **Mute** any avatar in the list. The [Chat app](/explore/social/chat-panel) provides text chat for all avatars in the scene. Additionally, you can identify nearby avatars by moving your mouse cursor over them in the scene. The person's Avatar Name and Avatar ID appear at the cursor location while the cursor is hovering over their avatar. While the Avatar Name and ID are visible, you may left-click to access **Mute** and **Add/Remove Friend** buttons. **Note:** It is not possible to use the hover-over method to identify avatars with a game controller in desktop mode at this time.

The People app allows you to send a private Message, Add Friend, or Mute any avatar in your current scene.

Move your mouse cursor over an avatar to see that person's Avatar Name and Avatar ID. Click to access Mute and Add/Remove Friend buttons.

**Note:** Sending and receiving private messages can only be done with friends. ## VR mode When you look at an avatar in VR mode and hold one of the grip buttons, their Avatar Name and Avatar ID appear along with buttons to **Mute** (or **Unmute**) or **Add Friend** (or **Remove Friend** if they are already your friend). You can read and send text chat in VR using the VR keyboard. Use **Hold to dictate** on the VR keyboard to enter text by voice when **Enable voice dictation** is enabled.

When looking at an avatar in VR and holding a grip button, their Avatar Name and Avatar ID appear. Click Add Friend to add this person as your friend, or Mute to silence all voice and text chat from this person.

## Identifying avatars using voice chat and avatar broadcasting Typing indicator Avatars who are typing in text chat have a green _ellipsis_ (...) indicator above their heads. This can help you to easily identify when someone is composing a chat message. You can toggle the typing indicator on or off in [Settings.](/explore/settings/general-settings.md) ## Voice chat indicator A volume level indicator identifies avatars who are speaking in voice chat. This can help you easily identify who is speaking when in a group setting. You can toggle the voice chat indicator on or off in [Settings](/explore/settings/general-settings). ## Broadcasted avatar indicator When attending an event that is using the avatar broadcasting feature, broadcasted avatars have an icon above their head that looks like a set of concentric circles. Although you can see and hear broadcasted avatars, remember that broadcasted avatars cannot see you or hear your voice chat.

An avatar typing in text chat, with the typing indicator overhead

An avatar speaking in voice chat, with the voice indicator overhead

A broadcasted avatar with the broadcasting indicator overhead

## Recording indicator A red recording dot appears above players using streaming software. You can control recording indicator visibility in Social settings. Source: https://docs.sansar.com/explore/social/identifying-interacting-with-avatars --- # The People panel ## People Panel The People panel has tabs to show who's nearby, your Friends list, and pending Friend requests. You can open the People panel by choosing **Socialize > Friends & People** from the main menu. |

Nearby - This tab lists all nearby people in your current experience. For each person on the list, you may click their name and choose to Message them to send a private message as described above, or you may Add Friend to request a mutual friendship. The other person must first accept your Friend request before they appear on your Friends list. You can also Send Gift to send them Sansar dollars. Additionally, you may choose to open that person's user profile, which contains additional muting, friendship, and reporting controls.

Note: There is no Nearby tab in edit mode.

Friends - This displays a list of your Friends, regardless of whether they are online or in your current experience. For each person on the list, you may click their name to either Message them, Send Gift to send them Sansar dollars, or open their user profile, which contains friendship and communication options.

Requests - Shows a list of currently pending Friend requests you have received from other people. For each pending request, you may click the person's name and then press Accept to accept the request.

Search - Enter part or all of someone's Avatar Name or ID and press the Search button to return a list of matching results. You may click the resulting name to reveal options to Message, Friend, Send Gift, or open the Profile of that person (which includes messaging, friendship, muting, and reporting options).

| [Image: People panel Search tab listing matching people, each with message, add friend, and send gift icons] | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | Source: https://docs.sansar.com/explore/social/people-panel --- # User profiles ## User profiles In the Sansar client, everyone has a _user profile_, a one-page overview of their Sansar identity that includes their [avatar name and ID](/account/avatar-name-id), a brief autobiography, a link to their [Sansar Store](/store), and links to their listed worlds. You can also use someone's profile in Sansar to add them as a friend, send them a message, or report them for inappropriate behavior or content. ## Viewing a profile in Sansar To view someone's profile in Sansar: 1. Select **Socialize > Friends & people** from the main menu to open the People panel. 2. On any tab of the People panel, click someone's name to open their profile in a new panel.

Click someone's name in the People panel to open their profile in a new panel.

**Note:** You can also view someone's profile by clicking on the user's image in chat or the quest info panel. ### Elements of the profile While viewing a profile, you may notice the following elements: * **Portrait** - A picture of the person's avatar, surrounded by a decorative frame. * **Mute button** - Represented by a microphone icon over the portrait; click to mute or unmute this person. * **Avatar name** - The person's current [Avatar Name](/account/avatar-name-id). * **Avatar ID** - Move your mouse cursor over the person's Avatar name to view their permanent [Avatar ID](/account/avatar-name-id). * **Current Location** - Lists the person's location, if available. * **Message** - Send a message to this person. Available only if you are friends. * **Teleport to Friend** - Teleport to the person if they are your friend and are in an accessible location. * **Gift** - Send Sansar dollars to the person. * **Friend** or **Unfriend** - Click to either request or end friendship. * **Report** - Report this person for inappropriate content or behavior. Opens the reporting interface on the Sansar website. * **Block** or **Unblock** - Block the person's avatar and voice chat. Click again to unblock. * **Bio** - A short autobiography that this person has written about themselves. Click the **Creations** tab of the profile to see the following additional information: * **Worlds** - Lists the number of worlds this person has listed in the [Prime Portal](/explore/portals). Click **Worlds** to view the listings on the Sansar website. * **Store** - Lists the number of items this person has listed in the [Sansar Store](/store). Click **Store** to visit their store on the Sansar website. * **Snapshots** - Lists the number of snapshots this person has shared. Click **Snapshots** to view the snapshots on the Sansar website.

Viewing a profile.

Click the Creations tab to see the worlds, Store listings, and snapshots this person has created.

## On the web To view profiles, send or respond to friend requests, or report a profile on sansar.com, see [Profiles on sansar.com](/explore/social/profiles-on-sansar-com). ## Editing your profile To begin editing your profile in Sansar, select **Socialize > Edit my profile** from the main menu. This opens your profile for editing. At this time, you may change your portrait and add a brief bio about yourself. Store and World listings are added automatically based on your published listings. **Note:** You may only edit your profile while in Sansar; you cannot currently edit your profile using the Sansar website.

Click Socialize > Edit my profile to begin editing your profile.

### Changing your portrait To change your portrait while editing your profile: 1. Click the **Update Profile Picture** button that appears under your existing portrait. 2. Choose one of the available thumbnails to represent you in your profile. The thumbnails are generated automatically based on the looks you have saved in the Lookbook. See [Customizing your avatar](/avatars/basics/customizing-avatar) for more information on creating looks for yourself. 3. Click **Select** to finalize your choice. 4. Click **Save** to publish the changes you have made to your profile. ### Adding a biography To add a brief autobiography while editing your profile, enter some text into the **Bio** section. This text is saved when you finish editing your profile and click the **Save** button.

Editing a user profile.

Source: https://docs.sansar.com/explore/social/user-profiles --- # Profiles on sansar.com > View profiles, send or respond to friend requests, and report a profile on sansar.com. View profiles, send or respond to friend requests, and report a profile on sansar.com. ## Before you start - **Viewing is public.** You don't need to sign in on sansar.com to view someone's profile. - **Sign in for friend requests, reporting, and My Profile.** You must sign in on sansar.com to open your own profile from **My Profile**, send or respond to friend requests, or report a profile. - **Edit your profile in Sansar.** There are no editing controls on web profile pages. See [User profiles](/explore/social/user-profiles) for editing your profile in the Sansar client. ## Open a profile - **Your own profile:** Sign in on sansar.com, select your display name in the top bar (or open **Menu** on a phone), and select **My Profile**. - **Another person's profile:** Select a host's name on an event card, event page, or **My Calendar** row, or select a creator's name on a world detail page. You can also open a direct profile link (`/profiles/[handle]`). **Note:** Selecting a creator's name on a Store card or under **Sold by** on a Store listing opens their shop rather than their profile. Selecting a creator's name on a world card opens their worlds list rather than their profile. ## What a profile shows - **Profile header:** The person's portrait (or the initial of their name), display name, `@handle`, optional bio and location text, and **Joined** month and year. See [Avatar name and ID](/account/avatar-name-id) for how display names and handles work. The location text is not a live indicator of the world the person is currently in. - **Overview** tab: Shows the person's **Worlds** (with a count when positive), world cards, and pagination. When they have no worlds, it displays "No worlds", "[name] hasn't created any worlds yet.", and **Browse Worlds**. - **Snapshots** tab: Opens the person's snapshot gallery. See [Snapshots on sansar.com](/explore/share/snapshots-on-sansar-com). - **Store** tab: Appears only if the person has a Sansar Store shop, and opens their shop. ## Send or respond to a friend request 1. Sign in on [sansar.com](https://www.sansar.com) and open the **Overview** tab of someone else's profile. Friend controls do not appear on the **Snapshots** tab or on your own profile. 2. Use the friend button in the profile header: - Select **Add Friend** to send a friend request. When sent, the button changes to **Request Sent**. - If the person sent you a request, select **Accept** or **Decline**. - If you are already friends, the button displays **Friends**. Friend buttons stay unavailable while a request is pending, and the friendship status refreshes if the action succeeds. When there is no friendship or pending request, the button displays **Add Friend**. Web profile pages do not show a separate error message, cancel-request control, or unfriend button. ## Report a profile When you are signed in and viewing the **Overview** tab of someone else's profile, **Report** appears below **Worlds**. For instructions, see [Report a profile](/safety/report-on-sansar-com#report-a-profile). ## If something goes wrong - If a profile does not exist, sansar.com displays a not-found page titled "Profile Not Found". If an older profile link resolves to a current profile, sansar.com may redirect to it. - If you need help with your profile or account, [contact support](/help/contact-support). Source: https://docs.sansar.com/explore/social/profiles-on-sansar-com --- # Streaming Sansar We encourage you to get the word out about Sansar by live streaming your exploration and experiences. If you are new to live streaming, here are a few popular sites for streaming live content: Launched as a game streaming platform in 2011, [Twitch.tv](https://www.twitch.tv/) has evolved into the world's largest streaming platform offering a diverse array of streaming content featuring games, music, art, and more. Twitch.tv official links and documentation * [Twitch.tv](https://www.twitch.tv/) * [Online help portal](https://help.twitch.tv/) * [Getting Started](https://help.twitch.tv/customer/en/portal/topics/301257-getting-started/articles) * [Beginner Broadcasting](https://help.twitch.tv/customer/en/portal/topics/925393-beginner-broadcasting/articles) Source: https://docs.sansar.com/explore/share/streaming-sansar --- # Taking a photo Capture images of a scene in Sansar while visiting or editing it. Sansar includes tools to help match the aspect ratio for uses such as the [Sansar Store](https://www.sansar.com/store), event listings, and world listings. ## Taking a photo To take a photo in Desktop mode: * **In Sansar:** Choose **Socialize > Take a photo** from the main menu.

Socialize > Take a photo

* **In Sansar:** Click and drag the bars that appear at the edge of the screen to adjust the capture area. Drag a corner to adjust two edges at once.

Adjusting the capture area by dragging the corners and edges.

* **In Sansar:** Once you have adjusted the capture area to your liking, click **Save to file** to save the image to your computer. ### Capturing photos for listings **In Sansar:** While adjusting the capture area of a screenshot, you can choose from the following options in the dropdown menu: * **General purpose** - Allows you to resize the capture area to any dimensions within the Sansar client. * **For the Codex** - Constrains the aspect ratio and minimum size of the capture area to be compatible with the [Codex](/explore/codex). You can still resize it, but you cannot adjust the height and width independently. Read the [image guidelines](/guidelines/world-publishing-guidelines#world-image) for Codex image content and file requirements. * **For the Sansar Store** - Constrains the aspect ratio and minimum size of the capture area to be compatible with the [Sansar Store](/store). You can still resize it, but you cannot adjust the height and width independently. Read the [image guidelines](/guidelines/store-listing-guidelines#general-image-guidelines) for listing image content and file requirements. * **For a Quest** - Constrains the aspect ratio and minimum size of the capture area to be compatible with quests. You can still resize it, but you cannot adjust the height and width independently.

Select For the Codex to capture images at the correct aspect ratio for the Codex.

### Sharing photos to your Sansar profile **In Sansar:** To share a photo to your [user profile](/explore/social/user-profiles) instead of saving it on your computer, you can click the **Share** button. This immediately opens a tab in your web browser, showing the image as it appears in your profile. Shared photos appear as snapshots in public galleries on sansar.com, including the global [Snapshots](https://www.sansar.com/snapshots) gallery, your profile's **Snapshots** tab, world snapshot galleries, and individual snapshot pages. 1. **On sansar.com:** If you are signed in, open **My Profile** from your account menu and select the **Snapshots** tab. You can also browse [Snapshots](https://www.sansar.com/snapshots). 2. **On sansar.com:** Select a snapshot thumbnail to open the viewer. 3. **On sansar.com:** Select **Open full size** to open the original image (or the display image if no original is available) in a new tab, or select **Copy image link** to copy the image URL. If the link is copied automatically, the button changes to **Copied!**. 4. **On sansar.com:** On an individual snapshot page, select a social link under **Share:** to share the snapshot. For details on browsing galleries and sharing snapshot links, see [Snapshots on sansar.com](/explore/share/snapshots-on-sansar-com). Source: https://docs.sansar.com/explore/share/taking-a-photo --- # Snapshots on sansar.com > Browse snapshots, view full-size images, and share links from sansar.com. Browse global, profile, and world snapshot galleries, open full-size images, and share snapshot links on sansar.com. To capture and share photos from the Sansar client, see [Taking a photo](/explore/share/taking-a-photo). ## Before you start - **No sign-in required to browse.** You can view public global, profile, world, and individual snapshot pages on sansar.com without signing in. - **Sign in to open your own profile quickly.** When signed in, select your display name in the top bar (or open **Menu** on a phone), then select **My Profile** and open the **Snapshots** tab. ## Browse snapshots - **Global gallery:** Open [Snapshots](https://www.sansar.com/snapshots) directly (there is no **Snapshots** link in the sansar.com menus). Cards show each snapshot's caption (when present) and "by [name] in [world]" when the world is available, with pagination when needed. When empty, the page displays "No snapshots found" and "There are no snapshots to display." - **Profile gallery:** Open **My Profile** or another person's profile (see [Profiles on sansar.com](/explore/social/profiles-on-sansar-com)), then select the **Snapshots** tab. The **Snapshots** page supports pagination. When empty, it displays "No snapshots" and "[name] hasn't taken any snapshots yet." - **World gallery:** Open a world page (see [Visit a world from sansar.com](/explore/worlds/visit-a-world-from-sansar-com)). If the world has snapshots, the **Snapshots** gallery appears with a count, and you can open them there. If a world has more than 12 snapshots, select **View all** to open its full snapshot gallery page. That page displays **Snapshots by [name]**, "From world: [handle]", and pagination for snapshots taken in that world (not necessarily all taken by the world's owner). When empty, it displays "No snapshots" and "No snapshots from this world yet." ## View and copy an image link 1. Open a global, profile, or world snapshot gallery on sansar.com. 2. Select a snapshot card to open it in the viewer. 3. Select the previous and next arrows (or press your keyboard's left and right arrow keys) to browse. The viewer shows a position counter. In profile and world galleries, more snapshots may load automatically as you browse. 4. Select **Open full size** to open the original image (or the display image if no original is available) in a new tab. 5. Select **Copy image link** to copy the direct image URL. If the link is copied automatically, the button changes to **Copied!**. If automatic copying isn't available, a dialog opens showing "Copy this image link:". 6. Select **×** or press Escape to close the viewer. **Note:** **Copy image link** copies the direct image URL, not a gallery page URL. In profile and world galleries, the browser address updates to follow the open snapshot. A direct gallery link to that address reopens the selected snapshot even if it isn't on the current page. Pressing browser Back closes a viewer you opened normally, while pressing Back on a direct shared link may leave the page. The global **Snapshots** page does not reopen a selected snapshot from a shared URL. ## Share an individual snapshot page An individual snapshot page (`/snapshots/[id]`) displays the full-quality image (or the display image if full quality isn't available). It also shows any caption, the date, a link to the author's profile, and a link to the world when available. Under **Share:**, select **Facebook**, **X**, **Reddit**, **Pinterest**, or **Telegram** to open the selected service in a new tab. The gallery viewer has no link to the individual snapshot page and no **Share:** toolbar. The gallery and individual snapshot pages do not display a **Delete** control. ## If something goes wrong - If a direct snapshot link points to a snapshot that doesn't exist, sansar.com displays a not-found page titled "Snapshot Not Found". - If you need help with snapshots on sansar.com, [contact support](/help/contact-support). Source: https://docs.sansar.com/explore/share/snapshots-on-sansar-com --- # FreeCam and CineCam **Notes:** - Both Freecam and Cinecam are currently only available to Desktop users and cannot be used in VR. - They must be enabled by a worlds creator to be available. - The cameras currently ignore collision. - The mic is located at the avatar, not the camera's position. - Other users' mics cannot be heard in freecam mode unless the avatar is within hearing range. ## FreeCam Aka F4cam **Press F4 on the keyboard or (start) on Xbox Controller** In freecam mode, Desktop users can detach their camera from their avatar and navigate through the virtual environment without being bound to the movements of the avatar itself. This can be especially handy for taking screenshots, recording videos, or simply exploring areas in a more flexible way. ## CineCam Aka F10Cam **Press F10 on the Keyboard or (back) on Xbox Controller** CineCam is similar to Freecam but has smoothed movements to assist in a smoother-looking video or stream when flying around. ## Controls Both modes have the same control scheme. **Keyboard:** - **F4:** Toggle Free camera mode on or off. - **F10:** Toggle Cinematic Cam, a smoothed version of Freecam. - **Arrow keys:** Move camera forward, backward, left, and right (free-camera mode). - **W, A, S, D:** Move camera forward, backward, left, and right (free-camera mode). - **I, K, J, L:** Rotate the camera up, down, left, and right. - **Hold right-click and drag:** Rotate the camera. - **E, C:** Move camera up and down. - **NUMPAD Plus or = Key:** Increase camera movement speed. - **NUMPAD Minus or - Key:** Decrease camera movement speed. - **Hold Shift:** Increase camera movement speed while the key is held. - **Hold Ctrl:** Decrease camera movement speed while the key is held. - **T Key:** Teleports avatar to Freecam/Cinecam location. - **V Key:** Mic Push to Talk at avatar's location. **Controller:** - **Back:** Cinecam toggle like F10. - **Start:** Freecam toggle like F4. - **X Button (X):** Drops avatar at cam location. - **Y Button (Y):** Speed up cam. - **B Button (B):** Slow down cam. - **Left Trigger (LT):** Lower cam. - **Right Trigger (RT):** Raise cam. - **Left Bumper (LB):** Mic push to talk at avatar's location. Source: https://docs.sansar.com/explore/controls/freecam-and-cinecam --- # Game Controller Buttons These controls are for use with the optional Xbox One or Xbox 360 game controller. To see available controls using other controllers, see [Sansar controls](/explore.md#controls)
## Controls for visiting worlds - **A Button (A)** - Jump - **B Button Held (B)** - Teleport beam - **X Button (X)** - Interact/ pickup or drop object - **X Button Held (X)** - Throws held object - **Y Button (Y)** - Crouch - **Left Bumper (LB)** - Mic push to talk - **Right Bumper (RB)** - Teleport beam (DUPLICATE) - **Left Trigger (LT)** - Secondary action like keyboard 'R Key' - **Right Trigger (RT)** - Use held item - **Back** - Cinecam toggle like F10 - **Start** - Freecam toggle like F4 - **Left Stick** - Movement - **Right Stick** - Camera - **Left Stick Press (LS - Press)** - Toggle walk / run - **Right Stick Press (RS - Press)** - Toggle 3rd / 1st person **While throw object is active** - **Right Stick** - Changes trajectory **While teleport beam is active** - **Left Stick** - Moves target location - **Right Stick** - Changes direction you will face when landed ## FreeCam and CineCam Controls AKA F4Cam or F10Cam - **Back** - Cinecam toggle like F10 - **Start** - Freecam toggle like F4 - **X Button (X)** - Drops avatar at cam location - **Y Button (Y)** - Speed up cam - **B Button (B)** - Slow down cam - **Left Trigger (LT)** - Lower cam - **Right Trigger (RT)** - Raise cam - **Left Bumper (LB)** - Mic push to talk at avi Source: https://docs.sansar.com/explore/controls/game-controller-buttons --- # Keyboard Shortcuts for Editing a Scene The controls in this article are specific to editing a scene with a mouse and keyboard. For additional controls available while visiting an experience, see [Keyboard shortcuts (visiting an experience)](/explore/controls/keyboard-shortcuts-experience.md). To see available controls using other controllers, see [Sansar controls.](/explore.md#controls) ## Edit mode camera controls Use these controls when editing a scene in desktop mode: * **Arrow keys:** Move the camera forward, backward, left, and right. * **W,A,S,D:** Move the camera forward, backward, left, and right. * **E,C:** Move the camera up and and down. * **I,J,K,L:** Rotates the camera, If a object is 'Focused' orbits the object. * **NUMPAD+** and **NUMPAD- :** Increase and decrease camera speed. * **Hold left click and drag:** Move the camera left and right. * **Hold right click and drag:** Rotate the camera up, down, left, and right. * **F key :** Focus to a selected object, camera rotation will orbit selection. * **ScrollWheel** Zooms in and out of a selected or 'focused' object ## Action buttons Use these controls when editing objects placed in a scene: ### Selecting objects *** * **Left Click:** Select an object or expose the translate tools to move the object. * **Shift Left/Right Click** Clicking one object after another selects multiple objects while shift is held. * **Right Click** Opens the objects options menu, Will also select if nothing is selected. * **Double Left Click** Opens the properties menu of a object. * **Shift Left Click and drag:** Box Select Multiple Objects. ### Moving Objects *** * **Hold CTRL while an object is selected:** Changes the translate tool to rotate. * **Hold CTRL + SHIFT while an object is selected:** Changes the translate tool to scale. * **CTRL + Z :** Undo last action. * **CTRL + Y :** Redo last Undo. * **CTRL + D :** Duplicates selected objects. * **Delete** or **Backspace button:** Deletes selected objects. Note: If multiple objects are selected movement controls will be located at a center of all selected objects origins. ### Other Hotkeys *** * **CTRL + L key:** Move Lock, Stops a object from being moved * **ALT + L :** Edit Lock, Disables all options in the properties menu of the object except movement ones. * **CTRL + P :** Opens the Properties menu of a selected object. * **CTRL + M :** Opens the Materials Window of a selected Object. Source: https://docs.sansar.com/explore/controls/keyboard-shortcuts-scene --- # Keyboard Shortcuts for Styling Your Avatar > You can use these controls for avatar customization. ## Keyboard shortcuts (styling your avatar) ### Controls for avatar customization Action buttons **Use these controls when editing objects placed in a scene:** * **CTRL + Z:** Undo * **CTRL + Y:** Redo To change views around the avatar: * **Use the mouse scroll wheel**: Zoom in / away from the avatar. * **Press on the left / right mouse button**: Turn the avatar clockwise / counter-clockwise. **Use these controls when modifying the face of a default avatar in the Face tab:** * Press **W**: Switch to _Translate_, which allows you to move the highlighted area up, down, front, back, left and right. * Press **E**: Switch to _Rotate_, which allows you to rotate the highlighted area in different directions. Note that rotate has been disabled for some highlighted face parts. * Press **R**: Switch to _Scale_, which allows you to resize the highlighted area bigger or smaller. **Use these controls when adjusting a Marvelous designer item:** * Click on the clothing and hold the **Left Mouse Button**: Grab a point of the clothing and move it around. * Click on a zipper tab on a MD clothing and hold the **Left Mouse Button**: Pull the zipper up/down the zipper line to open or close the zipper. * Click the **Middle Mouse Button** while holding the **Left Mouse Button**: Place a pin to hold the point in place even after releasing the point. . Pins stay in place permanently until they are removed, even after you finish customizing your avatar. * Click on the pin locations with the **Middle Mouse Button**: Remove pins individually. * Click **W+Left Mouse Button**: Remove all pins on the item or items that are being adjusted. **Other controls:** * **CTRL + T**: Open the chat window to message friends. Nearby chat is disabled. Source: https://docs.sansar.com/explore/controls/keyboard-shortcuts-for-styling-your-avatar --- # Keyboard Shortcuts for Visiting an Experience The controls in this article are for using Sansar with a mouse and keyboard while visiting an experience. For additional controls available while editing a scene, see [Keyboard shortcuts (editing a scene).](/explore/controls/keyboard-shortcuts-scene.md) To see available controls using other controllers, see [Sansar controls.](/explore.md#controls)
## Avatar controls **These controls can be used to move your avatar in VR and desktop mode:** * **Arrow keys:** Move your avatar forward, backward, left, and right . * **W,A,S,D:** Move your avatar forward, backward, left, and right. * **Shift:** Toggle between walking and running, If **Toggle Run** is set to **On** in [Settings](/explore/settings/general-settings.md), you do not need to hold down the key. * **Spacebar:** Jump. Hold longer to jump higher. * **C Key:** Toggle Crouch * **F3:** Toggle between first person and third person view. ## Desktop only controls * **Hold X or middle mouse button:** Teleport Beam. * **Left Click while holding X or middle mouse:** Teleports your avatar to the selected location. * **Scroll while holding X or middle mouse (prior to teleporting):** Choose the direction your avatar faces upon completing the teleport. * **Left Click a dynamic object while standing near it:** Pick up and hold a dynamic object. * **Hold and then release the left Click** While holding a dynamic object, throw the object when you release the left mouse button. The longer you hold the button, the farther you throw the object. * **Scroll while holding left mouse button** - While holding a dynamic object, modify the distance you will throw the object. * **F Key :** Drops held object, if held object will be thrown. * **R Key :** Alternate use button, can be assigned by scripts to functions ## Camera controls * **Hold right click and drag:** Rotate the camera up, down, left, and right. * **I,K,J,L:** Rotates the camera, up, down, left, and right. * **Scroll Wheel** Zooms in and out of the avatar, will enter 3rd Person mode if close enough. * **F3 Key :** Toggle 3rd Person mode. * **F4 Key :** Toggle Freecam AKA F4Cam, see below for details. * **F7 Key :** Toggle [Mouselook mode.](/explore/controls/mouselook-mode.md) * **F10 Key :** Toggle CineCam AKA F10Cam, See Below for details. ## FreeCam and CineCam Controls AKA F4Cam or F10Cam * **F4:** Toggle Free camera mode on or off. * **F10** Toggle Cinematic Cam, a Smoothed version of Freecam. * **Arrow keys:** Move camera forward, backward, left, and right (free-camera mode). * **W,A,S,D:** Move camera forward, backward, left, and right (free-camera mode). * **I,K,J,L:** Rotates the camera, up, down, left, and right. * **Hold right click and drag:** Rotate the camera * **E, C :** Move camera up and down. * **NUMPAD Plus or = Key:** Increase camera movement speed. * **NUMPAD Minus or - Key:** Decrease camera movement speed. * **Hold Shift:** Increase camera movement speed while key is held. * **Hold Ctrl:** Decrease camera movement speed while key is held. * **T Key:** Teleports avatar to Freecam/Cinecam location ## Chat controls Use these controls with text on the Chat Panel in desktop mode: * **CTRL + X:** Cut text. * **CTRL + C:** Copy text. * **CTRL + V:** Paste text. * **CTRL + A:** Select all text. * **CTRL+T:** Open/close the chat panel. * **CTRL+E:** Open the [Emotes menu](/avatars/basics/avatar-emotes.md). * **M Key:** Toggle microphone on/off. * **V Key:** Push To Talk mic. ### Debug controls Use this control to trigger the Script Console: * **CTRL + D:** Toggle the Script Console on/off Source: https://docs.sansar.com/explore/controls/keyboard-shortcuts-experience --- # Mouselook Mode While visiting an experience in Desktop mode, you can press **F7** to toggle Mouselook mode. With the following effects: * The Menu UI disappears * **F7** has a target reticle pop up an the camera follows mouse movement. * You can steer the camera and your avatar by moving the mouse without having to hold right click. * Your avatar only turns when moving, so you won't turn in place while looking around, But if holding a object your arm will follow the cameras movement. Mouselook mode facilitates a more immersive movement and aiming with certain tools and weapons your avatar has picked up while in Desktop mode (VR users can easily aim using their VR controllers).

Mouselook Mode reticle in 3rd person

Source: https://docs.sansar.com/explore/controls/mouselook-mode --- # General Settings > Select preferences in the Settings panel to adjust certain Sansar user interface elements to your liking. Once set, these preferences persist between logins. You can select preferences in the Settings panel to adjust certain Sansar user interface elements to your liking. Once set, these preferences persist between logins. To access the Settings panel, choose **More options > Settings** from the main menu. **Available settings** You may toggle the following options in the Settings panel: **Audio output** * **Master audio** - Adjust all audio sliders at once. * **Voice audio** - Adjust the voice chat level when visiting a world. * **World audio** - Adjust all music and video sounds that play in a world. * **UI music** - Adjust the background music that plays when not visiting a world or editing a scene, such as when viewing the login screen. * **UI sound effects** - Adjust the sound effects that play when you interact with Sansar's user interface, such as when you click a button. * **Desktop device** - Choose a device for audio output when in Desktop mode. * **VR device** - Choose a device for audio output when in VR. **Microphone** * **Check mic level** - Click the microphone button to activate the monitor, then speak into your microphone to hear your own voice and see the volume level displayed in the monitor. This option is helpful for helping you determine how others hear your voice. * **Microphone level** - Set the volume level of your microphone. * **Desktop device** - Choose a device for audio input when in Desktop mode. * **VR device** - Choose a device for audio input when in VR. * **Voice server status** - Check the status of the voice server. This should say "Active" when the voice server is working properly. **General** * **Starting World** - Choose where you enter Sansar when you log in. You may choose between The Nexus, your private home space, or your avatar Lookbook. * **Toast notifications** - Toggle notifications that appear when events occur in the People and Chat apps. * **Toggle Run** - When set to **On**, you can press **Shift** to toggle between running and walking without having to hold down the Shift key. * **Typing indicator** - Toggle the indicator that appears over avatars' heads when they are typing in text chat. * **Voice indicator** - Toggle the indicator that appears over avatars' heads when they are speaking in voice chat. * **Avatar info on select** - Toggle whether or not names and action buttons appear when hovering your cursor over another avatar. * **Enable tutorial hints** - Enable hints to help you learn your way around using Sansar. * **Reset tutorial hints** - Reset the tutorial hints. You may want to do this if you have forgotten previous hints. * **Reset panel positions** - Click **Reset** to reset the position of all panels in the Sansar client. **Known issue:** If you make changes to notifications, you must restart Sansar in order for the changes to take into effect. **Graphics** * **Shadowed Atmospherics** - Enables/Disables godrays on Desktop and/or VR. This is disabled for VR by default to improve frame rate. * **Ambient occlusion** - Enables/disables ambient lighting in the scene. It is beneficial for users with lower-end PCs to disable this.This is disabled for VR by default to improve frame rate. * **Render quality** - Adjust the streaming quality of media streams. There are a few options available to adjust the video quality. Take note that if you change the Media Graphics Mode settings, you must restart Sansar in order for the changes to take into effect. * **Auto-Detect** - This is the default setting. When auto-detect is selected, the system detects the hardware and automatically adjusts the settings based on it. * **High** - Set video playback in all media streams at the highest, optimal quality level (Full CPU). * **Medium** - Set video playback in all media streams to a reasonable quality level (No compositing). * **Low** - Set video playback in all media streams to the lowest, recommended level (No compositing). * **Mirror VR view on desktop** - Mirror a copy of your VR view in a window on your desktop. This setting is set to Off by default. **Note**: If you are continuously experiencing crashing issues when entering worlds with media streams, try adjusting the Media Graphics Mode's setting to medium or low. You may have to test it out by trial and error to see what works best for your hardware. **VR** * **Remember height** - Remembers your height between sessions so you don't need to calibrate every time you log in. * **Show height in meters** - Shows height in meters rather than the default feet and inches. * **Snap Turn Angle** - Sets the degree of rotation when Snap Turn is enabled. When set at 0, Snap Turn is disabled and rotation will be smooth. To turn Snap Turn on, set the rotation anywhere between 15 to 90 degrees. **Comfort zone** To mitigate the feeling of someone invading your personal space, the comfort zone is an area around your avatar in which other avatars disappear from your sight. Comfort zones work in both desktop and VR mode. * **Friends** - Set the distance at which the comfort zone will trigger with friends. By default, this is set at 0 meters (Off). You can turn this on and set your desired comfort zone radius by moving the slider. * **Non-friends**- Set the distance at which the comfort zone will trigger with non-friends. By default, this is set at 0 meters (Off). You can turn this on and set your desired comfort zone radius by moving the slider. **Desktop Avatar Controls** * **Keyboard Turn** - If set to **On**, your avatar turns left and right when pressing **A** or **D** respectively. If set to **Off**, your avatar sidesteps to the left or right (without turning) instead. * **Face Forward** - If set to **On**, your avatar attempts to face the direction your camera is looking while you are moving. If set to **Off**, your avatar faces the direction your are moving. **Desktop Camera** * **Horizontal offset** - Change the default left-right position of the camera behind your avatar. The default value for this setting is 0.65. | ![Settings panel](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------ | | The Settings panel. | Source: https://docs.sansar.com/explore/settings/general-settings --- # HTC VIVE controls ## HTC Vive controls This article covers the usage of the HTC Vive controllers in Sansar. For information about other control methods, see [Sansar controls.](/explore.md#controls)
| Controls for the HTC Vive when visiting worlds. | | ------------------------------------------------ | ## World controls Use these controls while visiting a world: * **Right trackpad:** Rotates the camera. * **Left trackpad:** Move forward, back, left, or right. * **Double-press left trackpad:** Run forward, backward, left, or right. * **Hold Forward/Up (Right trackpad):** Bring up the teleport beam. * **While holding down, rotate your finger on the right trackpad:** Change the direction the avatar faces upon teleport. * **Release right trackpad:** Teleport to targeted location. * **Press Backward/Down (Right trackpad):** Jump. Hold longer to jump higher. * **Left menu button:** Open or close the VR app launcher. Navigate the app launcher using the Vive wands; press any button on the inactive wand to switch hands. * **Right menu button:** Selects the highlighted option. * **Trigger buttons:** Grab dynamic unconstrained objects or the chat app (if open); selects the highlighted option in menu. * **Gaze on an avatar and hold the trigger button:** To gaze on something, move your head and hover the circular bubble within your line of sight over the avatar. See the avatar's name and ID and have access to the mute/unmute and add/remove friend buttons. * **F5 (keyboard):** Toggle between simple and advanced controls. * **F3 (keyboard):** Toggle between first person and third person mode. * **Crouch:** If you crouch low enough, your avatar enters a crouching/sneaking stance and moves slower. **Simple controls:** * **Right trackpad** - Disabled. * **Left trackpad** - Move forward, back, left, or right. * **Double-press left trackpad:** Run forward, backward, left, or right. **Advanced controls:** * **Right trackpad** - Rotates the camera. * **Left trackpad** - Moves avatar forward, back, left, or right. * **Double-press left trackpad:** Run forward, backward, left, or right. **In third person mode:** * **Right trackpad** - Moves camera around your avatar. * **Left trackpad** - Moves avatar forward, back, left, or right. * **Double-press left trackpad:** Run forward, backward, left, or right. ## Edit mode controls Use these controls while editing a scene in VR: * **Right trackpad** - Rotate the camera left and right. * **Left trackpad** - Move the camera forward, back, left, and right. * **Hold Forward/Up (Right trackpad):** Bring up the teleport beam. * **While holding down, rotate your finger on the right trackpad:** Change the direction the camera faces upon teleport. * **Release right trackpad:** Teleport to targeted location. **Note:** While in edit mode, the teleport beam will only adjust the camera location point, and not a physical avatar. You can teleport to anywhere the targeting beam touches. You do not need to land on a flat surface. * **Trigger buttons** - Select/Deselect currently targeted object. **Note:** Select an object again to deselect it. Alternatively, you can also point and select the skybox in order to deselect all selected objects when in multiselect mode (you must have a visible line of sight to the skybox). * **Rotate controller 180 degrees (look at the palm of your hand)** - Opens the tool palette. If you have selected objects, you also gain access to **Duplicate**, **Delete**, and **Lock** functions. You can make selections from the palette by targeting it with the other controller and pressing the trigger. * **Trigger buttons** - Grab and move all currently selected objects. * **Hold both grip buttons while targeting an object with both controllers** - Rotate all currently selected objects. * **Thumbstick while targeting an object with the grip button held** - Move the object closer to or farther from the controller. * **Hold both grip buttons and one trigger while targeting an object with both controllers** - Scale the object's size by moving the controllers together or apart. Source: https://docs.sansar.com/explore/vr/htc-vive-controls --- # Oculus Rift Controls ## Oculus Rift controls This article covers the usage of the Oculus Touch controllers for the Oculus Rift in Sansar. For information about other control methods, see [Sansar controls.](/explore.md#controls)
[Image: Touch controllers]
Touch controls
## Experience controls Use these controls while visiting an experience: * **Rotate right thumbstick:** Rotate the camera up, down, left, and right. * **Rotate left thumbstick:** Moves the avatar forward, back, left, or right. * **Press left thumbstick while moving:** Run in the current movement direction. * **Press right thumbstick:** Toggle first person / third person view. * **B:** Jump. Hold longer to jump higher. * **A** or **X**: Teleport to targeted location or select a menu option from the App Launcher. * **Thumbstick on opposite hand while holding A** or **X** - Change the direction your avatar will face after completing the teleport. * **Y button:** Open or close the VR main menu on your left wrist. Navigate the menu using the right Oculus Touch controller. * **A button:** Select a menu option. * **Grip button:** Grab dynamic unconstrained objects or the chat app (if open). * **Gaze at an avatar and hold the grip button:** To gaze on something, move your head and hover the circular bubble within your line of sight over the avatar. See the avatar's name and ID and have access to the mute/unmute and add/remove friend buttons. * **Crouch:** If you crouch low enough, your avatar enters a crouching/sneaking stance and moves slower. **Note:** Matching your height with your avatar is now accomplished through the VR app launcher. ## Edit mode controls (currently unavailable) **Use these controls while editing a scene in VR:** * **Right thumbstick** - Rotate the camera up, down, left, and right. * **Left thumbstick** - Move the camera forward, back, left, and right. * **Tap A** or **X button** - Select/Deselect currently targeted object. **Note:** Select an object again to deselect it. Alternatively, you can also point and select the skybox in order to deselect all selected objects when in multiselect mode (You must have a visible line of sight to the skybox). * **Hold A** or **X** **button**\*\*:\*\* Point to a teleport destination while holding the trigger. Use the **thumbstick** on the opposite hand to change the direction your camera faces upon teleporting. **Note:** While in edit mode, the teleport beam will only adjust the camera location point, and not a physical avatar. You can teleport to anywhere the targeting beam touches. You do not need to land on a flat surface. * **Rotate controller 180 degrees (look at the palm of your hand)** - Opens the tool palette. Gives you the option to toggle display options (mesh, physical shapes, lights, scene lights), save, publish, apply surface snap, scale the scene, undo, and redo. If you have selected objects, you also gain access to **Duplicate**, **Delete**, and **Lock** functions. You can make selections from the palette by targeting it with the other controller and pressing the trigger. * **Grip button** - Grab and move all currently selected objects. * **Hold both grip buttons while targeting an object with both controllers** - Rotate all currently selected objects. * **Thumbstick while targeting an object with the grip button held** - Move the object closer to or farther from the controller. * **Hold both grip buttons and one trigger while targeting an object with both controllers** - Scale the object's size by moving the controllers together or apart. Source: https://docs.sansar.com/explore/vr/oculus-rift-controls --- # Vive Index Controls This article covers the usage of the Valve Index controllers for the HTC Vive in Sansar. For information about other control methods, see [Sansar controls](/explore.md#controls). Note: We currently do not support the Vive Index headset. ## Experience controls Use these controls while visiting an experience: * **Rotate right thumbstick:** Rotate the camera left, and right. * **Rotate left thumbstick:** Moves the avatar forward, back, left, or right. * **Press left thumbstick while moving:** Run in the current movement direction. * **Press right thumbstick:** Toggle first person / third person view. * **B:** Jump. Hold longer to jump higher. * **A**: Teleport to targeted location or select a menu option from the App Launcher. * **Thumbstick on opposite hand while holding A** - Change the direction your avatar will face after completing the teleport. * **B button:** Open or close the VR main menu on your left wrist. Navigate the menu using the right Oculus Touch controller. * **A button / Trigger / Grip (squeeze):** Select a menu option. * **Grip button (Squeeze with pressure):** Grab dynamic unconstrained objects or the chat app (if open). * **Gaze at an avatar and hold the grip button:** To gaze on something, move your head and hover the circular bubble within your line of sight over the avatar. See the avatar's name and ID and have access to the mute/unmute and add/remove friend buttons. * **Crouch:** If you crouch low enough, your avatar enters a crouching/sneaking stance and moves slower. * **Trigger**: Activate item you are holding (pew pew guns) **Note:** Matching your height with your avatar is now accomplished through the VR app launcher. Source: https://docs.sansar.com/explore/vr/vive-index-controls --- # Avatar Hand Gestures in VR While in VR, you can use your Oculus Touch or HTC Vive wand controllers to perform hand gestures, such as pointing, thumbs-up, or "ok". **Note:** The HTC Vive wand controllers have limited support for hand gestures in Sansar. At this time, the only available hand gesture for Vive is to make a fist (activated by pressing the trigger on either controller). ## Performing hand gestures The basic controls for performing hand gestures are as follows: * **Triggers** - On Oculus Rift, curls your avatar's index finger. The more you depress the trigger, the farther your finger curls. On Vive, curls all fingers into a fist. * **Grip buttons** - On Oculus Rift, curls your avatar's remaining fingers (except for the thumb). The more you depress the grip button, the farther your fingers curl. Not available on Vive. * **Thumb stick or buttons** - On the Oculus Rift, you don't need to press these controls. If you simply rest your thumb on the thumb stick, buttons, or top of the Rift Touch controller, your avatar's thumb curls in. Not available on Vive. By using combinations of these basic controls, you can create many familiar hand gestures. Source: https://docs.sansar.com/explore/vr/avatar-hand-gestures --- # Calibrating Height in VR When using Sansar with a VR headset, you should make sure to calibrate your height. Height calibration affects the elevation of you your first-person point of view, and plays a role in scaling how your avatar is animated when you move your arms, legs, and head. Entering your height manually **You can set your height manually while in VR:** 1. Open the main menu on your left wrist by pressing **Y** on your Oculus Rift controller or **Left Menu** on your HTC Vive controller. 2. Using your opposite hand, select **Set height** from the main menu. 3. Use your VR controller to activate the up and down arrows until your correct height is displayed. 4. Click **Ok** to confirm your height. Detecting your height automatically Sansar can estimate your height automatically by measuring the length of your arms: 1. Open the main menu on your left wrist by pressing **Y** on your Oculus Rift controller or **Left Menu** on your HTC Vive controller. 2. Using your opposite hand, select **Set height** from the main menu. 3. Choose **Detect**. 4. Extend your arms outward, then hold any button on your VR controller until calibration completes. 5. Click **Ok** to confirm your height. Height calibration settings There are some Sansar [settings](/explore/settings/general-settings.md) that affect height calibration: * **Remember height** - Remembers your height between sessions so you don't need to calibrate every time you log in. * **Show height in meters** - Shows height in meters rather than the default feet and inches.
Calibrating height settings
VR height settings.
Source: https://docs.sansar.com/explore/vr/calibrating-height --- # Body Tracking Vive You can use [VIVE Trackers](https://www.vive.com/us/vive-tracker/) to track the positions of your right foot, left foot, and waist for improved body tracking and avatar movement in Sansar. | | | ---------------------------------------------------------- | | An avatar dancing in Sansar with full body tracking in VR. | **VIVE tracker setup** For each tracker:
1. In SteamVR, choose **Devices > Pair Controller**. | Choose **Devices > Pair Controller**. | | ------------------------------------- | 2. Hold down the VIVE Tracker's button until it syncs with SteamVR. 3. Follow the onscreen setup instructions to complete pairing the Tracker. **To set up each tracker for use in Sansar:** 1. Launch Sansar. 2. In SteamVR, choose **Devices > Configure Controller**. If you are prompted to choose an application, choose Sansar. 3. Each of the trackers you have just set up should appear as "Vive Tracker in Hand". Select one and then click **Manage**. 4. On the Manage Trackers page, click **Held in Hand** and change it to one of the following: * **Left foot** * **Right foot** * **Waist** 5. Repeat this process for the remaining trackers until you have set one Tracker each for Left foot, Right foot, and Waist. **Known issues** **As of April 30, 2019, there is a bug in SteamVR can cause VIVE Trackers to become unrecognized in Sansar. To work around this issue:** 1. In SteamVR, choose **Devices > Configure Controller**. 2. Under Current Binding, click **Edit**. 3. Add, then remove any button mapping. You can add a button mapping by clicking the **Power +** symbol. 4. Select **Edit action pose** and set it to **Unused**, then back to **Pose**. 5. Save your local changes and go back to Sansar. Source: https://docs.sansar.com/explore/vr/body-tracking-vive --- # Avatars > Customize and dress your avatar, import and manage avatar items, and find reference files for making your own. ## Avatar basics - [Avatar 2.0 FAQ](/avatars/basics/avatar-faq) - [Customizing Your Avatar](/avatars/basics/customizing-avatar) - [Avatar Emotes](/avatars/basics/avatar-emotes) - [The Avatar Editor](/avatars/basics/avatar-editor) See also: - [Keyboard shortcuts for styling your avatar](/explore/controls/keyboard-shortcuts-for-styling-your-avatar) ## Dressing your avatar - [Fitting Designer Clothing to your Avatar](/avatars/dressing/fitting-designer-clothing-to-your-avatar) - [Setting Custom Emotes](/avatars/dressing/setting-custom-emotes) - [Wearing Accessories](/avatars/dressing/wearing-accessories) - [Wearing Rigged Clothing](/avatars/dressing/wearing-rigged-clothing) ## Importing avatar items - [Importing Avatar-Related Items](/avatars/import/importing-avatar-related-items) - [Importing Accessories](/avatars/import/importing-accessories) - [Importing a custom emote animation](/avatars/import/importing-custom-emote-animation) See also: - [Importing Items to Sansar (all import guides)](/create/import/importing-items) ## Managing avatar items - [Editing an inventory item's name](/avatars/items/editing-inventory-items-name) - [Editing an inventory item's image](/avatars/items/editing-inventory-items-image) - [Deleting avatar looks from your inventory](/avatars/items/deleting-avatar-items-from-your-inventory) - [Managing your avatar looks inventory items](/avatars/items/managing-avatar-looks-inventory-items) ## Avatar resources - [Avatar Reference Files](/avatars/resources/avatar-reference-files) - [Blender - Avatar files](/avatars/resources/blender-avatar-files) - [Blender - Using Decimate Tool](/avatars/resources/blender-using-decimate-tool) - [Exporting Custom Avatars From Blender](/avatars/resources/exporting-custom-avatars-from-blender) - [Sansar Skeleton Skinning Details](/avatars/resources/sansar-skeleton-skinning-details) - [Using Animation Skeleton](/avatars/resources/using-animation-skeleton) Source: https://docs.sansar.com/avatars --- # Avatar 2.0 FAQ > For more details on Avatar 2.0 and the changes, check out New avatars. New possibilities. ## What items are sunsetting with the release of avatar 2.0? Any asset under the following item types (avatars, rigged hair, rigged clothing) created using the avatar 1.0 avatar skeleton will no longer be usable in the new avatar 2.0 system. It is key to be aware of which items are sunseting so purchasers have better insight on the items prior to purchase. ## Which avatar 1.0 assets can I still wear after the release of avatar 2.0? All Marvelous Designer clothing, accessories and emotes created against the 1.0 avatar skeleton will still be usable on the 2.0 avatar. These items will still be available in your inventory and any listed items will still be accessible from the store for purchase. However, any rigged hair, rigged clothing or avatars will no longer be usable on any 2.0 avatar. ## Why do avatars, rigged hair, and rigged clothing have to sunset? Changes to the base avatar's skeletal structure had to be made in order to support Avatar 2.0. Because of this, we had to make a tough decision to no longer support avatar 1.0, which meant that avatars, rigged hair and rigged clothing uploaded prior to the change would no longer be supported. ## Will I be able to update my broken content? Yes, you will be able to update any of the affected content such as avatars, rigged hair, and rigged clothing. Creators will be given one opportunity per affected store listing to update their listings with Avatar 2.0-compatible content. Source: https://docs.sansar.com/avatars/basics/avatar-faq --- # Customizing Your Avatar > Creating custom avatar in Sansar. **Note:** You can customize your avatar in both Desktop mode and VR mode, and all customization features are available in both modes. The arrangement of panels and icons in VR has been made more compact, and is available in your left hand during customization. After you [set up your account](/account/create-account.md) and log into Sansar, you can choose from a selection of custom avatars or customize the look of a new avatar. This article will focus on customizing an avatar. To begin customizing your avatar: 1. Choose **Create > Style my avatar** from the main menu. 2. Select an avatar from the Lookbook. If none are available, choose **Create new look** to add a default avatar to the list. 3. Click **Customize** to begin customizing your avatar.
## Customization options During avatar customization, there is a panel on the right side of the screen that contains several tabs. Each of these tabs either provides controls to alter your avatar's appearance, or provides access to clothing, hair, and accessories from your inventory. Alternately, you can click **Randomize** in the bottom-left corner of the screen to let Sansar choose a random assortment of appearance settings and default clothing. ## Avatar This tab includes two sub-tabs at the top: **Avatar type** and **Options**: * **Avatar type** - Choose the male or female silhouette to use a standard male or female Sansar avatar. These avatars can be adjusted further using the other appearance tabs. If you have purchased any custom avatars from the Sansar Store, you may select them here. * **Scale** - You can adjust the avatar's size to be bigger or smaller. Note that you can only adjust the size of the avatar uniformly.

The Avatar type tab

***

Scale on the options tab

*** ## Hairstyles This tab lets you choose your hairstyle and color. Click the thumbnail of a hairstyle you like to try it on your avatar. You can purchase additional hairstyles from the [Sansar Store](https://www.sansar.com/store) or [import some of your own](/avatars/import/importing-avatar-related-items.md).

The Hairstyles tab. The active hairstyle is highlighted with a green outline.

*** ## Face This tab provides direct face manipulation tools and sliders to control the shape of your avatar's face and allows you to change your avatar's skin and eye color. Note that all face tab features are only applicable to Sansar's default avatars. **Face presets** First, pick a face from the Face Presets list. You can use one of the face presets or modify it further by clicking on the face of the avatar. Click a thumbnail image to select a face preset, or click it a second time to remove it. Once you've modified a face preset, you also have the option to save your changes as a preset so you can access it easily again later. In future updates, you will be able to sell face presets you've created in the Sansar Store.

The face tab

*** **Face deformation tools & sliders** The bulk of editing a face is done by clicking on the area that you want to adjust. Hover your cursor over the face to reveal highlights that show which areas will be affected by clicking and moving that highlighted area.

Click and drag the highlighted area to modify it.

*** Above the head, you will find the four deformation level modes and translate, rotate and scale buttons. The four deformation levels consists of: * **Head** - Allows you to modify the entire head. * **Section** - Allows you to modify large sections of the face. * **Feature** - Allows you to go deeper and modify facial features. * **Part** - Allows you to go even deeper and fine tune specific parts of facial features. The tools available are: * **Translate** - Allows you to move the highlighted area up, down, front, back, left and right. You can click on the icon or press **W** to select translate. * **Rotate** - Allows you to rotate the highlighted area in different directions. Note that rotate has been disabled for some highlighted face parts. You can click on the icon or press **E** to select rotate. * **Scale** - Allows you to resize the highlighted area bigger or smaller. You can click on the icon or press **R** to select scale. You can edit your avatar further with the sliders in the inventory panel. However, these sliders are meant for fine details that are not achievable by clicking and dragging on the avatar face. They are not meant for deep modification of the face. **Skins** On the Face tab, you can access a selection of skins, which will be applied to the entire avatar. Click a thumbnail image to select a skin, or click it a second time to remove it. In future updates, you may be able to add your own skins. **Eye color** On the Face tab, you can access a selection of eye colors, which will be applied to both of the avatar's eyes. Click a thumbnail image to select an eye color, or click it a second time to remove it. In future updates, you may be able to add your own eye colors. ## Clothing Choose articles of clothing for your avatar to wear. Click a thumbnail image to add that clothing to your avatar, or click it a second time to remove it. Check out the quests from Agent Primus and his friends to earn some free clothing! You can also purchase additional clothing from the [Sansar Store](https://www.sansar.com/store) or [import some of your own](/avatars/import/importing-avatar-related-items.md). Some clothing in Sansar is marked with a yellow "M" banner. This indicates that the clothing was created in [Marvelous Designer](/create/marvelous-designer/integration.md) and can be further adjusted once your avatar is wearing it. Click the **Adjust Clothing** button at the top of the screen to begin the cloth simulation that allows you to pull, stretch, zip, and pin Marvelous Designer clothing. See [Fitting Marvelous Designer clothing to your avatar](/avatars/dressing/fitting-designer-clothing-to-your-avatar.md) for more information.

The Clothing tab. Worn clothing is highlighted with a green outline.

*** ## Accessories The accessories tab works the same way as the Clothing tab, except that accessories are typically smaller items such as glasses, jewelry, or other adornments. Accessories can be further sorted by clicking the icons at the top of the panel: glasses, earrings, necklaces, watches, and rings. Click a thumbnail image to add that accessory to your avatar, or click it a second time to remove it. You can purchase additional accessories from the Sansar Store or [import some of your own.](/avatars/import/importing-accessories.md)

The Accessories tab.

*** ## Animation Preview and replace emote animations for your avatar. See [Avatar emotes](/avatars/basics/avatar-emotes.md) for more information.

The Animation tab.

*** ## The Worn Items panel The Worn Items panel lists all hair, clothing, and accessories that your avatar is currently wearing. You can quickly find and remove any of these items from your avatar by clicking the **minus** button next to the item's name. For Marvelous Designer clothing, an **adjust item** button and a **translate** button appears next to the item's name. You can click these buttons to begin adjusting that specific piece of clothing as described in [Fitting Marvelous Designer clothing to your avatar](/avatars/dressing/fitting-designer-clothing-to-your-avatar.md).

The Worn Items panel.

*** Note: If your avatar is wearing an item that has been deleted from your inventory, it will be available on the worn item panel until you remove it. Once you've removed the item, you will have to add the item back in your inventory to wear it again. ## Where to get clothing, hair, and accessories You can purchase additional clothing, hair, and accessories from the [Sansar Store](https://www.sansar.com/store).

New appearance items are marked with the word New in the corner of the thumbnail. A numbered badge indicates the number of new items in each tab of the appearance editor.

*** If you are a creator, you can import your own creations to Sansar by following the instructions in these articles: * [Importing clothing](/avatars/import/importing-avatar-related-items.md) * [Importing hair](/avatars/import/importing-avatar-related-items.md) * [Avatar attachments (accessories)](/avatars/import/importing-accessories.md) You can change body and face shapes on custom avatars that include blend shapes or shape keys. The available controls depend on the avatar. Source: https://docs.sansar.com/avatars/basics/customizing-avatar --- # Avatar Emotes > Avatar emotes are short, predefined, animations that your avatar can perform in order to non-verbally express emotions and sentiments. ## Emotes overview _Avatar emotes_ are short, predefined animations that your avatar can perform in order to non-verbally express emotions and sentiments. Emotes are triggered by using the Emotes menu or Numbers 1 - 9 on your Keyboard

An avatar performing the /clap emote.

*** ## Emotes menu The Emotes menu allows you to choose from the list of available emotes rather than typing them into Nearby chat. To access the Emotes menu, choose **Socialize > Emotes** from the main menu, or press **Ctrl + E** on your keyboard while in an experience. To dismiss the Emotes menu, click the **X** in the corner of the menu.

Access the Emotes menu by choosing Socialize > Emotes from the main menu or by pressing Ctrl + E while in an experience. Click an emote in the list to make your avatar perform the animation. To dismiss the Emotes menu, click the X in the center of the menu.

*** ## List of avatar emotes Here is a list of avatar emotes that are currently available. Enter them in the [Chat panel](/explore/social/chat-panel.md) and press **Enter** to trigger them, or choose from the [Emotes menu](#emotes-menu) above. Each avatar emote falls under one of two avatar emote types: * Upper body emotes * Full body emotes **Note:** It is possible to replace the animations played by these emotes with custom animations that you either import to Sansar or purchase from the Sansar Store. See [Overriding emotes with custom animation](/avatars/dressing/setting-custom-emotes.md) for more information. Upper body emotes Upper body emotes play for a short period of time when triggered while sitting. To play it again, you must trigger the emote again. Since these emotes are upper body in nature, it can be mixed with different movements on the lower half of the body. For example, the animation may be triggered while standing To learn how to overwrite an avatar emote, see [Previewing and setting custom emotes](/avatars/dressing/setting-custom-emotes.md). To learn how to import avatar emotes, see [Importing a custom emote animation](/avatars/import/importing-custom-emote-animation.md). Source: https://docs.sansar.com/avatars/basics/avatar-emotes --- # The Avatar Editor > The editor lets you select from a lineup of currently available avatars. The Avatar editor lets you select from a lineup of currently available avatars. _In the instructions below, “click” means either:_ * **Left-click using the mouse** * _Press the “A” button on Oculus Rift controls or game controller._ * _Press the "right menu" button on the HTC Vive controls._ **Note:** The Avatar Editor is not available in VR mode. **To change your avatar** 1. On the Main Menu, click on **Create > Style my avatar**. 2. Click one of the available avatars; you may pan left and right by moving your mouse cursor to the left or right side of the screen. 3. To save changes, click **Next**. To keep the original appearance of your avatar, click **Cancel**\*\*.\*\* Source: https://docs.sansar.com/avatars/basics/avatar-editor --- # Fitting Designer Clothing to your Avatar ## Fitting Marvelous Designer clothing to your avatar [Marvelous Designer](/create/marvelous-designer/integration.md) is a third-party modeling tool that allows the easy creation of 3D virtual clothing using patterns, like those used in sewing. Sansar integrates some of Marvelous Designer's technology, allowing you to import clothing from Marvelous Designer and use its cloth simulation feature to adjust the fit of your clothing exactly how you want it. Roll up sleeves, smooth out wrinkles, or pop your collar! Wearing Marvelous Designer clothing Once you have purchased or uploaded some Marvelous Designer clothing, you can add it to your avatar the same way you would add any other piece of clothing or accessory: 1. Open the avatar editor by choosing **Create >** **Style my avatar** from the main menu. 2. Select an avatar from the Lookbook, which is a list of your saved avatar looks, and click **Customize**. 3. Click the **Clothing** tab to view your available clothing. Marvelous designer clothing is marked with a Marvelous Designer "M" logo. 4. Click the thumbnails in the clothing tab to add or remove articles of clothing. Note that there is currently a limit on the number of pieces of clothing you can wear at one time.

Marvelous Designer clothing is marked with an "M" logo.

*** ### Adjusting Marvelous Designer clothing Once you are wearing some Marvelous Designer clothing, you can adjust it in adjust mode. While customizing your look, click the triangular **Play** button next to a clothing item to adjust that item, or click **Adjust Clothing** to adjust all Marvelous Designer clothing on your avatar.

Click the triangular Play button next to a clothing item to adjust that item, or click Adjust Clothing to adjust all Marvelous Designer clothing on your avatar.

*** Once you are in this mode, your avatar enters a "T" pose. You can do the following adjusting actions with any Marvelous Designer clothing: ### Grabbing Grabbing allows you to fit an article of Marvelous Designer clothing better on your avatar. This is especially helpful when you see some patches of the avatar body poking out from the clothing or when you want to move the cloth such as a hood on a hoodie. Click the clothing with your **Left Mouse Button** and drag it to re-position any part of an article of Marvelous Designer clothing. In VR, you can grab clothing using the **Grip Button**. As you pull one section, the rest of the garment shifts accordingly as cloth would.

Click and drag while in adjust mode to adjust a garment's fit and position. For example, this hood was pulled over the avatar's head.

*** ### Pulling zippers If your clothing has a zipper, you can zip or unzip it by clicking and dragging the zipper tab up/down. Click the clothing with your **Left Mouse Button** and drag it to re-position any part along the zipper line. In VR, you can move the zipper using the **Grip Button**. Note that the zipper does not move in real time. The zipper will unzip or zip after you move the tab to the desired spot.

Drag the zipper tab up or down to zip or unzip zippered clothing.

*** ### Pinning clothing You may _pin_ clothing to your avatar to prevent it from pulling away from the pinned location while you adjust it. Pin clothing up by pressing the **Middle Mouse Button** while holding the **Left Mouse Button**. You may also remove pins individually by clicking the pin locations with the **Middle Mouse Button** or press **W+Left Mouse Button** to remove all pins. Pins stay in place permanently until they are removed, even after you finish customizing your avatar. Add or remove pins using **A** or **X** on Oculus Rift or the **Application Button** on Vive. Note that you may only grab with one hand at a time.

Note: At this time, there is no visual indicator for active pins. Clothing simply "sticks" at the pinned location and does not pull with the rest of the clothing.

*** ### Saving and resetting changes When you are finished adjusting your clothing, click **Done Adjusting** to finalize your clothing adjustments. If you are not happy with the results, you can also click **Reset item** to revert the changes back to the state before you made adjustments. These buttons can be found at the bottom center of the screen in adjust mode. Note that adjusting clothing is not currently possible while visiting a scene; you must make all clothing adjustments while customizing your look in the avatar editor. ### Transform Marvelous Designer clothing At times, you may find that some clothing doesn't fit your avatars well. With Marvelous Designer clothing, you can move or resize the item so that it fits better on your avatar. For example, if you put clothing made for a smaller avatar on a larger avatar, or if you put female clothing on a male avatar, the clothing may clip through the avatar's body or the clothes may not align to the body well.

Click on the transform item button to move, rotate or resize a clothing item.

*** Sansar supports the following transform actions so you can fit articles of clothing better on an avatar: ### Translate You may move the clothing item left, right, up, down, back and front using the Translate tool. To move the item: 1. On the worn items panel, click the **translate** button to expose the translation _gizmo_. This is also the default mode when entering transformation mode. 2. To move the clothing item, use the **red**, **green**, and **blue** **arrows** on the gizmo to move the object on the X, Y, and Z axis respectively.

Click the Translate button on the worn items panel to expose the translation gizmo.

*** ### Rotate You may rotate the clothing item to the left, right, up, down, back and front using the rotate tool. To rotate the item: 1. On the worn items panel, click the **rotate** button to expose the rotation _gizmo_. 2. To rotate the clothing item, use the **red**, **green**, and **blue** **circles** to rotate the selected object around the object's X, Y, and Z axes.

Click the rotate button on the worn items panel to expose the rotation gizmo.

*** ### Scale You may resize an item to be larger or smaller using the scale _gizmo_. To change the size of the item: 1. On the worn items panel, click the **scale** button to expose the scale gizmo. 2. To scale the clothing item, click and drag one of the **white boxes** to scale the object up or down.

Click the scale button on the worn items panel to expose the scale gizmo.

*** ### All transformations If you prefer to have quick access to all three action types at once, you can use the **All transformations** button to show the translate, rotation and scale action tools in one _gizmo._ Saving and resetting changes Once you are happy with your changes, click **Done transforming** to save the changes. If you want to discard your changes click **Reset item** to discard all changes, then click **Done transforming**. In transformation mode, these buttons are available on the worn items panel to the left.

Click the All transformations button on the worn items panel to expose the full gizmo.

*** ### Some tips on adjusting and transforming * You can rotate the avatar around to get better mobility when moving the item. * When transforming items with sleeves, it is best to make sure that the clothing item wraps around the avatar's wrists, elbows and shoulders. This helps the item move better as the avatar moves. * You do not have to go for a perfect fit when translating. You just have to translate enough to ensure that the clothing is draped on the needed parts of the body, then switch to adjust clothing. * When you click **Adjust Clothing**, the system pre-contours the clothing on your avatar. You can adjust the clothing further by grabbing on the cloth. ### Compatibility with rigged mesh clothing Sansar also supports _rigged mesh_ clothing, which is designed to move with your avatar's skeleton and does not include cloth simulation. Rigged mesh and Marvelous Designer clothing may be worn together, and Marvelous Designer clothing can be worn over rigged mesh clothing, and in most cases the cloth simulation can stretch or drape a Marvelous Designer garment around the rigged mesh clothing. #### A note about layering clothing It is possible for clothing to _interpenetrate_, or "poke through" other clothing under certain circumstances. Typically, Sansar avoids this issue by hiding any clothing or body parts that are covered by a layer of clothing. However, any layer of clothing that includes transparency prevents the layer underneath from being hidden. For example, if your avatar wears a shirt with a hole in it, Sansar must also show the avatar's torso behind the shirt and cannot hide the torso as it normally would. During certain animations, this can cause unexpected overlap or interpenetration between the avatar and layered clothing as they move in slightly different ways. ### Creating Marvelous Designer clothing To create MD items of clothing please see the help sections contained within [Marvelous Designer info](/create.md#marvelous-designer) Source: https://docs.sansar.com/avatars/dressing/fitting-designer-clothing-to-your-avatar --- # Setting Custom Emotes ## Previewing and setting custom emotes Custom emotes are set separately for each of your avatar looks. At this time, you may only _replace_ the animations used for existing slash commands, such as `/clap`, but you may not add additional slash commands. To replace an emote animation for one of your avatar looks: 1. Open the Lookbook by choosing **Create > Style my avatar** from the menu buttons. 2. Select an avatar look and click **Customize**. 3. Select the **Animation** tab in the Avatar panel. 4. Click one of the emotes in the list to preview the animation on your current avatar. 5. Click the **>** next to the emote's name to select a new animation for that emote from the library. Note that the slash command does not change when you select a new animation for it; if you replace the animation for /lol, you must still type `/lol` to trigger the new animation. | ![Animation preview](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------ | | Previewing the default /wave animation. Click the **>** next to /wave to select a different animation to play when you type /wave in chat. | ### Upper body and full body animations Emotes are currently divided into _full body animations_ and _upper body animations_. Full body animations override the animation of your avatar's entire body. For example, most dance animations must animate both your upper and lower body. Full body animations are set to loop, which means that the avatar will continuously repeat the animation until the avatar is moved. Upper body animations only animate your avatar from the waist up, allowing your lower body to continue its existing lower-body animation. For example, /wave allows you to wave your hand without interrupting your walking gait or lower-body dance moves. Upper body animations are non-looping, which means that the animation will only play once. **Note:** At this time, it is not possible to switch an emote from upper body to full body or full body to upper body. You should check the animation type before replacing an emote's animation. You can find the animation type at the top of the animation list when selecting a replacement animation. | ![Animation type](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------ | | The animation type can be found at the top of the animation list when replacing an emote's animation. | See[ Importing a custom emote animation ](/avatars/import/importing-custom-emote-animation.md)for steps on importing a custom animation. Source: https://docs.sansar.com/avatars/dressing/setting-custom-emotes --- # Wearing Accessories ## Wearing accessories You can upload and attach accessory objects to your avatar. Accessories attach to and move with your avatar, and can be used to customize your look. Currently, the types of accessories allowed are: glasses, earrings, necklaces, watches, and rings. Each type of accessory attaches to your avatar and moves in a way that corresponds to that type. Wearing accessories 1. While in Sansar, click **Create > Style my avatar** from the main menu. 2. Click the **Customize** button on any avatar in your lookbook. 3. Click the **Accessories** tab of the panel at the right side of the screen. 4. Choose an accessory type from the top row of accessory icons. The types of accessories currently available are: glasses, earrings, necklaces, watches, and rings. 5. Choose an accessory and click its thumbnail image once to add it to your avatar. You can click again to remove it.

Selecting an accessory to attach to your avatar.

**Creator Resources** Avatar reference files A selection of default avatars, skeletons and poses can be found in the article: [Avatar reference files](/avatars/resources/avatar-reference-files.md). Import requirements See[ Importing avatar-related items](/avatars/import/importing-avatar-related-items.md) for more information. Source: https://docs.sansar.com/avatars/dressing/wearing-accessories --- # Wearing Rigged Clothing ## Wearing rigged clothing _Rigged_ clothing is clothing that has been designed in a 3D modeling tool and has been rigged to move with your avatar's skeleton. Each piece of rigged clothing must usually be created to fit over a specific avatar body shape, and cannot be altered once uploaded to Sansar. Wearing rigged clothing Once you have purchased or uploaded some clothing, you can add it to your avatar the same way you would add any other piece of clothing or accessory. Some rigged clothing comes standard in your Sansar Lookbook: 1. Open the Lookbook by clicking the **Lookbook** button in the App Launcher. | ![Open lookbook](/media/screenshot-pending.svg) | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Open the Lookbook. | 2. Select an avatar from the Lookbook and click **Customize**. 3. Click the **Clothing** tab to view your available clothing. Marvelous designer clothing is marked with a Marvelous Designer logo; all other clothing is rigged clothing. | ![Choose clothing](/media/screenshot-pending.svg) | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Click the thumbnails in the Clothing tab to wear or remove clothing. | 4. Click the thumbnails in the clothing tab to add or remove articles of clothing. Note that there is currently a limit on the number of pieces of clothing you can wear at one time. Compatibility with Marvelous Designer clothing Sansar also supports _Marvelous Designer_ clothing, which may stretch to fit multiple body types and can be adjusted on your avatar using cloth simulation. Rigged and Marvelous Designer clothing may be worn together, and Marvelous Designer clothing can be worn over rigged clothing. Use the appearance editor to [adjust the fit of the Marvelous Designer clothing ](/avatars/dressing/fitting-designer-clothing-to-your-avatar.md)to correct any obvious interpenetration by the rigged mesh clothing. A note about layering clothing It is possible for clothing to _interpenetrate_, or "poke through" other clothing under certain circumstances. Typically, Sansar avoids this issue by hiding any clothing or body parts that are covered by a layer of clothing. However, any layer of clothing that includes transparency prevents the layer underneath from being hidden. For example, if your avatar wears a shirt with a hole in it, Sansar must also show the avatar's torso behind the shirt and cannot hide the torso as it normally would. During certain animations, this can cause unexpected overlap or interpenetration between the avatar and layered clothing as they move in slightly different ways. Creator resources Avatar reference files A selection of default avatars, skeletons and poses can be found in the article: [Avatar reference files.](/avatars/resources/avatar-reference-files.md) Import requirements See [Importing avatar-related items](/avatars/import/importing-avatar-related-items.md) for more information. Source: https://docs.sansar.com/avatars/dressing/wearing-rigged-clothing --- # Importing Avatar-Related Items > In Sansar, you can upload avatars, animation, or attachments. ## Importing avatar-related items In Sansar, you can upload avatars, animation, or attachments such as hair, rigged clothing, Marvelous Designer clothing, and accessories. You can upload items for your own use or sell them in the [Sansar Store](/store.md). ## Import steps The import process is the same across the different avatar item types. * While in Sansar, click **Create > Style my avatar** from the main menu.

Choose Style My Avatar from the Create menu.

*** * Select one of your looks and click the **Customize** button. * Click the appropriate item tab for the item you want to import: **hairstyles**, **clothing**, **accessories**, and **animation**. * If the item you are importing is an accessory, you also need to pick a sub-category based on the attachment point of your item: glasses, earrings, necklaces, watches, and rings. * It is important to have the right tab open because it will determine where your item will be uploaded to. The category tab is not changeable in the client nor the store. * Click **Import**. * If the item you are importing is an animation, you need to go to the **Library** tab to access the **Import** button. * In the Import panel that appears: * Click **Browse** to choose the appropriate file. (.fbx or .obj or .samd). * Optionally, click [**Materials Settings**](/create/materials/materials-editing-and-shaders.md) to choose specific shaders and textures for the clothing. * Click **Browse** to choose a thumbnail image (.png) to represent your clothing in your Lookbook inventory. * Name the item. It is assigned a name based on the object's file name by default. * Click **Import** to import the clothing object to your avatar editor inventory. * You may now wear the item by clicking it in your inventory, or list it on the [Sansar Store](/store.md) by right-clicking the thumbnail and choosing **List**. **Note:** * See [Managing your avatar items](/avatars/items/managing-avatar-looks-inventory-items.md) to know more about deleting, updating, or editing your inventory items. * If you wish to sell your item, see the [editing a listing](/store/selling/manage-listings.md#editing-a-listing) section of [Selling items in the Sansar Store.](/store/selling/manage-listings.md)

While editing a look, click Import on the appropriate tab to begin the process of importing a clothing object.

***

Make sure you are on the right item tab before uploading your item.

*** ## Import requirements Some requirements and restrictions are imposed on importing items. Please make sure that your items follow these guidelines: | Asset type | File type | Triangle count | Size limit | Thumbnail assets | AABB constraints | | ---------- | ---------------------------------------------------------------- | -------------- | -------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Hair |

.fbx, .obj (rigged mesh)

.samd (Marvelous Designer)

| 8,000 | N/A, see AABB constraints | Yes, if selling the item in the store |

From the center point:

0.9 meters left and right, front and back

2.2 meters above the avatar feet

.05 meters below the avatar feet (to account for shoes).

| | Clothing |

.fbx, .obj (rigged mesh)

.samd (Marvelous Designer)

| 8,000 | N/A, see AABB constraints | Yes, if selling the item in the store |

From the center point:

0.9 meters left and right, front and back

2.2 meters above the avatar feet

.05 meters below the avatar feet (to account for shoes).

| | Accessory | .fbx, .obj (rigged mesh) | 5,000 | N/A, see AABB constraints | Yes, if selling the item in the store |

From the center point:

0.9 meters left and right, front and back

2.2 meters above the avatar feet

.05 meters below the avatar feet (to account for shoes).

| | Animation | .fbx | N/A | N/A, see AABB constraints | Yes, if selling the item in the store |

From the center point:

2 meters to the left, right, front and back of the avatar

4 meters above the avatar feet

.1 meters below the avatar feet

| | Avatar | .fbx, .obj | 40,000 | | Yes, if selling the item in the store |

From the center point:

0.9 meters left and right, front and back

2.2 meters above the avatar feet

.05 meters below the avatar feet (to account for shoes).

|

Modeling a wristwatch relative to the female reference avatar model.

*** ## Import notes and tips for creators All items * **Name your items well** - Make sure to provide a proper name for the item These are reflected on the purchaser's inventory upon buying your accessory. This is a different name from the store name. See [Item Name](/guidelines/store-listing-guidelines.md#item-name) for information on naming rules for selling items. * **Add an item thumbnail** - You are required to add a thumbnail if you intend to sell the item in the Sansar store. The thumbnail asset must follow the same[ image guidelines](/guidelines/store-listing-guidelines.md#image-guidelines) cited in the [Store listing guidelines.](/guidelines/store-listing-guidelines.md#store-listing-guidelines) **Avatars** * **Avatar 1.0** - As of July, 2018 it is possible to create custom avatars for Sansar using standardized male and female skeletons. The skeleton released at this time is referred to as avatar 1.0 and will no longer be supported once the new avatar 2.0 system rolls out. * **Avatar 2.0** - As of August 1, 2019, new male and female skeleton files replaced the older skeletons. These new files are based on the new avatar 2.0 skeleton which can be found on the [Avatar reference files](/avatars/resources/avatar-reference-files.md) page. You can also find details on [Sansar skeleton and skinning details.](/avatars/resources/sansar-skeleton-skinning-details.md) **Accessories** * **Be mindful of the available attachment types** **-** The type your accessory is in determines how it moves with your avatar and provides hints as to how that accessory should be handled. Straying from the available attachment types may result in accessories improperly following your avatar as you move around. * **It is not necessary to specify a collision mesh -** Accessories do not currently use the collision mesh. * **When creating accessories, model against the reference avatar meshes** **-** Accessories should be modeled relative to the [reference avatar meshes](/avatars/resources/sansar-skeleton-skinning-details.md#body-joints). It is important that the transform handle for your accessory coincides with the transform handle for the reference avatar mesh. Find and download the male and female reference avatar meshes in the article: [Avatar reference files.](/avatars/resources/avatar-reference-files.md) ## Import requirements **Hair** * **Naming the hair material** - In order to render properly, the name of the hair material must include the word "`_hair_`". This is a signal that lets Sansar know that this is a hair object so it can render it accordingly. If you forget this step, your hair may not render correctly. * **Recommended color to use** - In order to work best with the color chooser in the avatar editor, the hair's _albedo map_ should use white or light gray. Any other colors will blend with the selected color in the hair color picker and may not appear as intended. Source: https://docs.sansar.com/avatars/import/importing-avatar-related-items --- # Importing Accessories
## What are Accessories? These can be any items intended to connect to one of the item slots associated with predefined points on the avatar, including the Glasses Slot, Earrings Slot, Necklace Slot, Right Wrist, and Right Ring Finger.
[Image: Accessory tabs]

Accessory slots within the avatar editor

Items are not limited to small watches, jewelry, hats, etc., but they do not contain any rigging information or individual weights like items in the clothing slot. For example, a face mask wouldn't morph with mouth movements but would remain static on the face. However, they do follow the rigging and movement of the attachment point. For instance, Glasses and Earring slot items will follow head movements, Necklace Slot items the upper chest, and Wrist and Ring items the right arm and ring finger. Currently, avatars can only wear one item belonging to each slot type and cannot change the slot these items are in. Nevertheless, users can adjust accessories' scale, rotation, and location relative to the attachment point. ## Setup in Blender Note: Accessories need to be within the [AABB](/create/import/aabb-bounding-box-and-item-restrictions.md) for avatar based items and under 5000 tris, they do not need to be rigged and no weighting information is retained on upload, making them one of the easiest items to create and import. 1. Decide which slot movements best suit your item. Even if an accessory is positioned offset from the avatar, it will still follow the relative movement of the chosen slot at the moment. For instance, if an item is positioned on the avatars left arm, it would still follow the right arm's movement. Other slot positions may become available in the future. If you require a different movement connection, you will currently need to make the item a rigged clothing slot item.
[Image: Accessory connection areas]

This shows the general area an accessory will follow when the avatar moves

2. using a [Reference Avatar](/avatars/resources/avatar-reference-files.md) as a guide, position and scale your accessory as close as possible to the intended attachment point. The better you place the item here, the less needs to be done in-game each time you wear the item." 3. once positioned, in object mode: select your item and apply the accessories transforms by pressing CTRL+A or 'Apply' in the upper object tab, then select 'All Transforms' this will set the origin point and zero out the location, rotation and also unify the scale. Note: It is not totally required to zero the origin point but is highly recommended for ease of import.
[Image: Apply Transforms]

Notice the origin point is at world zero and the transforms are uniform and applied

4. It is possible to setup your texture maps within blender so they import with your item, please see [Materials information](/create/import/supported-file-types.md) on how to do this, but all that is really required is a UV unwrap and the material slots being assigned. adding your texture maps can be done during import.
[Image: Material slots]

Material slots will correspond in game

## Exporting from Blender 1. Select just the accessory itself making sure its highlighted and go to File > Export > Fbx
[Image: Export as either FBX or OBJ]

File > Export > .FBX or .OBJ

2. on the export window, choose your file path with the following settings for most basic accessories. NOTE: the 'Apply transform' tickbox is sometimes required to be ticked ON if the item has been imported from a previously made .fbx, the resulting error usually refers to being outside of the AABB bounds even when the item is not.
[Image: Export as either FBX or OBJ]

You are now ready to import the item into Sansar. ## Importing the Accessory to Sansar 1. Load up sansar and go to the 'create tab' on the left menu, then select 'Style my avatar'
[Image: Export as either FBX or OBJ]

2. choose any of your presaved looks and click on 'customize'.
[Image: Customize avatar]

3. Select the Accessory Tab and then the Slot type you intend to import and the gender category you wish to upload into, anyone can wear the items this only affects the category of import and store searches. Then click 'Import' at the bottom of the panel.
[Image: Accessory tab selection]

Select the corresponding type to your intended upload this affects what the item is connected with in game.

4. Press 'Browse' and select your file. you can now also choose to add a picture and rename your object here, both of these can be changed later. Then setup your [Materials](/create/import/supported-file-types.md) and finally the 'Import' button.
[Image: Accessory import]

5. Watch the importer for any errors. If the import is successful, the item will appear in your inventory and can now be used! You can change the name and icon, but if you need to change the materials or slot, a new import is required.
[Image: import success]

Errors will appear here if the item fails

If you encountered a error please check the [Troublshooting import errors](/create/import/troubleshooting-import-errors.md) page for guidance. Source: https://docs.sansar.com/avatars/import/importing-accessories --- # Importing a custom emote animation > You can import custom animations for use as avatar emotes. The file must be in .FBX format. You can import custom animations for use as avatar emotes. **The file must be in .FBX format.** To import a custom emote: 1. Open the Lookbook by choosing **Create >** **Style my avatar** from the menu buttons. | ![Style my avatar](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------- | | Choose **Style My Avatar** from the **Create** menu. | 2. Select an avatar look and click the **Customize** button to open the avatar look editor. 3. Select the **Animation** tab in the Avatar panel. 4. Click the **Library** tab at the top of the Avatar panel. 5. Click the **Import** button to open the Import Character Animation panel. | ![Animation library](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------ | | Click **Import** to import an emote animation. | 6. Click **Browse** and choose a .FBX file from your computer. The .FBX file must contain an animation or it will fail to import. 7. Enter a name for the animation in the **Name of item in inventory** field. 8. Click the **Import** button. 9. Wait for the import to finish, then click the **Close** button to close the Import Character Animation panel. 10. The imported emote animation now appears in the Library tab of the Animation tab in the Avatar panel. See [Selling emotes](/store/selling/manage-listings.md). See [Previewing and setting custom emotes](/avatars/dressing/setting-custom-emotes.md) to learn how to set a custom animation on an emote slot. Source: https://docs.sansar.com/avatars/import/importing-custom-emote-animation --- # Editing an inventory item's name > Managing avatar related inventory items. _This article delves into managing avatar-related inventory items. To learn more about managing scene-related items, check out the_ [_action menu_](/create/world-editor/scene-item-inventory.md#action-menu) _section of the_ [_Scene creation inventory_](/create/world-editor/scene-item-inventory.md#scene-item-inventory) _page._ If you [imported an avatar item,](/avatars/import/importing-avatar-related-items.md) you may have been prompted to provide an inventory name and image for your avatar upon import. If you skipped adding an image during the import step or want to change the item name, you can do so by editing the item's information. To edit the item's name: 1. Open the avatar editor by clicking on the **Style my avatar** button on the main menu. 2. Once you are in the lookbook, click the **Customize** button on any avatar look you have on the list. This opens the avatar editor, where you can access your inventory panel. 3. On the inventory panel, simply right-click on the item that you want to manage and a sub-menu opens. 4. Click **Edit Info** in the sub-menu. A panel that allows you to change the inventory image or name appears. 5. To change the name of the item, simply type the new name on the _Name of item in inventory_ field. 6. Click on **Update** to finalize your changes. note: If you plan to sell the item in the store, the inventory name you designated also appears in the item buyer's inventory. Make sure to finalize the name prior to starting the listing process or you can change the inventory name as it appears to other users' from the [edit listings page](/guidelines/store-listing-guidelines.md). Inventory level changes don't propagate to any active listings. Source: https://docs.sansar.com/avatars/items/editing-inventory-items-name --- # Editing an inventory item's image > Managing avatar-related inventory items _This article delves into managing avatar-related inventory items. At this time, scene creation items do not support inventory images._ If you [imported an avatar item](/avatars/import/importing-avatar-related-items.md), you may have been prompted to provide an inventory name and image for your avatar upon import. If you skipped adding an image during the import step or want to change the item name, you can do so by editing the item's information. To edit the item's information: 1. Open the avatar editor by clicking on the **Style my avatar** button on the main menu. 2. Once you are in the lookbook, click the **Customize** button on any avatar look you have on the list. This opens the avatar editor, where you can access your inventory panel. 3. On the inventory panel, simply right-click on the item that you want to manage and a sub-menu opens. 4. Click **Edit Info** in the sub-menu. A panel that allows you to change the inventory image or name appears. 5. To change or add an inventory image, click on **Browse** to choose the file to upload as an image. 6. Click on **Update** to finalize your changes. note: * An inventory image is required in order to be able to list an item. * If you plan to sell the item in the store, the inventory image you designated also appears in the item buyer's inventory. Make sure to finalize the image prior to starting the listing process otherwise the original image at the time of listing will still be the image that will be shown on the users' inventory. Inventory level changes don't propagate to any active listings. Source: https://docs.sansar.com/avatars/items/editing-inventory-items-image --- # Deleting avatar looks from your inventory > Managing avatar related inventory items _This article delves into managing avatar-related inventory items. To learn more about managing scene-related items, check out the_ [_action menu_ ](/create/world-editor/scene-item-inventory.md#action-menu)_section of the_ [_Scene creation inventory_](/create/world-editor/scene-item-inventory.md) _page._ You can delete items you've uploaded to the inventory or purchased from the Sansar Store from the inventory. To delete an avatar item from the inventory: 1. Open the avatar editor by clicking on the **Style my avatar** button on the main menu. 2. Once you are in the lookbook, click the **Customize** button on any avatar look you have on the list. This opens the avatar editor, where you can access your inventory panel. 3. On the inventory panel, simply right-click on the item that you want to manage. Once clicked, a sub-menu pops up with options. 4. Depending on the operation that you want to conduct, click on **List Item**, **Edit Info**, or **Delete**. We will delve into these operations in the next section. 5. Click **Delete** in the sub-menu. 6. A dialog with the message, Are you sure you want to delete this item?" appears. 7. Click **Ok** to permanently delete the item or click **Cancel** to go back to the avatar editor. note: You can still retrieve lost or deleted purchased items back to your inventory provided that the content creator hasn't taken the item down. See [redelivering lost purchases](/store/shopping/redelivering-lost-purchases.md) to learn more. Source: https://docs.sansar.com/avatars/items/deleting-avatar-items-from-your-inventory --- # Managing your avatar looks inventory items > Managing avatar related inventory items. _This article delves into managing avatar-related inventory items. To learn more about managing scene-related items, check out the_ [_action menu_](/create/world-editor/scene-item-inventory.md#action-menu) _section of the_ [_Scene creation inventory_](/create/world-editor/scene-item-inventory.md) _page._ You can manage your avatar-related inventory items in the avatar editor. To manage your avatar items: 1. Open the avatar editor by clicking on the **Style my avatar** button on the main menu. 2. Once you are in the lookbook, click the **Customize** button on any avatar look you have on the list. This opens the avatar editor, where you can access your inventory panel. 3. On the inventory panel, simply right-click on the item that you want to manage. Once clicked, a sub-menu pops up with options. 4. Depending on the operation that you want to conduct, click on **List Item**, **Edit Info**, or **Delete**. To learn more about these action buttons, see: * [Deleting avatar looks items from your inventory](/avatars/items/deleting-avatar-items-from-your-inventory.md) * [Editing an inventory item’s name](/avatars/items/editing-inventory-items-name.md) * [Editing an inventory item’s image](/avatars/items/editing-inventory-items-image.md) * [Selling items in the Sansar Store](/store/selling/manage-listings.md) Note: Avatar items are currently classified as either male or female. Switch between a female or male avatar in order to access the item that you want to manage. On some item tabs, you have the option to show both male and female inventories at the same time. Source: https://docs.sansar.com/avatars/items/managing-avatar-looks-inventory-items --- # Avatar Reference Files > Use this article as a reference when creating clothing, avatars, and animations for Sansar. ## Avatar reference files The files in this article may be used as a reference when creating clothing, avatars, and animations for Sansar. ## Update Notes _updated: **August 1, 2019**_ All reference files have been replaced with the new avatar 2.0 skeleton. Please note that this is the first release of the avatar 2.0 reference files. The reference files will be updated over time with improvements such as a cleaner-looking blender files or including skin textures. You can use these files to start creating clothing, avatars, and animation for the new avatar. What to expect in this update: * Blender bone visualization is currently still a WIP. This is just a display issue and doesn't impact the functionality of the skeletons in Blender. * The Blender files are built on version 2.8. If you are not on version 2.8, the blender files may not import properly. We highly recommend upgrading to blender 2.8 for best results. * Textures are not included with this pre-released version. A few things to note: * Any content created using the older 1.0 avatar skeleton cannot be uploaded into Sansar. * We highly recommend Blender users to update to version 2.8 and above. * Using the .blend files provided below with earlier versions of Blender (i.e. 2.78, 2.79) may lead to undesirable visual results within Blender. * Using the .fbx files provided below with earlier versions of Blender (i.e. 2.78, 2.79) may lead to unexpected modifications on the skeleton upon importing into Blender. *** ### AABB Bounding Box

As of 2023 the AABB was expanded

The AABB or 'Avatar Active Area Bounding Box' is a box that the Avatar mesh, Accessory/clothing mesh and skeleton must remain within. There is a minimum and maximum size your avatar must adhere too, make sure your avatar is within the maximum and over the minimum otherwise a error may be given on import. More info on the AABB can be found here:[ AABB Bounding Box](/create/import/aabb-bounding-box-and-item-restrictions.md) ### AABB Reference Files
File NamesDescription
AABB v2.fbxAABB v2.blendAABB Reference Files Containing:
Minimum Avatar AABB
Maximum Avatar AABB
Animation Cube AABB
AABB v1.fbxPre Aug 2023 AABB (outdated)
*** ### The avatar skeleton ### Full resolution skeleton
FilesDescription
Av2_High_Female.fbxAv2_High_Male.fbxav2_full_male.blendav2_full_female.blend

The full resolution skeleton is the core skeleton that drives avatars in Sansar. The mid and low resolution avatars are created against this version.

We recommend using this skeleton for best results with body and facial animation deformation. Due to it's more complex state, it is more complicated to skin against compared to the mid and lower resolution skeletons.

The high poly mesh included is only meant to provide a high quality starting point for skinning transfers to other meshes.

The high poly mesh is not intended to be used for uploading into Sansar due to it's triangle count and will require decimation to import.

Details:

  • 171 Bones
  • High poly meshes
  • No textures

The full resolution skeleton.

*** ### Mid resolution skeleton
FilesDescription
Av2_Mid_Female.fbxAv2_Mid_Male.fbxav2_mid_female.blendav2_mid_male.blend

The mid resolution skeleton simplifies the skinning work by removing some of the non-critical joints. Most of the joints that were removed are from the face. As a result, if you are creating an avatar, we recommend using this skeleton if your avatar isn't expected to have detailed facial animations.

Details:

  • 115 Bones
  • No Meshes (at this time)
  • No textures
### Low resolution skeleton
FilesDescription
Av2_Low_Female.fbxAv2_Low_Male.fbxav2_low_female.blendav2_low_male.blend

The most basic of skeletons. We recommend using this for simple avatars that doesn't need complex facial or body skinning.

This is also the only skeleton that is Mixamo compatible. If you would like to use Mixamo animations on the other skeletons, you will first have to grab the animation with this low resolution skeleton and then retarget to the other skeletons using your 3D application of choice. For more information, see Using our animation skeleton to create custom animations.

Details:

  • 65 Bones
  • Low poly previsualization mesh
  • No textures

A side by side comparison of the skeletons.

*** ### Changes with avatar 2.0 Please remember that the following changes will take effect by the end of August 2019. * All avatar, rigged clothing, and rigged hair items created using non-avatar 2.0 reference files will no longer be supported upon Avatar 2.0 release. * Marvelous Designer clothing, accessories, and emotes created using non-avatar 2.0 reference files may still be compatible and usable. Source: https://docs.sansar.com/avatars/resources/avatar-reference-files --- # Blender - Avatar files > The Blender avatar files we provide contain the base skeleton that we use for the avatar and a copy of the body mesh skinned to the avatar. The Blender avatar files we provide contain the base skeleton that we use for the avatar and a copy of the body mesh skinned to the avatar. These files have been modified for improved visibility and quality of life when used with Blender. These files can be found in [Avatar reference files](/avatars/resources/avatar-reference-files.md). | ![Skeleton](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------- | | One of the Blender-modified avatars. | Special features of the Blender avatar files The blender files provided in [Avatar reference files](/avatars/resources/avatar-reference-files.md), include the full-resolution avatar mesh, skinned to the avatar skeleton. We have hidden all of the bones that are unnecessary for skinning and animation, and the face and twist bones display as cubes for improved visibility. To see this "cleaner" view, you must enable **Pose Mode** by toggling the option in the bottom of the 3D View panel or by clicking **Pose** under **Armature** in the Outliner. How Blender displays bones differently If you are in **Edit Mode**, you will see the full skeleton with no bones hidden, and all bones will be drawn using the default Blender "Octahedral" view. These bones resemble the joint objects in Maya and 3DS Max, but Blender's display method is different. Every bone object has a _head_ and a _tail_, which resemble Maya and 3DS Max's bones, but with an important distinction: The tail of the bone is actually a vector that tells Blender which direction the bone is facing (similar to Joint Orientation in Maya). This is why the face bones look so cluttered in Blender when you first import them or view them in Object Mode. | ![Head bones](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------------------- | | Closeup of the face bones in Pose Mode. Note that they appear as small cubes, rather than the larger "head and tail" of the other bones. | Source: https://docs.sansar.com/avatars/resources/blender-avatar-files --- # Blender - Using Decimate Tool > Blender's Decimate Geometry tool can reduce the triangle count of a skinned mesh without requiring you to re-skin the mesh afterwards. ## Using the Decimate Geometry tool to reduce triangle count on a skinned mesh The mesh decimation is done algorithmically, so the final results usually are not as nice as they would be if a human artist were to reduce the geometry by hand, but it does allow you to reduce your custom avatar mesh to a triangle count supported by Sansar. Using the Decimate Geometry tool To use the Decimate Geometry tool while editing a model in Blender: * Select the model and switch to Edit Mode.

Select the model and switch to Edit Mode.

*** * Select **Mesh > Clean up > Decimate Geometry** from the bottom menu. A Decimate Geometry options menu appears on the left side.

While the model is selected and in Edit Mode, select Mesh > Clean up > Decimate Geometry.

*** * In the Decimate Geometry options, set **Ratio** to the fraction of the original triangle count to keep. For example, **0.5** keeps half the triangles.

Set Ratio to the fraction of triangles to keep. In this example, 0.620 keeps about 62% of the triangles, removing about 38%.

*** * Save the file and export as an .fbx as described in [Exporting custom avatars from Blender](/avatars/resources/exporting-custom-avatars-from-blender.md). Source: https://docs.sansar.com/avatars/resources/blender-using-decimate-tool --- # Exporting Custom Avatars From Blender > When exporting custom avatars from Blender. ## Exporting custom avatars from Blender When exporting [custom avatars](/avatars/import/importing-avatar-related-items.md) from Blender, you must use the following (non-default) settings. ## Main tab | |

Non-default settings:

  • All settings default
| | ---------------------------------------------------- | ----------------------------------------------------------------------------------- | | **Main** tab | | ## Geometries tab | |

Non-default settings:

  • Use Modifiers Render Setting: Selected
| | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | **Geometries** tab | | ## Armatures tab | |

Non-default settings:

  • Add Leaf Bones: Deselected
  • Primary Bone Axis: X Axis
  • Secondary Bone Axis: Y Axis
| | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Armatures** tab | | ## Animation tab | |

Non-default settings:

  • Baked Animation: Deselected
| | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | **Animation** tab | | Source: https://docs.sansar.com/avatars/resources/exporting-custom-avatars-from-blender --- # Sansar Skeleton Skinning Details ## Sansar skeleton and skinning details This article provides detailed information on the joints of the standard Sansar skeletons and provides tips on how to best skin the skeletons when creating [custom avatars](/avatars/import/importing-avatar-related-items.md) and [rigged clothing.](/avatars/dressing/wearing-rigged-clothing.md) Note that exporting an avatar from Blender requires non-default export settings. See [Exporting custom avatars from Blender](/avatars/resources/exporting-custom-avatars-from-blender.md) for full details. ## Avatar skeleton files Sansar's avatar skeleton files can be found in the article: [Avatar reference files](/avatars/resources/avatar-reference-files.md). ## Joint details The following joint information is for all the joints in the full resolution skeleton. The mid and low resolution skeletons have minimal face joints and do not contain some of the listed joints below. But for those joints that do exist in the mid and low resolution skeletons, the information is still the same. ## Body joints The core animation joints. All avatar meshes should be hooked up to these joints in order for them to deform correctly when animating. Depending on the location of the mesh, only a certain subset of joints may be needed. For example, pants should only need to be skinned to all the lower body joints. | Bone Names | Bone Names | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |

Central body joints

  • pelvis
  • spine1
  • spine2
  • spine3
  • neck
  • head
  • L_clavicle
  • R_clavicle
| | |

Left arm joints

  • L_shoulder
  • L_elbow
  • L_wrist
  • L_shoulder_twist1
  • L_shoulder_twist2
  • L_wrist_twist1
  • L_wrist_twist2
  • L_olecranon_twist1
|

Right arm joints

  • R_shoulder
  • R_elbow
  • R_wrist
  • R_shoulder_twist1
  • R_shoulder_twist2
  • R_wrist_twist1
  • R_wrist_twist2
  • R_olecranon_twist1
| |

Left leg joints

  • L_hip
  • L_knee
  • L_ankle
  • L_ball
  • L_hip_twist1
  • L_glute_twist1
  • L_kneecap_twist1
|

Right leg joints

  • R_hip
  • R_knee
  • R_ankle
  • R_ball
  • R_hip_twist1
  • R_glute_twist1
  • R_kneecap_twist1
| |

Left finger joints

  • L_index_01
  • L_index_02
  • L_index_03
  • L_middle_01
  • L_middle_02
  • L_middle_03
  • L_pinky_00
  • L_pinky_01
  • L_pinky_02
  • L_pinky_03
  • L_ring_01
  • L_ring_02
  • L_ring_03
  • L_thumb_01
  • L_thumb_02
  • L_thumb_03
|

Right finger joints

  • R_index_01
  • R_index_02
  • R_index_03
  • R_middle_01
  • R_middle_02
  • R_middle_03
  • R_pinky_00
  • R_pinky_01
  • R_pinky_02
  • R_pinky_03
  • R_ring_01
  • R_ring_02
  • R_ring_03
  • R_thumb_01
  • R_thumb_02
  • R_thumb_03
| ## Face joints Skinning to the face joints is only a requirement if you want to have animated faces. If your avatar has a mask or helmet, all these joints can be ignored and only the only the "_head_" joint needs to be used. With the limit of only 4 joint influence per vertex, it becomes very complicated to do a smooth skinning spread between all the face joints. It is easiest to only skin to a subset of all the face joints. For example, if you want a more simplified animated face such as just a flapping mouth and darting eyes, then only the "_L\_eye_", "_R\_eye_", and "_jaw_" joints need to be used. If you want to apply facial animations, we highly recommend using the high resolution skeleton as it contains all face joints. If you are not interested in applying facial animations, the mid and low resolutions are some alternatives with less face joints. | Bone Names | Bone Names | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |

Jaw Area Joints

  • jaw
| For a simple flappy jaw look, only the "_jaw_" joint working in conjunction with the "_L\_lip\_corner_" and "_R\_lip\_corner_" joints listed below are needed. | |
  • L_jawline01
  • L_jawline02
| | |
  • R_jawline01
  • R_jawline02
| | |

Chin Area Joints

  • chin
  • chin_under
| Only fine detail meshes would need to be skinned to the chin joints. | |

Mouth Area Joints

  • lip_upper_center
  • lip_lower_center
  • lip_under
| The mouth area has the most complex setup on the face. There are fewer ways to only using a few select joints because they all depend on each other to work. If you want to forego explicit lip animation and keep to a simple flappy jaw setup, then using the "_jaw_" joint in conjunction with "_L\_lip\_corner_" and "_R\_lip\_corner_" should be enough. | |
  • L_lip_upper_mid01
  • L_lip_upper_mid02
  • L_lip_lower_mid01
  • L_lip_lower_mid02
  • L_lip_corner
| | |
  • R_lip_upper_mid01
  • R_lip_upper_mid02
  • R_lip_lower_mid01
  • R_lip_lower_mid02
  • R_lip_corner
| | |

Nose Area Joints

  • nose_base
  • nose_bridge
| All these joints can be skipped if there is no need for small details such as nostril flares. | |
  • L_nasalis
  • L_nostril
| | |
  • R_nasalis
  • R_nostril
| | |

Left Eye Area Joints

  • L_eye
  • L_eyelid_upper01
  • L_eyelid_upper02
  • L_eyelid_lower01
  • L_eyelid_lower02
  • L_eyelid_corner_inner
  • L_eyelid_corner_outer
  • L_eye_upper
  • L_eye_lower
  • L_eye_lateral
| If only eyeball rotation is needed, then only skin to the "_L\_eye_" and "_R\_eye_" joints. | |

Right Eye Area Joints

  • R_eye
  • R_eyelid_upper01
  • R_eyelid_upper02
  • R_eyelid_lower01
  • R_eyelid_lower02
  • R_eyelid_corner_inner
  • R_eyelid_corner_outer
  • R_eye_upper
  • R_eye_lower
  • R_eye_lateral
| | |

Forehead Area Joints

  • forehead_center
  • L_forehead
  • R_forehead

Between Eyebrow Area Joints

  • procerus

Left Eyebrow Area Joints

  • L_brow_inner
  • L_brow_mid
  • L_brow_outer

Right Eyebrow Area Joints

  • R_brow_inner
  • R_brow_mid
  • R_brow_outer
| The forehead and eyebrow joints cover the areas above the eyes. These joints are used when the character does expressive eyebrow motions. | |

Left Cheek Area Joints

  • L_cheek
  • L_levatorLabii
  • L_risorius02
| For proper smiling animations, the cheek area joints are needed. | |

Right Cheek Area Joints

  • R_cheek
  • R_levatorLabii
  • R_risorius02
| | |

Ears

  • L_ear
  • R_ear

Tongue

  • tongue01
  • tongue02
  • tongue03
| There are very few ear animations, so skipping the ear joints isn't a big deal. The tongue joints are only needed if there is a tongue in the character. | ## Extra joints These joints are not used in the default animation set that exists in Sansar's avatars, so skinning to them will not yield any results. But they can be animated for custom emotes. Example: Skinning wing meshes to the "_L\_wing\_ATTACH_" and "_R\_wing\_ATTACH_", and then flapping them in a custom emote animation. | Bone Names | | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |

Chest Joints

  • L_chest
  • R_chest
| Not used in the default animation set, but would allow for secondary chest motion in custom emote animations. | |

Toe Joints

  • L_bigToe_01
  • L_indexToe_01
  • L_middleToe_01
  • L_ringToe_01
  • L_pinkyToe_01
  • R_bigToe_01
  • R_indexToe_01
  • R_middleToe_01
  • R_ringToe_01
  • R_pinkyToe_01
| The toe joints aren't animated in the default animation set because it is expected that the avatars would be wearing shoes. But a custom character can be barefooted and have custom animations that makes the toes wiggle. | |

Attach Joints

  • world_ATTACH
  • locomotion_ATTACH
  • pelvis_ATTACH
  • L_thigh_ATTACH
  • R_thigh_ATTACH
  • head_ATTACH
  • L_forearm_ATTACH
  • R_forearm_ATTACH
  • L_shoulder_ATTACH
  • R_shoulder_ATTACH
  • spine3_ATTACH
  • L_wing_ATTACH
  • R_wing_ATTACH
|

Accessories would be a good use of ATTACH joints. Example: Hook up a halo to the "head_ATTACH" joint. Then during a custom emote animation, spin the halo around.

In the future these ATTACH joints will be even more useful when all animations for the characters can be overwritten.

| ## Support joints These support joints are only used to support the animation of the body and face joints. They do not need to be hooked up to any meshes since it is their child or related joints that should be getting all the skinning data. **Face Support Joints** * L\_eyelid\_top * L\_eyelid\_bottom * R\_eyelid\_top * R\_eyelid\_bottom ## Other joints These joints are for other purposes outside of core animation and shouldn't need to have any meshes skinned to them. * Locomotion\_Vector * root * L\_grip * R\_grip * camera\_ATTACH ## Skinning details ## Skin bind settings * 4 Max Influence * Linear Skinning Method ## Skinning examples **Auto-twist Arms:** One thing to keep in mind is that when the skeleton gets imported or referenced into a 3D app, the auto-twist joints are not hooked up in a way that will look correct. But if the skinning on those joints looks similar to the examples, then they will import into the engine and look good during in-game animations. *** **Pelvis/Thigh Area:** What makes the pelvis and thigh area a little more complex is the glute\_twist1 bone that helps with maintaining volume as the legs are rotating back and forth. That particular bone should only cover a small specific area. Like the arms, the thighs also have an auto-twist that will help maintain a smoother look as the legs are twisting. Unlike, the arms, the thighs only require 1 twist bone. Also like the arms, the thigh auto-twist and glute\_twist1 is not hooked up during import into a 3D app. So they will not look correct until imported into the engine. *** **Elbow and Knee:** These support joints are solely for the purpose of helping the knee and elbow maintain better volume as the lower legs and forearms are bending. These are also not hooked up during import into a 3D app and will require import into the engine before results can be seen. Source: https://docs.sansar.com/avatars/resources/sansar-skeleton-skinning-details --- # Using Animation Skeleton > Using the animation Skeleton Interface ## Using the animation skeleton to create custom animations We provide a simplified, "lower resolution" _animation skeleton_ that is suitable for creating animations and uploading them to Sansar for your avatar to use. This skeleton is different from our main avatar skeleton and is suitable for creating custom animations but cannot be used to create avatars. **Note:** Sansar is able to interpret the animation skeleton for the purposes of importing animations, but any avatars that attempt to use this simplified skeleton are rejected during the import process. ## Getting the animation skeleton files The animation skeleton files can be found in article [Avatar reference files](/avatars/resources/avatar-reference-files.md). ## Customizing animations in Mixamo Mixamo is a web-based animation customizer that allows you to upload a custom character and customize animations from a large library of stock animations: 1. Go to [https://www.mixamo.com](https://www.mixamo.com/#/) and log in with your account. 2. Once you are logged in, click **Upload Character** at the top right. 3. In the Upload A Character window that opens, drag and drop any of the low resolution skeleton files into it. These files can be found in [Avatar reference files](/avatars/resources/avatar-reference-files.md). 4. Once the skeleton has successfully uploaded, a preview appears. Click **Next** to confirm the upload. 5. Select any animation to see it loaded up on our rig and skeleton for you to preview and tweak. 6. Click the **Download** button to download a .fbx file containing this animation on our skeleton. Be sure to use these settings for your download: * **Format** - FBX(.fbx) * **Skin** - With Skin * **Frames per Second** - 30 * **Keyframe Reduction** - none

Previewing a dance animation on Sansar's simplified animation skeleton.

*** ## Importing your customized animations to Sansar For information on how to import your saved custom animation to Sansar, see [Custom avatar emotes.](/avatars/basics/avatar-emotes.md) Source: https://docs.sansar.com/avatars/resources/using-animation-skeleton --- # Events > Find, attend, create and broadcast events, with calendars, redemption codes and tipping. - [Attending events in Sansar](/events/attending-event-in-sansar) - [Get an event ticket on sansar.com](/events/get-an-event-ticket) - [Redeem an event ticket](/events/redemption-codes) - [Adding events to your calendar](/events/adding-events-to-your-calendar) - [Creating Your Own Events](/events/creating-your-own-events) - [Tipping](/events/tipping) - [Avatar Broadcasting FAQ](/events/avatar-broadcasting-faq) - [Deploying Unpublished Event to Event World](/events/deploying-unpublished-event-to-event-world) Source: https://docs.sansar.com/events --- # Attending events in Sansar Find and join Sansar events in the Sansar client using the [Codex](/explore/codex), or browse events on sansar.com. ## Finding and visiting events using the Codex **In Sansar:** You can use the Events section of the Codex to browse all upcoming events in Sansar. To open the Codex, choose **Go > Events** from the main menu.

**In Sansar:** You can also open the Events section by selecting the Events tab at the top of the Codex.

The Events section of the Codex has four tabs: * **All events** - All upcoming events in Sansar. * **Calendar** - Upcoming events specifically saved by you. * **Hosted by me** - Upcoming events hosted by you. * **Past events** - Previous events hosted by you and others.

**In Sansar:** To visit an event that is currently live (indicated by the red LIVE image), hover over the event picture and select the **Join event** button that appears. The **Join event** button only appears for events that are in progress or starting soon.

**In Sansar:** You can add an event to your personal calendar for later reference by clicking the **Interested** button that appears when you move your mouse cursor over the event image. For more information, see [Adding events to your calendar](/events/adding-events-to-your-calendar). To create your own events, see [Creating your own events](/events/creating-your-own-events).

## Finding and visiting events from the Sansar website Browse and search events on sansar.com, save them to your calendar, check ticket options, and open live events in Sansar. 1. **On sansar.com:** Open [Events](https://www.sansar.com/events), or select **Events** in the main menu. The **Events** tab opens. When you are signed in, **My Calendar** also appears in the navigation bar. 2. **On sansar.com:** Browse **Featured Events** (shown on the first unfiltered page when available) and **All Events**. Use the pagination at the bottom when there are multiple pages. - **On sansar.com:** On desktop, type in **Search events...** and select **Search** to filter events. The page shows the search-result count and a **Clear search** option. - If no events are listed, the page displays "No events found", "There are no events to display right now.", and **Browse Events**. 3. **On sansar.com:** Review the event cards. Each card shows the event title, host's name (linked to their profile), date and time, and **Interested** (with an interest count when positive). When applicable, cards also show **No image**, a red **LIVE** badge while the event is live, and **18+**. 4. **On sansar.com:** Select an event card to open the event page. The page displays: - **LIVE NOW** and **18+** badges on the event image, when applicable. - **Hosted by** with a link to the host's profile. - **About Event**, **Date & Time**, and **Available on** (with icons for Windows, Oculus, and HTC Vive). - **Sign up & get ticket** when you are signed out, which opens registration. - **Interested** next to the title when you are signed in and the event hasn't ended, to save the event to **My Calendar**. - **Add to Calendar** under **Date & Time**, to add the event to an external calendar. See [Adding events to your calendar](/events/adding-events-to-your-calendar). - A **Tickets** section when the event has tickets listed. See [Get an event ticket on sansar.com](/events/get-an-event-ticket). 5. **On sansar.com:** Open the event in Sansar when available. Both **Go Now** and **Visit World** are links meant to open Sansar on a computer with the Sansar client installed: - **Go Now** appears on an event with an image only when you are signed in, the start time has been reached, and the event hasn't ended. - **Visit World** appears as a standalone button on an event with no image. Source: https://docs.sansar.com/events/attending-event-in-sansar --- # Get an event ticket on sansar.com > View available tickets and get or buy a ticket for an event on sansar.com. View available tickets and get or buy a ticket in the **Tickets** section of an event page on sansar.com. If you have a ticket redemption link instead, see [Redeem an event ticket](/events/redemption-codes) (there is no manual redemption-code field on the event page). ## Before you start - **Sign in to your Sansar account.** You must be signed in on sansar.com to get or buy a ticket. If you already have an account, sign in on [sansar.com](https://www.sansar.com/login) first. If you are signed out on an event page, **Sign up & get ticket** opens registration; return to the event page after you sign in. - **Check your Sansar Dollars (S$) for paid tickets.** If a ticket is priced in S$, see [Buy Sansar Dollars](/sansar-dollars/buy). ## Get or buy a ticket 1. Open [Events](https://www.sansar.com/events) and select an event to open its page. 2. Scroll to the **Tickets** section. If an event has no ticket definitions available, the **Tickets** section doesn't appear. An event without a **Tickets** section isn't necessarily free. 3. Review each ticket card in **Tickets**. Each card displays: - The ticket name and, when provided, a description. - The price: **Free** if zero cost, or the displayed amount (with the S$ coin icon for Sansar Dollars, or the currency and amount shown on the listing). - The total allocation: **Unlimited**, or "N total" (the total allocation for the ticket, not the number of tickets remaining). 4. On a ticket card, select **Get Ticket** for a free ticket or **Buy Ticket** for a paid ticket. The button stays unavailable while your request is pending. ## What happens next - Open [Transaction History](/sansar-dollars/transaction-history) on sansar.com and use the **Tickets** filter to view event ticket transactions listed on your account. - To join the event when it starts, return to the event page. See [Attending events in Sansar](/events/attending-event-in-sansar). ## If something goes wrong - If no **Tickets** section appears, the event may not have ticket definitions available on the page. - If you received a ticket redemption link, see [Redeem an event ticket](/events/redemption-codes). - If you have trouble getting or buying a ticket, [contact support](/help/contact-support). Source: https://docs.sansar.com/events/get-an-event-ticket --- # Redeem an event ticket > Redeem a Sansar event ticket using a redemption link on sansar.com. Redeem an event ticket on sansar.com using the complete redemption link you received. To get or buy a ticket directly from an event page instead, see [Get an event ticket on sansar.com](/events/get-an-event-ticket). ## Before you start - **Have your complete redemption link.** There is no manual code-entry field on sansar.com. Open the full link you received to redeem your ticket. - **Sign in on sansar.com first.** You must be signed in to redeem a ticket, and the redemption page doesn't automatically return you after login. If you need an account, see [Create a Sansar account](/account/create-account). Sign in on [sansar.com](https://www.sansar.com/login), then reopen your complete redemption link. - **Install Sansar to attend.** You redeem the ticket in your web browser. You need the Sansar client only to attend the event. See [Installing Sansar](/get-started/install).
## Redeem your ticket 1. Sign in to your Sansar account on [sansar.com](https://www.sansar.com/login). 2. Open the complete redemption link in your browser. The **Ticket Redemption** page opens. If the link contains the required information, it displays "Click below to redeem your ticket for this event." 3. Wait for the event details to load, then select **Redeem Ticket**. The button stays unavailable until the event loads. While redemption runs, the page displays "Processing your redemption...". 4. When the page displays "Your ticket has been successfully redeemed!", select **View Event** to open the event page. ## What happens next Selecting **View Event** opens the event page on sansar.com. To find and join the event when it starts, see [Attending events in Sansar](/events/attending-event-in-sansar). ## If something goes wrong - **"Invalid redemption link. Please check the URL and try again."** — Part of the link information is missing. Make sure you opened the complete link, with nothing cut off. - **"Failed to redeem ticket. Please try again or contact support."** — Select **Try Again**. Check that you are signed in to the right Sansar account on sansar.com, and reopen the complete link if needed. If redemption still fails, [contact support](/help/contact-support). Source: https://docs.sansar.com/events/redemption-codes --- # Adding events to your calendar Save events to **My Calendar** on sansar.com, add events to your calendar in Sansar, or copy an event to a third-party calendar.
## Adding events to your calendar using the Codex While browsing the Events section of the [Codex](/explore/codex), you can add events to your calendar by clicking the **Interested** button that appears when you move your mouse cursor over the event's image: 1. **In Sansar:** Open the Codex to the Events section by choosing **Go > Events** from the main menu. 2. **In Sansar:** Browse through the **All events** tab until you find an event you would like to add to your calendar. 3. **In Sansar:** Move your mouse cursor over the event's image and click the **Interested** button that appears. If the event is currently live, the button says **Join event** instead, and will take you directly to the event. **In Sansar:** You can view and remove events on your calendar by clicking the **Calendar** tab of the Codex.

The All events tab of the Codex. Click Interested on an event to add it to your calendar.

## Save events with Interested on sansar.com Sign in on sansar.com to save events to **My Calendar**. While signed out, **Interested** on event cards is disabled and its tooltip reads **Log in to show interest**. The button does not appear on the event page while signed out. 1. **On sansar.com:** Sign in to your Sansar account and open [Events](https://www.sansar.com/events). 2. **On sansar.com:** Select **Interested** on an event card, or next to the title on an event page if the event has not ended (including while it is live). The star fills in, the button style updates, and the button shows the total count when positive. Its tooltip changes from **Add to calendar** to **Remove from calendar**. 3. **On sansar.com:** Select **Interested** again, wherever the button is available, to remove the event from **My Calendar**. If saving or removing fails, the button restores its previous state without displaying an error message. ## View and remove events in My Calendar **My Calendar** shows events you host and events you saved with **Interested** on sansar.com. 1. **On sansar.com:** Sign in and open [My Calendar](https://www.sansar.com/events/my-calendar). You can also select **My Calendar** in the **Events** navigation bar, in your display-name account menu in the top bar, or in **Menu** on a phone. If you open `/events/my-calendar` while signed out, you are prompted to sign in first. 2. **On sansar.com:** Wait for the calendar to load (the page displays "Loading your calendar..." while loading). Once loaded, **My Calendar** displays your events in sections (not tabs), showing only sections with entries: - **Hosted by me** — Events you host. Each row displays "Log in to Sansar to edit this event." and has no **Interested** removal button. - **Upcoming events** — Upcoming events you saved with **Interested**. - **Past events** — Past events you saved with **Interested**. 3. **On sansar.com:** Review any row. Each row shows the event image (or **No image**), title, date and time, and description if provided. On wider screens, it also shows the host's name, linked to their profile. To open the event page, select the title or image. Live rows also show **Go Now**, a link meant to open the event in Sansar. 4. **On sansar.com:** To remove an event from **Upcoming events** or **Past events**, select the checkmarked **Interested** button on that row. The row disappears. If removal fails, the row reappears without displaying an error message. When all three sections are empty, **My Calendar** displays "No events on your calendar", "You haven't saved any events to your calendar yet. Browse events to find something you'll enjoy!", and **Browse Events**. ## Adding events to a third-party calendar Use **Add to Calendar** on an event page to add an event to an external calendar. This is separate from selecting **Interested**. 1. **On sansar.com:** Open [Events](https://www.sansar.com/events) and select an event to open its page. 2. **On sansar.com:** Under **Date & Time**, select **Add to Calendar**. 3. **On sansar.com:** Select a calendar option: - **Google Calendar** — Opens Google Calendar in a new tab with the event details and event URL (as location) filled in. - **Outlook** — Opens Outlook in a new tab with the event details and event URL (as location) filled in. - **Apple Calendar (.ics)** — Downloads a `.ics` file with the event details and event URL. You can open it in Apple Calendar or another compatible calendar app. Source: https://docs.sansar.com/events/adding-events-to-your-calendar --- # Creating Your Own Events ## Creating your own events You can create your own [events](/events/attending-event-in-sansar) in Sansar. To add an event: 1. Choose **Create > Host an event** from the main menu. 2. In the Create Event panel, enter the following information: * **Choose starting content** - Choose a scene template from the dropdown. This determines the content of the event's world. * **Event name** - Enter a name for the event. * **Image:** Upload a 16:9 PNG image between 480 × 270 and 1920 × 1080 pixels, up to 10 MB. For full image rules, see [Event guidelines](/guidelines/event-guidelines#id-5.0-event-image). * **Description** - Provide a brief description of the event to provide more information to potential visitors. * **Date** - Select the date of the event from the dropdown. You may select a date several months in advance. * **Start time** - Select the start time of the event from the dropdown. * **Duration** - Select the duration of the event from the dropdown. Events run in 30 minute increments and may not be longer than 8 hours at this time. 3. Click **Save & Publish** to publish your event to the Upcoming events calendar.

The Create Event panel. Fill in the required information about your event and click Save & Publish to publish your event to the Upcoming events calendar.

Events you host also appear under **Hosted by me** in **My Calendar** on sansar.com. Each row displays "Log in to Sansar to edit this event." See [Adding events to your calendar](/events/adding-events-to-your-calendar). ## Hosting an event more than once You can duplicate the details of your event into a new event. This is helpful if you plan on running a recurring event with the same name and description, but at a different date or time. To host an event again: 1. Choose **Go > Events** from the main menu to open the Codex to the Events section. 2. Click the **Calendar** or **Past events** tab. 3. Find the event you would like to duplicate, click it to open its details, and choose **... > Duplicate**. 4. The Duplicate Event panel appears, populated with the information from your existing event. 5. Change the relevant details, then click **Save & Publish** to create a new copy of the event. ## Important notes * Events take place in a new world created specifically for the event, so you must have at least one free slot in order to create the event. The world remains after the event has ended, so you must delete it in order to reclaim the slot. * Because events take place in a newly-created experience, visitors cannot visit the event by simply visiting the world using the Codex Instead, visit events by using the Events section of the Codex, which can be accessed by choosing **Go > Events**. Source: https://docs.sansar.com/events/creating-your-own-events --- # Tipping ## Tipping If you are enjoying a particular artists performance, you can now show your appreciation by leaving a tip! When tipping is enabled you will see an icon on the left side of your screen above all of the other buttons. ![](/media/screenshot-pending.svg) 1. Log in to Sansar. * If you haven't already, be sure to [download Sansar](https://www.sansar.com/download) and [create an account](https://www.sansar.com/account/register)! * If you need help setting up an account, check out our [account creation tutorial](/account/create-account) 2. Go to an event (with tipping enabled). ![](/media/screenshot-pending.svg) 3. Click the gold tip button After you click on this icon you will be given several options regarding how much you want to tip! ![](/media/screenshot-pending.svg) Fig A 4\. Select the amount you want to tip from the tipping menu (shown here in Fig B) ![](/media/screenshot-pending.svg) (Fig B) 5\. Once confirmed you will see a reaction confirming that your tip was successful (shown here in Fig C) ![](/media/screenshot-pending.svg) Fig C When you select an amount to tip, that amount will be transferred from your Sansar account to the performer or artist's account! There will also be a reaction that appears above your avatar's head reflecting how much you have tipped. To view tips you have sent or received, open **Transaction History** on sansar.com and use the **Tips** filter. See [View your transaction history](/sansar-dollars/transaction-history). Source: https://docs.sansar.com/events/tipping --- # Avatar Broadcasting FAQ ## Avatar broadcasting FAQ ### What is avatar broadcasting? _Avatar broadcasting_ is a feature that allows event hosts to project their avatars into parallel "clone" instances of the same world in order to circumvent the usual limits on the number of people who are allowed to visit a world simultaneously. This allows you to reach a much larger audience and provide a "front row" experience to all visitors, regardless of the number of attendees. ### Why is avatar broadcasting necessary? For performance reasons, worlds normally have a maximum occupancy of about 50 avatars. Once this limit is reached, new visitors are instead sent to a parallel copy, called an _instance_, of the same world where they can explore the scene without worrying about degrading performance due to the excessive number of avatars in the scene. However, this arrangement can be problematic during events where the presenter wants to reach more than 35 guests; under default circumstances, any visitors over the instance limit are unable to see or hear the presenters, since they have been sent to a copy of the scene with a different set of visitors. Avatar broadcasting allows avatars from one "broadcasting" scene to be projected into other instances of the same scene, allowing a much larger audience to see and hear them. ### How does avatar broadcasting work? Avatar broadcasting makes use of two or more instances of a scene: A _broadcasting instance_, inhabited by the event hosts and VIPs, and one or more _clone instances_, which may be visited by event guests. ### Broadcasting instance The broadcasting instance is typically where the event host and certain VIPs reside during an event. These broadcasters can be seen and heard in all the clone instances of the world, as though they were actually there. However, this projection goes only one direction: people in the broadcasting instance cannot see people in clone instances or hear their voice chat. Text does carry across all broadcasting and clone instances. As a broadcaster, this means it may feel as though you are talking to an empty room, but remember that for your audience it most likely appears to be a full house. ### Clone instances Visitors to an avatar broadcasting event are sent to copies, or _clones_ of the the world the broadcaster is in. There can be multiple clones depending on the number of visitors. Visitors in the clone instances can see and chat with each other if they are in the same instance, and they can also see and hear everyone who is in the broadcasting instance. Broadcasters _cannot_ see or hear visitors to the clone instances, but text chat carries across all broadcasting and clone instances. This lets everyone communicate with each other across instances. Broadcasters who appear in a clone instance look and sound just like everyone else, but are marked with a red **Broadcasting** tag to set them apart from other visitors. Broadcasters also have an icon above their head that consists of animated concentric circles.

Broadcasted avatars are marked with the word Broadcasting in their nametag.

***

Broadcasted avatars also have a circular icon above their heads for quick identification

### Interactions between broadcasting and clone instances Visitors to a clone instance _cannot_ affect the environment in the broadcasting instance. However, broadcasters may take certain actions that have an effect on the clone instances. Here are some of the effects you may observe: * Visitors to a clone instance cannot run into, or _collide_ with broadcasters. Instead, the avatars pass harmlessly through each other. (Remember, broadcasters cannot even see visitors so they may accidentally walk through someone.) * Visitors can hear broadcasters in voice chat, but the broadcasters cannot hear visitors. * Visitors may see movable dynamic objects that appear in the broadcasters' scene, but they cannot move them or pick them up. They may see the broadcasters manipulating some objects, while they cannot see others. Broadcasters cannot see or collide with dynamic objects that appear in a clone instance. * If a broadcaster is standing on an object that moves, visitors see him move around the scene as the object moves. If the corresponding object in the clone instance is in a different place, the broadcaster may appear to be flying or otherwise standing on an invisible object. One notable exception to these rules is that text chat carries both ways between the broadcasting and clone instances, giving visitors a means to communicate with broadcasters in the broadcasting instance.
### How can I enable avatar broadcasting? As a world owner, use `%%broadcast-on ` to enable broadcasting for an avatar and `%%broadcast-off ` to turn it off. See [Moderation tools for world owners](/create/worlds/moderation-tools-for-world-owners). Source: https://docs.sansar.com/events/avatar-broadcasting-faq --- # Deploying Unpublished Event to Event World > Event-specific version of a published world that you want to use for an event listing. ## Deploying unpublished NON-event world content to an event world Say you've created a private, event-specific version of a published world that you want to use for an event listing — yet you can't select it during the event creation process! Initial events can only link to published worlds, to register them as connected for popularity metrics. However, after you've created that event, you can easily link the event to ANY unpublished content. Here's a simple workaround you can do in less than a minute: First, the usual event creation process: 1. Click **Create menu > Host an event**. 2. Fill out the event details. You should base it on the "main" published world that the variant was derived from, as it attributes the original with subsequent "popularity" info for the event hosted within. In any case, you'll be changing this shortly. 3. Click **Save & Publish**. Time to deploy: 1. Open **Create menu > Build worlds**. In this **MY WORLDS** window, your new event will be on the top of the list. 2. Now, in the same **MY WORLDS** window, scroll to the actual world variant you want to use for this event. 3. Click **(...) > Deploy scene** and read the instructions inside. * **Deploy scene** is an extremely useful feature, because it does NOT disconnect a scene from its original world — each time you deploy, it makes an extra copy! So you'll have a backup. 4. Optional: under "**Choose a name for the scene's copy**", rename it if you wish. 5. Under "**Move the scene copy into this world**", choose the event. Events have "**(event)**" next to their names. 6. Click **DEPLOY**. 7. Visit the event world to confirm the content is as intended. You're done, have an eventful time! Source: https://docs.sansar.com/events/deploying-unpublished-event-to-event-world --- # Store > Shop the Sansar Store and sell what you make. ## Shopping - [Buying Items From The Store](/store/shopping/buy-items) - [Browse the Sansar Store](/store/shopping/about-the-store) - [Redelivering Lost Purchases](/store/shopping/redelivering-lost-purchases) ## Selling - [Selling Items in Sansar Store](/store/selling/manage-listings) - [View your Store sales](/store/selling/view-your-sales) - [Selling Items in an Experience](/store/selling/selling-items-in-experience) - [Allowing Resale Of Items](/store/selling/allowing-resale-of-items) - [Buyers Permissions](/store/selling/buyers-permissions) - [Hidden Store Listings](/store/selling/hidden-store-listings) - [Selling Materials](/store/selling/selling-materials) See also: - [Cash out your earnings](/sansar-dollars/withdraw) - [Store listing guidelines](/guidelines/store-listing-guidelines) - [Store banner guidelines](/guidelines/store-banner-guidelines) Source: https://docs.sansar.com/store --- # Buying Items From The Store > Find and buy items from the Sansar Store on sansar.com or in Sansar. ## Buying items from the Sansar Store Buy assets for your scenes and avatars from the [Sansar Store](https://www.sansar.com/store) instead of building everything from scratch. Once you buy an item, it is automatically added to your inventory in Sansar. ## The Store panel Open the Sansar Store inside Sansar from the main menu: 1. **In Sansar:** Select **Shop** on the main menu, then select **Avatar looks** or **Scene creation** to open the Store panel. - If you're in VR, press **Y** on Oculus Rift or **Left menu** on Vive to open the main menu, then select **Shop the store**. 2. **In Sansar:** Find an item in the Store panel. Open the **Categories** dropdown or type search terms in **Search the Store** to narrow your results. 3. **In Sansar:** Select the item to open its listing, which shows details and photos of the item (if available). 4. **In Sansar:** Select **Buy** (or **Get** for free items) to buy the item right away. Once purchased, it is automatically added to your inventory. - For avatar looks items (such as avatars, clothing, and emotes), **Buy** becomes **Wear it now**. Select **Wear it now** to open the avatar editor and wear the item right away. 5. **In Sansar:** Find the item in the Inventory panel when editing a scene, or in the avatar editor tabs when editing an avatar look, depending on the item type.

New wearables show New on the thumbnail. A numbered badge shows how many new wearables are on each tab of the appearance editor.

**Note:** The shopping cart isn't currently available in the Store panel.

Open the Sansar Store inside Sansar using the Store panel.

After buying an avatar-related item, select Wear it now to open the avatar editor and wear it right away.

## Buying an item from the Store on the web To find and buy an item from the Sansar Store on the web: 1. **On sansar.com:** Open the [Sansar Store](https://www.sansar.com/store). 2. **On sansar.com:** Type search terms in **Search the Store...** and select **Search**, or select **Explore** and pick a category. On a category page, the box reads **Search in {category}...**. On narrow screens, the search box is hidden, though **Explore** remains available. See [Browse the Sansar Store](/store/shopping/about-the-store) for more ways to browse, sort, and search. 3. **On sansar.com:** Select the item to open its listing page, which shows its title, details, description, and image gallery. 4. **On sansar.com:** Select **Buy Now** to buy the item directly (free listings show **FREE** and still use **Buy Now**), or select **Add to Cart** to add the item to your cart and keep shopping. - **On sansar.com:** If you aren't signed in, the buttons read **Log in to Buy** and **Log in to Add to Cart**; sign in before purchasing. - Direct purchase shows **Processing...**, then **Purchased** (or **Failed — try again** if it fails). - Adding an item to your cart shows **Adding...**, then **Added to Cart**. 5. **On sansar.com:** Open **Shopping cart** in the top bar (on narrow screens, open **Menu** first), review **Shopping Cart**, and select **Checkout**. - **On sansar.com:** Select **Remove** to remove an item from your cart, or select **Clear Cart** to empty the cart. An empty cart displays "Your cart is empty." with a **Browse Store** link. - During checkout, the button changes from **Processing...** to **Redirecting...**. Store Home then displays "Purchase complete! Items have been added to your inventory." with a **Dismiss** button. - **On sansar.com:** If checkout fails, the cart displays an error message (with fallback "Checkout failed. Please try again."). If an item is missing after checkout, check **My Purchases** or your remaining cart, because partial cart checkouts can still report success. 6. **In Sansar:** Find your purchase in the Inventory panel when editing a scene, or in the avatar editor tabs when editing an avatar look, depending on the item type. ![Search the Store... bar and Explore category menu on sansar.com](/media/screenshot-pending.svg) **Note:** If you lose or delete a purchased item, you can redeliver it from **My Purchases** or its Store listing. See [Redelivering lost purchases](/store/shopping/redelivering-lost-purchases).
To narrow results while shopping on sansar.com, use **Explore** categories and the **Sort:** options in [Browse the Sansar Store](/store/shopping/about-the-store). ## Read a listing Select a product card to open its listing page (`/store/listings/{id}/{slug}`). Short `/store/listings/{id}` links redirect to the full listing URL. - **On sansar.com:** **Breadcrumbs:** Select **Store** to return to the Store, or select the creator's name to open their shop. - **On sansar.com:** **Image gallery:** Select a thumbnail to change the main image. When a listing has no images, the gallery displays **No image**. - **On sansar.com:** **Listing details:** Below the title, check **Item name** (the inventory name, which can differ from the listing title), **Category** (links to category browse when available), and **Sold by** (opens the creator's shop). Check **Min. resale price** (shown only when resale is enabled), **Listed** (when available), and **Description**. Select a tag under **Tags** to search the Store for it. - **Garment badge:** If present, **Made with Marvelous Designer** indicates that the item can be dynamically adjusted. - **On sansar.com:** **Price, Like, and actions:** Non-owners see **FREE** or the price in Sansar Dollars (S$), **Like**, and the purchase and cart buttons. You must be signed in and have purchased the item to like it (tooltips show **Log in to like** or **Purchase this item to like it**). After you like it, the button reads **Liked** (tooltip **Unlike**); select it again to remove your like. If you own the listing, you see **Manage Listing** (which opens the listing editor) and a read-only like count instead. ## Report a listing To report a listing on sansar.com, select **Report this listing** below the description and tags. Describe the problem and send the message from your email app. For full steps, see [Report a Store listing](/safety/report-on-sansar-com#report-a-store-listing). Source: https://docs.sansar.com/store/shopping/buy-items --- # Browse the Sansar Store > Find items with Store categories, search, collections, tags, and creator shops. Use the [Sansar Store](https://www.sansar.com/store) on sansar.com to find items, open their listings, and visit creator shops. You don't need to sign in to browse or search.
## Browse the Store 1. Open [sansar.com](https://www.sansar.com) and select **Store** in the top bar. 2. Choose where to start: - **Home** shows featured banners and collections. Select **See all** to open a collection. - **All** shows products across all categories. - **Explore** opens the category menu. Select **All categories**, a category, or a subcategory. 3. Select a **Sort:** option on **All** or a category page: **Most Liked**, **Price: Low to High**, **Price: High to Low**, or **Recently Created**. Select **×** next to the sort to clear it. 4. Use **Show:** to display **20**, **40**, or **60** items per page. Use the page controls at the top and bottom of the grid to move between pages. ## Search the Store 1. Type keywords in **Search the Store...**, then press **Enter** or select **Search**. On a category page, the box reads **Search in {category}...** and searches only that category. 2. Select **Search all categories** to widen a category search, or select **Clear search** to start over. The search box is hidden on narrow screens. Use a wider window to search; **Home**, **All**, and **Explore** remain available. On a listing page, select any of its **Tags** to search the Store for that tag. ## Product cards - Select a card to open the item's listing, or select the creator's name to open their shop. - Each card shows the price in Sansar Dollars (S$), or **Free**. It can also show **MD** (made with Marvelous Designer), **Purchased**, or **In Cart**. - If you're signed in, hovering over a card's price can show **Buy Now** and **Cart**, or **Redeliver** for an item you already own. ## Visit a creator's shop Select a creator's name on a product card, or under **Sold by** on a listing, to open their shop. A shop can show a banner, logo, name, and description, with the creator's name linking to their profile. To search only that shop, use its **Search {store name}...** box. Shops have the same **Sort:**, **Show:**, and page controls as **All**. If a grid you expect to have items is empty, reload the page. ## Next steps - To read a listing, buy an item, or report a listing, see [Buying items from the Store](/store/shopping/buy-items). - To get Sansar Dollars (S$) for paid items, see [Buy Sansar Dollars](/sansar-dollars/buy). - To get a lost or deleted purchase back, see [Redelivering lost purchases](/store/shopping/redelivering-lost-purchases). - To sell your own items, see [Selling items in the Sansar Store](/store/selling/manage-listings) and the [Store Listing Guidelines](/guidelines/store-listing-guidelines). Source: https://docs.sansar.com/store/shopping/about-the-store --- # Redelivering Lost Purchases > Redeliver Store purchases from My Purchases or a listing on sansar.com. ## Redelivering lost purchases If you lose or delete an item you bought from the [Sansar Store](/store/shopping/buy-items), redeliver it from **My Purchases** or its Store listing on sansar.com, or from the Store panel in Sansar. ## Redelivering from the Store panel 1. **In Sansar:** Open the Store by selecting **Shop > Scene creation** or **Shop > Avatar looks**. 2. **In Sansar:** Search the Store for the item and select its listing to open it. 3. **In Sansar:** Select **Redeliver** (which replaces **Buy** or **Get**) to instantly deliver a new copy to your inventory. For items under Avatar looks (such as avatars, clothing, and emotes), the button is **Wear it now** instead of **Redeliver**. **Note:** If there are no copies of an avatar-related item in your inventory, selecting **Wear it now** redelivers it.

On the Store listing for an item you purchased, Redeliver replaces Buy or Get.

## Redelivering from the web To redeliver from **My Purchases** on sansar.com: 1. **On sansar.com:** Sign in, select your display name in the top bar (or, on a phone, the ☰ menu, labeled **Menu**), and select **Purchases** to open **My Purchases**. You can also open [My Purchases](https://www.sansar.com/store/purchases) directly, which requires signing in first. 2. **On sansar.com:** Find your purchase in the list (20 purchases per page): - Type an item name, seller name, or handle in **Filter by item or seller...** to filter the current page only. Select **×** or **Clear filters** to reset the filter. - Use **‹ Prev** and **Next ›** at the top, or **Previous**, page numbers, and **Next** at the bottom, to move between pages. Select **...** to open **Go to page** and **Go**, or select **Back to top** to return to the top of the list. 3. **On sansar.com:** Select **Delivered** (which reads **Redeliver** on hover), or tap it on a touch screen. The page displays "Item redelivered successfully!" on success, or "Failed to redeliver item. Please try again." if it fails. If a purchase is deprecated, **Deprecated** replaces the redelivery button. Purchases without a product ID don't have a redelivery button. If you have no purchases yet, **My Purchases** displays "No purchases yet" ("Items you buy from the store will appear here.") with a **Browse Store** link. If you see "No purchases match your filter on this page", adjust your filter, select **Clear filters**, or browse other pages. To redeliver from the item's Store listing: 1. **On sansar.com:** Open the listing page for the item you purchased. 2. **On sansar.com:** Select **Purchased** (which reads **Redeliver** on hover), or tap it on a touch screen. There is no confirmation dialog. The button changes to **Redelivering...** and then **Redelivered!**. ![My Purchases page on sansar.com showing the Delivered button that changes to Redeliver on hover](/media/screenshot-pending.svg) Source: https://docs.sansar.com/store/shopping/redelivering-lost-purchases --- # Selling Items in Sansar Store > Manage your Store listings and edit their details on sansar.com. ## Selling items in the Sansar Store Create, edit, and manage listings for your original creations in the Sansar Store. You can sell your work for Sansar Dollars (S$) so others can use it in their Sansar worlds. ## Item listing guidelines Review the [Store Listing Guidelines](/guidelines/store-listing-guidelines.md) before you create a listing. All Store listings must follow these guidelines so buyers can find what they need. ## Creating a new listing ### For items in your inventory To sell an item in the Store, first create a listing from an item in your inventory: 1. **In Sansar:** Select **Create > Build Worlds** from the main menu to open the My Worlds panel. 2. **In Sansar:** Select **Edit scene** on one of your worlds in the My Worlds panel. If you don't have a world yet, you can create one by following [Creating a world](/create/worlds/creating-a-world.md). 3. **In Sansar:** Upload the item you want to sell while editing the world. For help, see [Uploading content in Sansar](/create/import/importing-items.md). 4. **In Sansar:** Set the Inventory panel filter to **Created** and find your uploaded item. 5. **In Sansar:** Right-click the item and select **Sell item**. A dialog displays "Create a listing for \[your item name]".

Select Sell item.

6. **In Sansar:** Select **Create Listing** to create the listing on the Sansar Store. A dialog displays "Open web browser to finish listing your item?".

Select Create Listing.

7. **In Sansar:** Select **Go to Web** to edit the listing in your web browser.

Once the item is listed, you can edit it on your Manage Listings page.

**Note:** You can list only items you uploaded to Sansar. You can't list items you bought from the Sansar Store. ### For clothing and accessories To sell clothing or accessories in the Store, first create a listing from an item in your **Lookbook** (where you customize your avatars): 1. **In Sansar:** Open **Lookbook** from the App Launcher. 2. **In Sansar:** Select an avatar and select **Customize**. 3. **In Sansar:** Select the **Clothing** or **Accessories** tab. 4. **In Sansar:** Right-click a clothing or accessory item you uploaded and select **List item**. A dialog displays "Create a listing for \[your item name]". 5. **In Sansar:** Select **Create Listing** to create the listing on the Sansar Store. A dialog displays "Open web browser to finish listing your item?".

Select Create Listing.

6. **In Sansar:** Select **Go to Web** to edit the listing in your web browser.

Once the item is listed, you can edit it on your Manage Listings page.

**Note:** You can list only items you uploaded to Sansar. You can't list default items or items you bought from the Sansar Store. ## Manage your listings Create listings in the Sansar client (see [Creating a new listing](#creating-a-new-listing)). On sansar.com, you find, edit, list, unlist, and delete them. 1. **On sansar.com:** Sign in, select your display name in the top bar (on a narrow screen, open **Menu**), and select **Manage Listings**. 2. **On sansar.com:** Find your listing on the **Listings** tab. Each row shows the item, its price, its status (**LISTED**, **UNLISTED**, **HIDDEN**, or **DEPRECATED**), and, on desktop, when it was last updated. To narrow the list, use **Filter by name...**, the status menu, or the price menu. Filters apply only to the current page (up to 30 listings), so use the page controls to see the rest. 3. **On sansar.com:** Open the listing's **Actions** menu (**⋮**) and select an action: - **On sansar.com:** **View in store** opens the public listing (listed items only). - **On sansar.com:** **Edit** opens **Edit Listing**. You can also select the item's name. - **On sansar.com:** **Unlist** or **List** changes the status right away, with no **Save Changes** step. **List** makes a hidden item public; to hide a listing, use **Edit Listing**. - **On sansar.com:** **Delete** opens **Delete listing?**. Confirm by selecting **Delete** to remove the listing permanently; this can't be undone. The other tabs are **Sales** (see [View your Store sales](/store/selling/view-your-sales)) and **My Store** (see [Upload a store banner](#upload-a-store-banner)). If the **Listings** tab says "No listings yet" even though you have listings, reload the page. ## Editing a listing Before you edit a listing, make sure it follows the [Store Listing Guidelines](/guidelines/store-listing-guidelines). 1. **On sansar.com:** Sign in, select your display name in the top bar (on a narrow screen, open **Menu**), and select **Manage Listings**. 2. **On sansar.com:** Select the listing's name on the **Listings** tab, or open its **Actions** menu (**⋮**) and select **Edit**. 3. **On sansar.com:** Update the fields you need on **Edit Listing** (see the table below). 4. **On sansar.com:** Select the listing's visibility: - **On sansar.com:** **List this item and make it available in the Sansar Store.** makes the item public. - **On sansar.com:** **List this item and make it hidden in the Sansar Store.** creates a [hidden listing](/store/selling/hidden-store-listings). Anyone with the link can still open it. Selecting one checkbox clears the other. Clear both to unlist the item. 5. **On sansar.com:** Select **Save Changes**. "Changes saved successfully." confirms the save. **Cancel** returns to **Manage Listings** without saving field changes. **On sansar.com:** To delete a listing, use **Actions** > **Delete** on **Manage Listings**. | Field or control | What it does | |---|---| | **Item Name** | The inventory name customers see. It's separate from the listing title. | | **Listing title** | The title of the Store listing. | | **Category** | The listing's category. You can change it only within the 3D-model and audio category families; for other items, it can't be changed. | | **Description** | The listing description. | | **Tags** | Type a tag in **Add tag...** and press **Enter**. You can add up to five tags; they're saved in lowercase. Select **×** to remove one. | | **Price** | The listing price. If the item contains resellable components, **Minimum S${amount}** shows the lowest price you can set. Select **?** to see the **Minimum price** breakdown by **Component**, **Creator**, and **Resell price (S$)**. | | **Profit per sale:** | Your price minus the component resale prices, never shown below zero. For fees and payouts, see [Cash out your earnings](/sansar-dollars/withdraw). | | **Buyer can resell this item for a minimum price of:** | Select the checkbox to type a minimum resale price. See [Allowing resale of items](/store/selling/allowing-resale-of-items). | | **Main image** and **Additional images (max 9 images)** | Select **Click to add main image** or **Click to add image**. Images must be PNG files at least 600 × 600 pixels and up to 10 MB. For full rules, see [Image guidelines](/guidelines/store-listing-guidelines#image-guidelines). Images upload right away, separate from **Save Changes**, so **Cancel** doesn't undo them. To remove an image, hover over it and select **×**. You can't delete the last image of a public listing; hide or unlist it first. | | **View public listing →** and **Copy public link** | Open the public listing or copy its link. **Copy public link** changes to **Copied!**. | ## Upload a store banner Your store banner appears at the top of your public store page. For the image rules, see [Store banner guidelines](/guidelines/store-banner-guidelines). 1. **On sansar.com:** Sign in, select your display name in the top bar (on a narrow screen, open **Menu**), and select **Manage Listings**. 2. **On sansar.com:** Select the **My Store** tab. The banner controls appear under **Store banner**. 3. **On sansar.com:** Upload a PNG, JPEG, or WebP image up to 10 MB (1180 × 300 pixels is recommended, not required): - **On sansar.com:** If you don't have a banner yet, select **Click or drag image here** and choose the file, or drag the image into that area. - **On sansar.com:** To change your banner, select **Replace Image**, or drag a new image onto the current banner. The control reads **Uploading...** while the image uploads. 4. **On sansar.com:** If the **public store page.** link appears under **Store banner**, select it to check the result. There is no **Save Changes** button on this tab; your banner is saved when the upload finishes. **On sansar.com:** To remove your banner, select **Remove**. There is no confirmation step. **On sansar.com:** If the preview doesn't update after an upload, check the image format and size, reload the page, and try again. ## Updating an existing listing with a new item You can replace an item in an existing Sansar Store listing with a newer, corrected, or improved version of the same item without creating a new listing. Existing links to your listing stay the same. As of September 3, 2019, updating an existing listing with a new item is supported for these items only: - Scripts (can be updated without restriction) - All avatar-related items (avatars, rigged clothing, MD clothing, rigged hair, emotes, accessories), which can be updated only once if the listing is originally an avatar 1.0 listing; avatar 2.0 listings can't be updated To update an existing listing in the Sansar Store: 1. **In Sansar:** Upload the replacement item in the avatar editor or scene editor. It helps to give it a different name or version number to tell it apart from the original. If it's an avatar-related item, make sure the inventory item has a thumbnail image. 2. **In Sansar:** Find the new item, right-click it, and select **Replace store item**.

Select Replace store item in the scene editor.

3. **In Sansar:** Type the listing's 36-character item number or URL in the Store Product ID to Update panel, then select **Continue**. You can use either the Store listing page URL or the Edit Listing page URL. A confirmation panel appears when the item is updated. Your Store listing now sells the updated version of the item.

Enter the item number or listing page URL and select Continue.

4. **In Sansar:** Select **Yes, edit listing** to edit the listing in your web browser, or select **No, I'm done** to dismiss the panel with no further action.

A confirmation window appears when the item updates. Select Yes, edit listing to edit the listing in your web browser.

**Note:** Previous customers must select **Redeliver** from their purchase history to get a copy of the updated item. See [Redelivering lost purchases](/store/shopping/redelivering-lost-purchases). ## Transaction fees For the fees and limits that apply to your Store earnings, see [Limits and fees](/sansar-dollars/withdraw#limits-and-fees). Source: https://docs.sansar.com/store/selling/manage-listings --- # View your Store sales > See how many Store sales you've made in the last 7 and 30 days and what each sale earned you, including license payouts. Use the **Sales** tab on sansar.com to check your Store sales counts and what you made from each sale, including license payouts. ## Before you start - **Sign in at sansar.com.** If you aren't signed in, opening the **Sales** tab sends you to the login page first, then back. Any signed-in account can open it. - **Know what appears here.** The **Sales** tab lists Store item sales only. For gifts, tips, Sansar Dollar bundles, and event tickets, see [View your transaction history](/sansar-dollars/transaction-history). - **Check payout rules separately.** For how earned Sansar Dollars (S$) work and how to cash them out, see [Cash out your earnings](/sansar-dollars/withdraw#earned-sansar-dollars). ## View your Store sales 1. Open [Sales](https://www.sansar.com/store/dashboard/sales), or select your display name in the top bar on [sansar.com](https://www.sansar.com), select **Manage Listings**, and select the **Sales** tab (next to **Listings** and **My Store**). The page heading stays **Manage Listings**. 2. Check the three summary boxes at the top: **Last 7 Days**, **Last 30 Days**, and **Total**. These show counts of sales, not S$ amounts. Numbers of 1,000 or more are shortened (for example, `1.2K` or `1.2M`). 3. Browse your sales (up to 60 rows per page). If you have more than one page, use **‹ Prev** and **Next ›** at the top, or **Previous**, page numbers, and **Next** at the bottom. - If **...** appears at the bottom, select it to open **Go to page**, type a page number, and select **Go**. - Select **Back to top** to return to the top of the list. 4. Filter the current page using these controls: - Type an item name or a buyer's Avatar ID in **Filter by item or buyer...**. Select **×** in the box to erase your search text. - Open the **Any amount** menu and select **Free only** or **Paid only**. Select **Clear filters** to reset both filters. 5. Select a sale row to open that listing's edit page. See [Selling items in the Sansar Store](/store/selling/manage-listings) for editing listings. Filters search only the page you're on. To search sales on another page, open that page and filter there. You can't export or download your sales list. ## What each column shows - **Item**: the item's thumbnail (or `—`) and name. - **Profit (S$)**: what you made from the sale in S$, or **Free** when it's 0. - **Date**: the date and time of the sale. - **Buyer**: the buyer's Avatar ID, linked to their profile (or `—`). ## License payouts A row with "(license payout)" after the name is a payout to you when someone else sells an item that uses your component. When available, the row shows your component's name. See [Allowing resale of items](/store/selling/allowing-resale-of-items) for how resale works. Selecting a license payout row doesn't open a listing. ## On a phone or narrow screen Open **Menu** to find your display name and **Manage Listings**. If your sales appear as cards instead of a table, each card shows the item's thumbnail, name, profit (or **Free**), and the date without the time. The buyer's Avatar ID appears as plain text rather than a link. Select a card to open that listing's edit page (except for license payouts). ## If something goes wrong - **You expect entries, but see "No sales yet".** Reload the page. If your sales still don't appear, [contact support](/help/contact-support). - **You see "No sales match your filters on this page".** Filters apply only to the 60 rows on the current page. Adjust your filters, select **Clear filters**, or browse other pages. Source: https://docs.sansar.com/store/selling/view-your-sales --- # Selling Items in an Experience ## Selling items inside an experience By using Sansar's official script libraries, you can allow visitors to make purchases from the Sansar Store while visiting your experience. By using this script feature, you can create an immersive shopping experience for your visitors. This article covers one possible way to configure and trigger the Store Listing library script, but with creative use of the official script library many other configurations are possible. ## Open a store listing by interacting with an object In this example, we'll be adding scripts to an object that allow visitors to quickly purchase a specific item from the Sansar Store when they click the object. To accomplish this, we need two scripts: one to detect when the object has been clicked, and one to open the store listing once a click has been detected. Both of these scripts are part of the Scene Script Library, which appears in your Sansar inventory by default. You will also need an object in your scene for visitors to interact with and launch the store interface. It should be sized and located in such a way that avatars may approach it within 3 meters and click with their mouse cursor. ## Finding the Scene Script Library While editing your scene, use the dropdown menus to filter your inventory for **Purchased** items, and **Scripts**. _Scene Script Library_ is included by default. Alternatively, you may search your inventory for "Scene Script Library" in the **Search by name** field.

Find Scene Script Library in your purchased scripts. No purchase is necessary; it is included by default.

*** ## Configuring _Store Listing_ The _Store Listing_ script opens a specific store listing in the Sansar client when it is triggered by another script. To configure _Store Listing_: 1. Drag **Scene Script Library** from your inventory onto an object in your scene. 2. Open the object's Properties panel by right-clicking it and choosing **Properties**. 3. In the Properties panel, scroll down to the section marked "Scene Script Library". 4. In the second dropdown menu under Script, select **Store Listing**. 5. Take note of the field labeled **-> Show Listing**. The _Interaction_ script will need to be configured using the value in this field. The value is "show" by default, but you may change it. **Note:** If you have multiple objects selling different items in your scene, the value for **-> Show Listing** must be different for each one. 6. In the **Product ID or URL** field, enter the URL (from your web browser) or product ID of any listing in the Sansar Store. The listing does not need to be one that you created yourself. 7. Leave all other fields with their default values.

In the second dropdown menu under Scene Script Library, choose Store Listing.

***

Enter the URL or product ID of a listing from the Sansar Store in the Product ID or URL field. Take note of the value in the -> Show Listing field for use in the next section.

*** Next, you must configure another script to trigger this _Store Listing_ script. In this example, we'll be using the _Interaction_ script to trigger when the object is clicked. ## Configuring _Interaction_ The _Interaction_ script makes an object "clickable" with a mouse or VR controller. When this interactive object is clicked, the script can then trigger other scripts, such as _Store Listing_. To configure _Interaction_: 1. Drag a copy of the **Scene Script Library** from your inventory into the same object where you configured _Store Listing_. 2. If it is not already open, open the object's Properties panel by right-clicking it and choosing **Properties**. 3. In the Properties panel, scroll down to the _second_ section marked "Scene Script Library". The second dropdown menu in this section should be set to **Interaction** by default. 4. Enter an appropriate value for **Interaction Prompt**. This is the text that appears when a visitor hovers their mouse cursor over the object. 5. In the **On 1st Click ->** field, copy the value you entered for **-> Show Listing** in the _Store Listing_ script. 6. Leave all other fields with their default values.

In the second Scene Script Library, make sure the second dropdown menu is set to Interaction. Then, copy the value from -> Show Listing in Store Listing into the field for On 1st Click ->. This is how the two scripts will know to communicate with each other.

***

When a visitor clicks the interactive object a limited Sansar Store panel appears, allowing them to immediately purchase the item designated by the Store Listing script

*** You have now successfully configured a pair of scripts from Sansar's official Scene Script Library. When a visitor approaches within 3 meters of your scripted object, they can click it to trigger the _Interaction_ script. _Interaction_ sends the message "show" to the _Store Listing_ script, which opens a Sansar Store panel allowing the visitor to immediately buy the listed item. Source: https://docs.sansar.com/store/selling/selling-items-in-experience --- # Allowing Resale Of Items > Set a resale price and check component resale requirements on sansar.com. ## Allowing resale of store items When you [edit a Sansar Store listing](/store/selling/manage-listings.md), you can choose to allow buyers to resell your item on its own or as part of their creations. If you allow resale, you must set a minimum resale price. Whenever someone resells your item, you receive that resale price as a commission. For example, if you set a resale price on automotive wheels and another creator buys them and adds them to a car they sell, you receive a commission each time that car sells. ## Setting a resale price ### Buyer's permissions You can set a resale price only on Store items set to **Property Changes Only**. For details, see [Buyer's permissions](/store/selling/buyers-permissions.md). If the item uses **Full Permissions**, or if the listing predates the permissions system, [update your Store listing](/store/selling/manage-listings.md#updating-an-existing-listing-with-a-new-item) with an object set to **Property Changes Only**. **Caution:** If you sell an item with _full permissions_, buyers can do whatever they want with it, including reselling it without paying you a commission. ### Resale price To set the resale price: 1. **On sansar.com:** [Edit a new or existing listing](/store/selling/manage-listings#editing-a-listing) in the Sansar Store. 2. **On sansar.com:** Type your sale price under **Price**. 3. **On sansar.com:** Select **Buyer can resell this item for a minimum price of:**. The amount field below it is disabled while unchecked. 4. **On sansar.com:** Type the minimum resale price in the field below **Buyer can resell this item for a minimum price of:**. 5. **On sansar.com:** Select **Save Changes** and check for "Changes saved successfully." ![Edit Listing on sansar.com showing Price, the Buyer can resell this item for a minimum price of: checkbox, and Save Changes](/media/screenshot-pending.svg) The resale price is the amount you receive whenever a buyer resells your item. To make a profit, the reseller must set their price above your minimum resale price. In most cases, set your resale price equal to or higher than your regular sale price. Otherwise, someone can buy your item and undercut you by selling it for less. ## When you resell an item When you edit a listing that contains resellable components from other creators, **Edit Listing** displays: - **Price** with a dynamic **Minimum S$...** label and a **?** button titled **Why is there a minimum price?**. - **On sansar.com:** Select **?** to open the **Minimum price** dialog: "This item contains resellable components and cannot be sold for less than their combined resale price." It shows columns for **Component**, **Creator**, **Resell price (S$)**, and **Total**. Select **Got it** to close it. - **Profit per sale:** displays your entered price minus component resale requirements, never shown below zero. If you type a price below the minimum, the page shows: "Price cannot be lower than S$... due to sub-component resale requirements." On a public Store listing, **Min. resale price** appears only when resale is enabled on that item. To view recorded payouts when someone sells an item containing your component, see [License payouts](/store/selling/view-your-sales#license-payouts). For how earned Sansar Dollars (S$) and payouts work, see [Cash out your earnings](/sansar-dollars/withdraw). ## Licensed and unlicensed items Items created before October 9, 2018 are _unlicensed_. Because they predate the resale feature, Sansar doesn't have the data needed to properly credit every creator whose work is in the item. Buyers can't resell unlicensed items in the Sansar Store. **Note:** You can't sell a combined item in the Sansar Store if any part of it is unlicensed. Items created _after_ October 9, 2018 are _licensed_. Sansar has tracked the data needed to pay commissions to all relevant creators whose work is in the item, along with their sale terms. Even if your item is licensed, you can still choose not to allow buyers to resell it. Source: https://docs.sansar.com/store/selling/allowing-resale-of-items --- # Buyers Permissions ## Buyer's Permissions ## Overview _Permissions_ allow you to set limits on what other people can do with the items you create. For example, if you plan to [sell an item in the Sansar Store](/store/selling/manage-listings.md), you can set some limits on the ways in which buyers can change the item. You can grant buyers _full permission_ to edit your item, which allows them to change everything about it, including its behavior, structure, and appearance. Alternately, you can grant buyers access to edit _property changes only_, which allows buyers to change only the properties you permit. You can set a resale price and receive commissions only with **Property Changes Only**. With **Full Permissions**, you receive no commission on resales of your item or sales of creations based on it. For details, see [Allowing resale of items](/store/selling/allowing-resale-of-items). ## Setting Buyer's Permissions on an item While editing a scene: * Make sure the Inventory panel is open. You can toggle it by choosing **Tools > Inventory** from the menu bar. * In the Inventory panel, right-click the object whose permissions you would like to set and choose **Buyer's permissions**.

Right-click the item in your inventory and choose Buyer's permissions.

*** * In the Buyer's Permissions panel, check the box next to either **Full Permissions** or **Property Changes Only**.

Check the box next to either Full Permissions or Property Changes Only.

*** * If you chose **Property Changes Only**, click the **Editable Properties** button: * For each sound, collision volume, or script [component](/create/world-editor/object-components.md) of the item, check the boxes next to the properties you would like to allow buyers to edit. For a list of editable properties for each type of component, see [Object Components](/create/world-editor/object-components.md). * You may click **All** or **None** to check or uncheck all the boxes, respectively. * Note that if your item does not contain any components (for example, a 3D model with no collision volume), it may have no editable properties and therefore no checkboxes appear. * Click **Ok** to return to the Buyer's Permissions panel.

The item in this example contains a sound, collision volume, and script component. If the item is sold in the store, buyers will be able to edit the properties whose boxes are checked but they cannot otherwise change the item.

*** * Click **Ok** to confirm the permissions you have set. Source: https://docs.sansar.com/store/selling/buyers-permissions --- # Hidden Store Listings > Create a hidden Store listing and copy its public link on sansar.com. ## Hidden store listings Use a _hidden_ listing in the Sansar Store to share an item with select people by direct URL without showing it in browsing or search results. Only someone ([or a script](/store/selling/selling-items-in-experience.md)) with the listing's direct URL can open it. For example, an interactive scripted object can use a hidden listing to sell or distribute items to visitors, or a creator can use hidden listings to offer select people exclusive access to certain items. **Caution:** Hiding a listing is not an access control. Anyone with the listing's URL can open it and share it with others. ## Creating a hidden listing **On sansar.com:** Create a hidden listing the same way you create any other listing, except for the final visibility step. Instead of selecting **List this item and make it available in the Sansar Store.**, select **List this item and make it hidden in the Sansar Store.**, then select **Save Changes**. Selecting the checkbox alone doesn't save the status. For full steps, including hidden listings, see [Selling items in the Sansar Store](/store/selling/manage-listings.md).
[Image: The two listing status checkboxes on Edit Listing, with List this item and make it hidden in the Sansar Store. selected]

Select List this item and make it hidden in the Sansar Store. when editing the listing, then select Save Changes.

## Getting the hidden listing's URL As the Store manager, you can share a hidden listing's URL with as few or as many people as you want. 1. **On sansar.com:** Sign in. Open [Manage Listings](https://www.sansar.com/store/dashboard) directly, or select your display name in the top bar (or open **Menu** on a phone) and select **Manage Listings**. 2. **On sansar.com:** Find the hidden listing on the **Listings** tab. If needed, open **All statuses** and select **Hidden** (filters apply only to the current page). 3. **On sansar.com:** Open the listing's **Actions** menu (**⋮**) and select **Edit**. 4. **On sansar.com:** Select **Copy public link** below the listing form to copy the URL. The button changes to **Copied!**. ## Using interactive objects to distribute items from hidden listings Once you have the URL, using an interactive object to distribute items from a hidden listing works the same way as with a public listing. See [Selling items inside an experience](/store/selling/selling-items-in-experience.md) for details on using pre-made Library scripts. Source: https://docs.sansar.com/store/selling/hidden-store-listings --- # Selling Materials ## What This Guide Covers This guide explains how to prepare and list materials for the Sansar Store. Material assets have three main permission states. These are shown by circles next to the asset icon in your inventory. The state may be inherited from the object the material was saved from, or set by the original creator.
[Image: Material permission types shown in inventory]

- Full Use - These materials can be edited, copied, pasted, and resold. - Resale may include a commission cost to the original creator. - If you are the owner, this state is commonly shown because you have full permission. - Partial Use - Some restrictions apply. - These materials may be unsellable or uneditable when added to objects. - This can also affect the settings of objects they are applied to. - Restricted Use - These materials cannot be edited or resold. - You cannot copy or paste these materials, only add them to an object. - They can block objects from being uploaded to the store. - They can lock the entire materials editing window so add carefully. ## Permissions and Resale When selling any asset, your permissions choice matters: - Buyer's permissions affect what buyers can edit after purchase. - If you want to support resale with commission behavior, review resale requirements before publishing. See: - [Buyers Permissions](/store/selling/buyers-permissions.md) - [Allowing Resale Of Items](/store/selling/allowing-resale-of-items.md) ## Legacy Caveats If your materials or source content come from older uploads or items bought before the update on March 3, 2026, keep these caveats in mind: - Saving a material from an object copies the license and settings of that object. - Example: if an object has a forced resale price of S$50, the textures and material slots can inherit that when reused on another object or a new listing. - If an object's materials are locked, you cannot save, copy, or paste those materials from or into the object. - Items created before 10 September 2018 may be treated as unlicensed legacy content. - Legacy unlicensed content cannot be resold by buyers in the Sansar Store. - If any part of a product depends on unlicensed legacy content, resale options may not be available. - You may need to rebuild and re-upload content as a newer listing if you want modern permissions and resale behavior. ## Listing Tips for Materials In your listing description, clearly state: - What map types are included in each material. - What kind of material or shader workflow the material is intended for. - Texture size (for example: 512, 1K, 2K, 4K). - Any important setup notes (for example, map intensity tuning or settings adjustments). - Whether the material is tileable and what it is intended for. - Make sure preview images reflect the actual in-scene material result. Follow: - [Store Listing Guidelines](/guidelines/store-listing-guidelines.md) ## Common Mistakes to Avoid - Unclear material naming that makes maps hard to identify. - Missing notes about included maps, channel packing, or intended map usage. - Overpromising quality that does not match the delivered material. - Uploading very large textures without a practical reason. - Skipping policy and permissions checks before listing. ## Importing This Asset Type To import this asset type, follow this guide: [Importing Materials](/create/import/importing-materials.md). ## Related Guides - [Selling items in the store](/store/selling/manage-listings.md) - [Supported file types - Texture Maps](/create/import/supported-file-types.md) - [Materials Editing and Shaders](/create/materials/materials-editing-and-shaders.md) - [Buyers Permissions](/store/selling/buyers-permissions.md) - [Allowing Resale Of Items](/store/selling/allowing-resale-of-items.md) - [Store Listing Guidelines](/guidelines/store-listing-guidelines.md) Source: https://docs.sansar.com/store/selling/selling-materials --- # Sansar Dollars > Buy, gift and cash out Sansar Dollars (S$). - [Buy Sansar Dollars](/sansar-dollars/buy) - [Cash out your earnings](/sansar-dollars/withdraw) - [Gifting Sansar Dollars](/sansar-dollars/gift) - [View your transaction history](/sansar-dollars/transaction-history) - [Subscriptions](/sansar-dollars/subscription-faq) ## See also - [Tipping at events](/events/tipping) Source: https://docs.sansar.com/sansar-dollars --- # Buy Sansar Dollars > Buy Sansar Dollars on sansar.com with a card, PayPal or your Steam Wallet, then spend them in the Sansar Store and in-world. Sansar Dollars (S$) are the currency you spend in the Sansar Store and in-world. You buy them on the **Buy Sansar Dollars** page at sansar.com and pay with a card, PayPal or your Steam Wallet. ## Before you start - **Sign in at sansar.com.** If you aren't signed in, you're asked to log in before you can buy. - **Find the page.** Any of these opens [Buy Sansar Dollars](https://www.sansar.com/account/sansar-dollars): - your S$ balance in the top bar (on narrow screens, open the menu first); - the account menu under your name, then **Buy Sansar Dollars** (on narrow screens, open the menu first; the links are listed under your name); - the sidebar of your account pages, then **Buy Sansar Dollars**. - **Have a way to pay.** You choose a card, PayPal or your Steam Wallet each time you buy, from the buttons on the page.
## Buy Sansar Dollars 1. Open [Buy Sansar Dollars](https://www.sansar.com/account/sansar-dollars). Your **Current balance** is shown at the top. 2. Under **Select an amount**, select a bundle. Each card shows the amount of S$ and its price. To buy a different amount, select the card that has an amount box. Click the card outside the box, because clicking in the box doesn't select it. 3. If you selected the card with the amount box, type the amount in its box. The card shows **Min 50 SSD**, so you can't buy fewer than 50 this way, and it shows the price for the amount you type. 4. Under **Choose payment method**, select **Pay with Card**, **Pay with PayPal** or **Pay with Steam Wallet**. The button changes to **Redirecting...** while checkout starts. 5. You're redirected to the payment provider to complete your purchase securely. Finish the payment there. The payment buttons appear only after you select an amount, and they stay unavailable while a custom amount is below the minimum. ## What happens next After checkout, your payment provider returns you to one of three purchase result pages on sansar.com: - **Purchase Complete!** says "Your Sansar Dollars have been added to your account." Select **Buy More** to buy again or **Browse the Store** to start shopping. - **Purchase Cancelled** says "Your payment was not processed. No charges were made." Select **Try Again** to go back to **Buy Sansar Dollars**. - **Purchase Failed** says "Something went wrong processing your payment." Select **Try Again**, and see [Purchase failed](#purchase-failed) below. Your balance appears in the top bar (on narrow screens, open the menu), on your **Account Dashboard** under **Balance**, and as **Current balance** on **Buy Sansar Dollars**. Purchases are listed in [Transaction History](https://www.sansar.com/store/transactions) (account menu, **Transactions**; on narrow screens, open the menu) with the type **Bundle** and the description "Sansar dollar bundle". ## Other ways to get Sansar Dollars - **Sell items in the Sansar Store.** The S$ you make from sales are [earned S$](/sansar-dollars/withdraw#earned-sansar-dollars), which you can [cash out](/sansar-dollars/withdraw). - **Receive gifts and tips** from other people. They show in [Transaction History](https://www.sansar.com/store/transactions) as **Gift** or **Tip**. - **Convert USD from your wallet.** If you have USD in your Sansar wallet, you can [convert it back to S$](/sansar-dollars/withdraw#convert-usd-back-to-sansar-dollars). ## If something goes wrong ### Checkout doesn't start If you see "Unable to start checkout. Please try again or contact support.", select the payment button again or try another payment method. If it keeps happening, email [support@sansar.com](mailto:support@sansar.com). If you see no payment buttons at all, select an amount first. If one button reads **Redirecting...**, checkout is starting; wait for it. If you're buying a custom amount and all three buttons are greyed out (none reads **Redirecting...**), the amount you typed is below the minimum shown on the card. Enter a larger amount. ### Purchase cancelled **Purchase Cancelled** means the payment wasn't processed and no charges were made. Select **Try Again** to start over. ### Purchase failed **Purchase Failed** means something went wrong processing your payment. If you weren't charged, select **Try Again**. If you were charged, email [support@sansar.com](mailto:support@sansar.com). ### Charged, but no Sansar Dollars Check your balance on your [Account Dashboard](https://www.sansar.com/account) and look for the purchase in [Transaction History](https://www.sansar.com/store/transactions). If you were charged and the S$ aren't in your balance, email [support@sansar.com](mailto:support@sansar.com). Source: https://docs.sansar.com/sansar-dollars/buy --- # Cash out your earnings > Convert the Sansar Dollars you earn from Store sales to USD, then withdraw them to your Stripe payout account. You can turn the Sansar Dollars (S$) you earn from selling in the Sansar Store into US dollars. There are three steps, each starting on sansar.com: convert your earned S$ to USD on **Currency Conversion**, set up a Stripe payout account, then request a withdrawal on **Withdraw USD**. The full rules are in the [Sansar Creator Rewards Program: Rules and Overview](https://www.sansar.com/account/creator-rewards). ## Earned Sansar dollars Earned S$ are the S$ you've made from selling items in the Sansar Store. Any S$ you get by converting USD back to S$ also count as earned S$. Only earned S$ can be converted to US dollars. S$ that you [buy](/sansar-dollars/buy) or receive as a gift aren't earned, and you can't convert them. When you spend S$, Sansar automatically spends your non-earned S$ first, before any earned ones. This keeps as much of your S$ as possible eligible for conversion. **Currency Conversion** shows your **Earned Sansar Dollars**, the amount you can convert, next to your **USD Wallet Balance**, the amount you can withdraw. ## Before you start - **Sign in at sansar.com.** **Currency Conversion** and **Withdraw USD** are account pages, so you're asked to log in first. The [Creator Rewards rules](https://www.sansar.com/account/creator-rewards) are public. - **Keep your account in good standing.** The program is for active Sansar accounts in good standing that follow Sansar's [Terms of Service](https://www.sansar.com/legal/terms-of-service). - **Have enough earned S$.** Only earned S$ convert to USD, and both converting and withdrawing have a minimum. See [Limits and fees](#limits-and-fees). - **Check the country list.** You set up your payout account for a country you pick from the **Country** list on **Withdraw USD**. You can only choose a country in that list. - **Know what you'll see.** The payout account setup, including **Reset Stripe Account**, appears on **Withdraw USD** only until your payout account is verified. The withdrawal amount box and **Request Withdrawal** stay unavailable until your payout account is verified and your USD wallet balance reaches the withdrawal minimum.
## Convert earned Sansar dollars to USD 1. Open [Currency Conversion](https://www.sansar.com/account/conversion) from the sidebar of your account pages. The **Sansar Dollars → USD** tab is selected. 2. Under **How many Earned Sansar dollars do you want to convert?**, enter a whole number of earned S$. The USD value appears below the box. If you enter an amount above zero but below the minimum, a message tells you the minimum. 3. Select **Convert**. 4. Your browser asks you to confirm the amounts. Confirm. When the conversion is done, you see "Transaction successful. You can proceed with a process credit request." The link in the message opens **Withdraw USD**. The page also reloads your balances: check that your **USD Wallet Balance** includes the converted amount before you request a withdrawal. ## Set up your payout account You do this once, before your first withdrawal. 1. Open [Withdraw USD](https://www.sansar.com/account/withdraw) from the sidebar of your account pages. The page heading reads **Process Credit Request**. 2. In the box that starts "To start receiving payouts, you will need to set up your payout account", open **Country** and select your country. 3. Select **Set Up Payout Account**. 4. You're taken to Stripe to complete the onboarding process. Follow Stripe's steps. Once your payout account is verified, the setup box no longer appears on **Withdraw USD**. You can request a withdrawal when your USD wallet balance reaches the [withdrawal minimum](#limits-and-fees).
## Request a withdrawal 1. Open [Withdraw USD](https://www.sansar.com/account/withdraw). Your **USD Wallet balance** is at the top. 2. Under **How many USD do you want to withdraw?**, enter an amount in US dollars. The minimum is shown under the box. If you can't type in the box, see [Request Withdrawal stays unavailable](#request-withdrawal-stays-unavailable). 3. Select **Request Withdrawal**. 4. Your browser asks you to confirm the amount. Confirm. You see "Withdrawal request submitted successfully." with the time it takes to review and process your request. ## What happens next - Sansar reviews your request, then processes it and pays out to your payout account. For how long that takes, see [Limits and fees](#limits-and-fees). - You can have one withdrawal processing at a time. After you submit a request, the confirmation replaces the withdrawal form. If you come back to **Withdraw USD** while that withdrawal is still processing, you see "You have a withdrawal currently being processed. Please wait for it to complete before requesting another." and **Request Withdrawal** stays unavailable. - Sansar can investigate any withdrawal request for possible fraud or abuse.
## Limits and fees | Limit or fee | Details | |---|---| | Exchange rate | 100 S$ = $1 USD | | Minimum conversion to USD | $200 USD (20,000 earned S$) each time you convert | | Minimum withdrawal | $200 USD, and your USD wallet balance must be at least $200 | | Processing time | Generally within 14 business days of your request (weekends and holidays don't count) | | Withdrawals in progress | One at a time | | Minimum conversion back to S$ | $1 USD | | Sansar fees | None. Sansar takes no additional fees or taxes from approved withdrawals | | Payment processing fees | Charged by third-party payment providers and deducted from the final amount; they vary by payment method | | Taxes | Reporting and paying any taxes that apply where you live is up to you | For the complete rules, read the [Sansar Creator Rewards Program: Rules and Overview](https://www.sansar.com/account/creator-rewards). ## Convert USD back to Sansar Dollars You can turn USD in your wallet back into S$ to use inside Sansar. Those S$ count as earned S$. 1. Open [Currency Conversion](https://www.sansar.com/account/conversion) and select the **USD → Sansar Dollars** tab. To go straight to the tab, use [Currency Conversion, USD → Sansar Dollars](https://www.sansar.com/account/conversion?tab=usd-to-ssd). 2. Under **How many USD do you want to convert to Sansar Earned Dollars?**, enter an amount in US dollars. The S$ value appears below the box. For the minimum, see [Limits and fees](#limits-and-fees). 3. Select **Convert to Sansar Dollars**. 4. Your browser asks you to confirm the amounts. Confirm. When the conversion is done, you see "Transaction successful." ## Reset your payout account **Reset Stripe Account** removes your Stripe payout account so that you can set it up again, for example with a different country. The button appears next to **Set Up Payout Account**, so you see it only while your payout account isn't verified. It's unavailable while you have a withdrawal being processed. It's also unavailable while your reset is being sent, when it reads **Deleting...**. Once your payout account is verified, you can't reset it on sansar.com. If you need help with a verified payout account, such as changing it, email [support@sansar.com](mailto:support@sansar.com). 1. Open [Withdraw USD](https://www.sansar.com/account/withdraw). 2. Select **Reset Stripe Account**. 3. Your browser asks "Are you sure you want to delete your Stripe payout account?" Confirm. You see "Stripe payout account has been removed." You can then select a country and **Set Up Payout Account** again. ## If something goes wrong ### Convert stays unavailable **Convert** stays unavailable until you enter an amount that meets the conversion minimum. If the amount is above zero but below the minimum, the page shows a message with the minimum. See [Limits and fees](#limits-and-fees). While a conversion is being sent, the button reads **Processing...**; wait for it to finish. ### Request Withdrawal stays unavailable **Request Withdrawal** stays unavailable when any of these is true: - Your payout account isn't verified yet: [set up your payout account](#set-up-your-payout-account) first. Until then, the amount box is unavailable too. - Your USD wallet balance is below the withdrawal minimum: [convert more earned S$](#convert-earned-sansar-dollars-to-usd) first. Until then, the amount box is unavailable too. - The amount you entered is below the withdrawal minimum, or more than your USD wallet balance. - You already have a withdrawal being processed. - Your request is being sent: the button reads **Processing...** until it's done. ### "Amount exceeds your USD wallet balance." The amount you entered is more than the USD in your wallet (the message appears when your balance is above zero). Enter a smaller amount, or convert more earned S$ first. ### "You have a withdrawal currently being processed." Wait for that withdrawal to finish before you request another one. ### A conversion, withdrawal or payout setup error You see one of these messages: - "Your conversion was unable to be processed at this time. Please try again or contact support." - "Your withdrawal request could not be processed at this time. Please try again or contact support." - "Unable to set up your payout account. Please try again or contact support." Try again. If it keeps happening, email [support@sansar.com](mailto:support@sansar.com). ### "Unable to delete your payout account." The message continues "You may have a withdrawal currently being processed." If you have one, wait until it's complete, then try **Reset Stripe Account** again. If it keeps happening, email [support@sansar.com](mailto:support@sansar.com). ### "Please select a country for your account." You selected **Set Up Payout Account** without choosing a country. Select your country under **Country**, then select **Set Up Payout Account** again. ### Your country isn't in the list You can set up a payout account only for a country in the **Country** list; the website offers no other countries. If you have questions, email [support@sansar.com](mailto:support@sansar.com). ### Your withdrawal hasn't arrived Check the processing time in [Limits and fees](#limits-and-fees). If that time has passed, email Sansar Support at [support@sansar.com](mailto:support@sansar.com). Sansar Support handles questions and issues about withdrawal requests. Source: https://docs.sansar.com/sansar-dollars/withdraw --- # Gifting Sansar Dollars ## Gifting Sansar dollars You can send Sansar dollars (S$) to other people in Sansar. You may wish to send someone Sansar dollars for services rendered, as a tip for a performance, or simply as a nice gift. There are currently two ways to initiate a gift transfer of Sansar dollars. ## Sending Sansar dollars to someone in the same scene If you would like to send Sansar dollars to someone who is nearby: 1. Click their avatar and choose **Send gift** from the options that appear. 2. In the Gift panel that appears, select an amount of Sansar dollars to send. Modify the amount by clicking the **-10**, **-1**, **+1**, or **+10** buttons to add or subtract the indicated number of Sansar dollars. 3. When you are satisfied with the total, click **Send Gift** to send the Sansar dollars. **Note:** If you do not have enough Sansar dollars to cover the amount you would like to send, you are prompted to [purchase Sansar dollars](/sansar-dollars/buy.md) to cover the transaction. This transaction can be completed within the Gift panel without disrupting your gifting process.

Click Send gift to open the Gift panel and initiate the transfer.

*** ## Sending Sansar dollars through the People app If you would like to send Sansar dollars to someone regardless of where their avatar is: 1. Open the [People app](/explore/social/people-panel.md) and find the person to whom you would like to send Sansar dollars, either on the **Nearby**, **Friends**, or **Search** tabs. 2. Once you find the person's name, click the **Send Gift** button next to their name. The Send Gift button looks like a dollar sign (**$**). 3. In the Gift panel that appears, select an amount of Sansar dollars to send. Modify the amount by clicking the **-10**, **-1**, **+1**, or **+10** buttons to add or subtract the indicated number of Sansar dollars. 4. When you are satisfied with the total, click **Send Gift** to send the Sansar dollars. **Note:** If you do not have enough Sansar dollars to cover the amount you would like to send, you are prompted to [purchase Sansar dollars](/sansar-dollars/buy.md) to cover the transaction. This transaction can be completed within the Gift panel without disrupting your gifting process.

Use the -10, -1, +1, and +10 buttons to adjust the amount of the gift before sending.

*** Source: https://docs.sansar.com/sansar-dollars/gift --- # View your transaction history > See the gifts and tips you've sent and received, the Sansar Dollar bundles you've bought and your event tickets on sansar.com. View **Transaction History** on sansar.com to see the gifts and tips you've sent and received, the Sansar Dollar (S$) bundles you've bought, and your event tickets. ## Before you start - **Sign in at sansar.com.** If you aren't signed in, opening **Transaction History** sends you to the login page first, then back. - **Know what appears here.** **Transaction History** lists successful gifts, tips, Sansar Dollar bundles, and event tickets. It doesn't list Store item purchases, Store sales, or currency conversions and withdrawals. ## View your transaction history 1. Open [Transaction History](https://www.sansar.com/store/transactions), or select your display name in the top bar on [sansar.com](https://www.sansar.com) and select **Transactions**. 2. Browse your transactions. The list shows up to 60 rows per page, with a count at the top. When you have more than one page, use **‹ Prev** and **Next ›** at the top, or **Previous**, page numbers, and **Next** at the bottom. When **...** appears at the bottom, select it to open **Go to page**, enter a page number, and select **Go**. Select **Back to top** to return to the top of the list. 3. Filter the current page by typing an item name, a person's name, or their Avatar ID in **Filter by name or person...**, or by selecting **Gifts**, **Tips**, **Bundles**, or **Tickets** from the **All types** menu. 4. Clear your filters by selecting the × in the box to erase your search text, or by selecting **Clear filters** to reset both filters. Filters only search the page you're currently on. To search transactions on another page, open that page and filter there. You can't export or download your transaction history. ## What each column shows - **Type**: **Gift**, **Tip**, **Bundle**, or **Ticket**. See [Gifting Sansar Dollars](/sansar-dollars/gift), [Tipping](/events/tipping), and [Buy Sansar Dollars](/sansar-dollars/buy) for how these work. - **Details**: - Gifts and tips show whether you sent or received Sansar dollars. The other person's display name (or Avatar ID) links to their profile; if their Avatar ID isn't available, the details say "someone". - Bundles show "Sansar dollar bundle". - Tickets show the item's name. - **Date**: the date of the transaction. - **Status**: the status of the transaction. - **Amount**: the amount for the transaction. Gifts, tips, and bundles appear with the S$ coin; gifts and tips you sent start with a minus sign (`-`). ## What isn't listed - **Store item purchases**: select **Purchases** in the account menu to open **My Purchases**. See [Redelivering Lost Purchases](/store/shopping/redelivering-lost-purchases). - **Store sales**: see [View your Store sales](/store/selling/view-your-sales). - **Currency conversions and withdrawals**: see [Cash out your earnings](/sansar-dollars/withdraw). ## On a phone or narrow screen Open **Menu** to find your display name and **Transactions**. If your transactions appear as cards instead of a table, each card shows the type and date on the first line, the details on the second line, and the status and amount on the third line. ## If something goes wrong - **You expect entries, but see "No transactions yet".** Reload the page. If your transactions still don't appear, [contact support](/help/contact-support). - **You see "No transactions match your filters on this page".** Filters apply only to the 60 rows on the current page. Adjust your filters, select **Clear filters**, or browse other pages. Source: https://docs.sansar.com/sansar-dollars/transaction-history --- # Subscriptions > Check whether subscription plans are available on sansar.com. No subscription plans are available on sansar.com. You can't start, change, or cancel a subscription plan there. For help with Sansar Dollars (S$), see: - [Buy Sansar Dollars](/sansar-dollars/buy) - [Cash out your earnings](/sansar-dollars/withdraw) - [View your transaction history](/sansar-dollars/transaction-history) If you have questions about a past subscription, [contact support](/help/contact-support). Source: https://docs.sansar.com/sansar-dollars/subscription-faq --- # Create > Build worlds: the world editor, importing world items, materials and shaders, lights, audio and video, Marvelous Designer and building with an AI assistant. Build a place for your friends, a home for your creations, or somewhere entirely new to explore. [Build worlds with an AI assistant](/create/ai/building-with-an-ai-assistant.md) to turn an idea into a world you can visit and share. Start with a copyable prompt and let your assistant use the tools included with Sansar. ## Worlds - [Quick start: Creating experiences in Sansar](/create/worlds/build-your-first-world) - [Creating a World](/create/worlds/creating-a-world) - [Creating Quests](/create/worlds/creating-quests) - [My Worlds Panel](/create/worlds/my-worlds-panel) - [Deleting an experience or scene](/create/worlds/deleting-a-scene) - [Deploying a new scene to an existing experience](/create/worlds/deploying-scene-to-experience) - [Editing a scene](/create/worlds/editing-a-scene) - [Experience memos](/create/worlds/experience-memos) - [Linking A Scene To A World](/create/worlds/linking-scene-to-a-world) - [Managing your scenes and worlds](/create/worlds/managing-scenes-and-worlds) - [Moderation Tools for World Owners](/create/worlds/moderation-tools-for-world-owners) - [Publishing Options for Your Experiences](/create/worlds/publishing-options-for-experiences) - [Renaming a scene](/create/worlds/renaming-a-scene) - [Saving and Building A Scene](/create/worlds/saving-and-building-scene) - [Sharing Your Experiences](/create/worlds/sharing-your-experiences) - [Create access links on sansar.com](/create/worlds/create-access-links) - [Visiting your own experience](/create/worlds/visiting-your-own-experience) ## AI building - [Build worlds with an AI assistant](/create/ai/building-with-an-ai-assistant) ## World editor - [Diagnostics Toolbar](/create/world-editor/diagnostics-toolbar) - [Object Stats Toolbar](/create/world-editor/object-stats-toolbar) - [Object Components](/create/world-editor/object-components) - [Parenting objects](/create/world-editor/parenting-objects) - [Scene Item Inventory](/create/world-editor/scene-item-inventory) - [Scene Objects Panel](/create/world-editor/scene-object-panel) - [Collision Volumes](/create/world-editor/collision-volumes) - [Scene Settings](/create/world-editor/scene-settings) - [System objects](/create/world-editor/system-objects) - [Object Motion Types](/create/world-editor/object-motion-types) See also: - [Keyboard shortcuts for editing a scene](/explore/controls/keyboard-shortcuts-scene) ## Importing - [Importing Items to Sansar](/create/import/importing-items) - [Supported file types](/create/import/supported-file-types) - [AABB Bounding Box and Item Restrictions](/create/import/aabb-bounding-box-and-item-restrictions) - [Importing World Items](/create/import/importing-world-items) - [Importing Collision Volumes](/create/import/importing-collision-volumes) - [Importing Materials](/create/import/importing-materials) - [Importing Custom Scripts](/create/import/importing-custom-scripts) - [Importing a Skybox](/create/import/importing-a-skybox) - [Troubleshooting Import Errors](/create/import/troubleshooting-import-errors) See also: - [Importing avatar items](/avatars/import/importing-avatar-related-items) ## Materials and shaders - [Materials editing and shaders](/create/materials/materials-editing-and-shaders) - [Shaders Information](/create/materials/shaders-information) - [Shader Lookup Table](/create/materials/shader-lookup-table) - [Automating Shader Setup](/create/materials/automating-shader-setup) - [Shader Scripting](/create/materials/shader-scripting) - [VAT Shader Basics](/create/materials/vat-shader-basics) - [VAT Technical Info](/create/materials/vat-technical-info) - [Displacement Guides](/create/materials/displacement-guides) - [Simple Displacement](/create/materials/simple-displacement) ## Lights - [Working With Lights](/create/lights/working-with-lights) - [Light Types](/create/lights/light-types) - [Global Illumination](/create/lights/global-illumination) ## Audio and video - [Working With Audio](/create/audio-and-video/working-with-audio) - [Creating Media surface](/create/audio-and-video/creating-media-surface) - [Streaming Web Audio](/create/audio-and-video/streaming-web-audio) - [Audio Emitter](/create/audio-and-video/audio-emitter) - [Sansar Audio FAQ](/create/audio-and-video/sansar-audio-faq) - [Using Media Streams](/create/audio-and-video/using-media-streams) - [Ambisonic Sounds](/create/audio-and-video/ambisonic-sounds) - [High Quality Spatial Audio](/create/audio-and-video/high-quality-spatial-audio) - [Audio Resource - Room Tones](/create/audio-and-video/audio-resource-room-tones) - [Previewing Audio and Video in a Scene](/create/audio-and-video/previewing-audio-and-video-in-a-scene) - [Using Audio Materials](/create/audio-and-video/using-audio-materials) ## Marvelous Designer - [Marvelous Designer Integration](/create/marvelous-designer/integration) - [Marvelous Designer Creator Resources](/create/marvelous-designer/creator-resources) - [Marvelous Import and Export](/create/marvelous-designer/import-export) - [MD Limitations](/create/marvelous-designer/limitations) Source: https://docs.sansar.com/create --- # Quick start: Creating experiences in Sansar **Note:** You must [install Sansar](/get-started/install.md) before continuing with the instructions in this article. Creator Quick Start Overview Create a new project * Launch Sansar and log into your account.

The Sansar login screen.

*** * Upon successfully logging in, the Atlas appears. Here, you see other creators' projects as well as your own published experiences. **All** shows all the experiences in the Atlas; **Sansar Studios** lists sample experiences for you to explore, and **My Experiences** is a quick way for you to easily find and visit your own creations. Click **Create** on the far right of the Atlas to open the My Experiences app.

The Atlas. Click Create to open the My Experiences app.

*** * Click **Create** in the My Experiences App to open the Experience Configuration dialog and begin creating a new Experience.

Click Create in the My Experiences app to begin creating a new experience.

* Give your new experience a name and select the **Base Template Layout** from the dropdown menu. Click the create button and your new project will be added to your My Experiences list. Feel free to experiment with other templates as well.

Selecting starting content for the experience.

*** * Click **Edit scene** for the newly created experience. This opens edit mode, allowing you to edit your scene.

Click the Edit Scene icon button to begin editing your experience's scene.

*** **Upload or purchase content for your scene** There are two ways you can acquire content to put into your scene: * [**Upload items to Sansar**](/create/import/importing-items.md) - You can [upload items](/create/import/importing-items.md) from your computer, such as 3D objects, sounds, scripts, and skyboxes. * [**Purchase items from the Sansar Store**](https://www.sansar.com/store) - The [Store](https://www.sansar.com/store) contains a wide array of content created by other Sansar users and is an excellent way to make and spend Sansar dollars (S$). **Intro to Inventory** * Click on the **Inventory** tab of the Inventory panel. Your asset should now be the first item on the list.

Your newly uploaded object should be the first item in the Inventory tab of the Inventory panel.

*** * To place your object into the scene, drag and drop them from the Inventory panel into the scene. See also [Adding objects to a scene](/create/world-editor/scene-item-inventory.md). **Build and visit your Experience** * Click the **Build** button to finalize your scene and prepare it for visitors. Depending on the complexity of your scene this could take anywhere from a few seconds to a minute or two.

The Build button.

*** * When the build process is complete you are asked if you would like to visit your scene or continue editing. If you choose to visit your scene, edit mode closes and you are taken to the "runtime" live version of your experience.

Visiting a scene with an interesting object.

*** **Publish your experience in the Atlas and share with friends** When you're ready to share your experience with others you can [publish your experience in the Atlas](/create/worlds/publishing-options-for-experiences.md), a collection of all the public experiences in Sansar.

While in edit mode, you can publish the experience to the Atlas by clicking Publish to Atlas. For more information on publishing an experience, see Publishing an experience to the Atlas.

*** You can also [share your experience with friends by sending them a URL](/create/worlds/sharing-your-experiences.md), regardless of whether your experience is published on the Atlas.
Source: https://docs.sansar.com/create/worlds/build-your-first-world --- # Creating a World This is a step-by-step walkthrough of how to create a new world: * In the main menu on the left-side of the screen, click **Create** to open the creation sub-menu. * In the sub-menu that appears, click **Build worlds**. This opens the [My worlds panel](/create/worlds/my-worlds-panel.md). * Press **Create** on the upper right corner of the panel to create a world.

Click Create to create a new world.

*** * This opens the **World Configuration** dialog. In the **Name the new world** input field, enter a world name for your new project.

The Choose starting content dropdown includes your own created scene templates in addition to the Sansar default scene templates.

*** * In the same dialog, click the **Choose starting content** dropdown to select from a list of scene templates. **Note:** You can choose one of your existing scenes as the starting content for the new world. This uses the existing scene as a starting template and allows you to experiment with the scene without affecting any other existing scenes or worlds. * The **Create** button is enabled once you have a world name and a scene template selected. Click **Create** to make your world and add it in the [My worlds panel](/create/worlds/my-worlds-panel.md), where you can access it at any time.
Source: https://docs.sansar.com/create/worlds/creating-a-world --- # Creating Quests ## Creating your own quests You can create your own [quests](/explore/quests.md) in Sansar, allowing others to track and complete a set of objectives you define. ## Creating a new quest To create a new quest: 1. Choose **Create > Create Quests** from the main menu to open the Quest Creator panel. 2. On the Quest Creator panel, click **New Quest**. 3. Enter a **Quest name**, up to 100 characters. 4. (Optional) Click **Browse** to select and upload a 400x192 thumbnail image for the quest. You can easily create an image by choosing **Socialize > Take a photo** from the main menu and choosing **For a Quest** from the dropdown menu in the screenshot tool. 5. (Optional) Enter a brief **Description** (up to 350 characters). This message is displayed to visitors when the quest is offered to them. 6. (Optional) Enter a brief **Summary** (up to 250 characters), to be displayed on the main tab of the Quests panel when you move your mouse cursor over the quest's thumbnail. 7. Enter a brief **Completion message** (up to 250 characters). This message is displayed to visitors who complete the quest. 8. Click **Save**. After saving the new quest, you may edit the name, image, description, and completion message at any time by clicking the **Edit** (pencil) button next to the quest's name. ## Adding objectives Immediately after creating a new quest, the quest's **Objectives** tab appears. You can use this tab to create and edit objectives within your quest: * Click **new** to create a new objective. * Enter an **Objective Name** (up to 200 characters). Try to make a short command such as: "Walk 50 meters" * (Optional) Enter a brief **Description** of the objective (up to 250 characters). This is a good place to add helpful hints or details about the quest. * (Optional) Enter a **Number of times this objective must be collected.** This is the number of times the objective must be collected before it is completed. Set to '0' for objectives that do not need to be collected multiple times.
* Set an **Initial State**: * **Active** - The objective is able to be completed. * **Locked** - The objective cannot be completed until it becomes unlocked (active). Usually, unlocking an objective requires the completion of prerequisite objectives. * Click **Save** to save the objective. * Continue adding new objectives until you have as many as you want for your request.

You can drag and drop quest objectives to re-order them on the Objectives tab.

*** ## Adding rewards You are not required to add rewards when setting up your quest; it is completely optional. To add a reward, click the **Rewards** tab of your quest to access the Rewards Menu. In order for an item to be eligible as a quest reward, it must meet the following conditions: * It must be an Accessory, Custom Avatar, or item of Clothing. * It must be in your avatar inventory. You can see your avatar inventory in the Character Editor. (You can open the Character Editor by choosing **Create > Style my avatar** from the main menu, then clicking **Customize**.) * You must own the proper license to distribute the item. If you can list the item in the Store, you can use it as a reward. (Note that you are _not_ required to list your item on the Sansar Store.) There are _Mandatory_ and _Choosable_ rewards. You can create a quest with just one type, both types or neither: * **Mandatory Rewards ("Assign a reward")**: These rewards will be given to the player upon quest completion. You can assign up to three mandatory rewards. * **Choosable Rewards ("Let the player choose a reward")**: The player is presented with two rewards and they must choose which one to receive. When setting up choosable rewards, you must assign two rewards as choosable options. If you only assign one reward, the choosable reward option will not be shown to the player. With up to three mandatory rewards and one choosable reward (out of a set of two), a quest can give out a maximum of four rewards. To add a reward to your quest: 1. Select one of the eligible items shown in the **Add reward** dropdown in one of the rows in the Rewards tab of the Quest Creator panel. The dropdown displays a list of all the items you own that are eligible. 2. On the next page, enter the **Name** and **Image** you want to use for the reward; by default, these fields are filled by the item's existing name and image. If you remove the image, the reward uses a default icon as its image. To delete a reward from a quest, select that reward and click the **Delete**, or click the **trash icon** for that reward from the Rewards tab of the Quest Creator panel. ## Setting up quest givers and objectives in a world ## Quest giver There are multiple ways to offer a quest to a visitor. In this example, we will create a clickable object that offers the quest when clicked: * Add an object to the scene to act as your quest giver. * Add a new script to the quest giver object by selecting it in the Scene Objects panel and choosing **Add > Script**
* In the object's Properties, under the script section (usually "Script 1" for new objects), choose **Quest Script Library** from the **Script** dropdown menu. * Choose **Quest Giver Interaction** from the dropdown that appears below Quest Script Library. * From the **Quest** dropdown, select the quest you have created.

Parameters of the Quest Giver Interaction script in the Quest Script Library. Select your quest from the dropdown under the Quest parameter.

*** ## Quest objectives Quest objectives can be completed in various ways. In this example, we will allow visitors to complete an objective by interacting an object in your world. To add an interactive quest objective object to your scene: 1. Add an object to the scene to act as the quest objective. 2. Add a new script to the object by selecting it in the Scene Objects panel and choosing **Add > Script**
1. In the object's Properties, under the script section (usually "Script 1" for new objects), choose **Quest Script Library** from the **Script** dropdown menu. 2. Select **Quest Objective Interaction** from the dropdown that appears below Quest Script Library. 3. From the first **Objective** dropdown, select the quest you have created. 4. From the second **Objective** dropdown, select the objective you would like visitors to complete with this interaction.

Parameters of the Quest Objective Interaction script in the Quest Script Library. Select your quest from the first dropdown under Objective, then, in the second dropdown, select the objective to be completed.

*** ## Testing your quest To test a quest you have created: * Save and build the scene containing your quest giver and objectives. * Visit the scene. * Interact with the quest giver object, which should offer you the quest. * Accept the quest by clicking **Start the quest**. * Interact with a quest objective object to complete the objective. * Upon completing the quest, accept the completion confirmation.

When the quest giver offers you a quest click Start the quest to accept.

***

When you complete the quest, click Complete Quest to confirm the quest's completion.

*** ## Resetting quest progress You can reset progress on quests that you own by using the Quest Creator panel: * Choose **Create > Create Quests** to open the Quest Creator panel. * Click the name of the quest you would like to reset. * On the quest's **Objectives** tab, click **Reset Quest** to reset your progression through the quest objectives.

Click Reset Quest on the Objectives tab of the Quest Creator panel to reset your current progress on the quest.

Source: https://docs.sansar.com/create/worlds/creating-quests --- # My Worlds Panel The _My Worlds_ panel is the hub for creating and modifying all of your scenes and worlds in Sansar. For more information, see [Creating and managing your Scenes and Worlds](/create/worlds/managing-scenes-and-worlds.md).

My Worlds Panel

*** ## Accessing the My Worlds panel You can launch the My Worlds panel through [the Main Menu](/explore/main-menu.md) on the left-hand side of the screen. On the main menu, click **Create** to open the creation sub-menu. In the sub-menu that appears, click **Build worlds** to open the My Worlds panel. See [The main menu](/explore/main-menu.md) for more information.
Source: https://docs.sansar.com/create/worlds/my-worlds-panel --- # Deleting an experience or scene To delete an experience or a scene: 1. Go to the [My Experiences app](/create/worlds/my-worlds-panel.md). 2. Select the experience, scene, or the experience with a linked scene that you want to delete. 3. Click **More Options** for that scene or experience in the My Experiences app, which opens a popup menu. 4. In the popup menu, select **Delete experience/scene**. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------- | | Click **Delete experience/scene**. | 5. This opens a dialog which prompts you to chose what to delete. Open the dropdown menu to choose from the following options: * Both experience and scene * Experience only * Scene only | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------- | | Choose what to delete. | 6. Click **Delete** to confirm. **Note:** You cannot delete an experience or scene if the experience or scene is currently being edited. What happens when an experience or scene is deleted Deleting a scene or experience is permanent and cannot be undone. Below is a list of results when any of the following delete options is selected: * **Both experience and scene** - The experience will no longer be visitable and all Atlas info is deleted. The scene and its content are also deleted. The scene template will no longer be useable for other experiences. **Note:** Always check if you no longer need a scene template, if the scene is not used in any experiences, or that an experience is not linked anywhere else. Once an experience or scene has been deleted, it can no longer be restored nor used. * **Experience only** - The experience will no longer be visitable and all Atlas info is deleted. The scene is not deleted and can still be edited or linked to another experience if desired. **Note:** Unlinked scenes are listed at the bottom of the My Experiences app. * **Scene only** - The scene and its content are deleted. The scene is no longer usable as a template for other experiences. The experience remains with no scene and a new scene must be linked to the experience. Source: https://docs.sansar.com/create/worlds/deleting-a-scene --- # Deploying a new scene to an existing experience By _deploying_ a scene, you can [link a copy](/create/worlds/linking-scene-to-a-world.md) of the scene from any experience in your My Experiences panel to any other experience you own. For example, you can experiment with an unpublished "draft" copy of one of your existing experiences, and only deploy the changes to the published, "live" experience once you are satisfied with the results. Deploying a scene To deploy a copy of a scene from one experience to another, you must have already created at least two experiences: 1. Open the My Experiences panel by choosing **Create > Build experiences** from the main menu. 2. Find the experience you would like to _deploy_ (copy), and choose **... > Deploy scene**. 3. In the panel that appears, choose a name for the new copy of the scene that will be created. If you plan to update this experience regularly, you may wish to include an identifier such as a date or version number in the scene name. 4. From the dropdown menu under **Move the scene copy into this experience**, choose one of your existing experiences to receive the scene. 5. Click **Deploy** to copy the scene and replace the existing scene in the selected experience. The existing scene becomes [_unlinked_](/create/worlds/linking-scene-to-a-world.md) but is not deleted when the new copy is deployed. The copied scene is not affected. | ![My Experiences Deploy Scene](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | To deploy a copy of a scene from one experience to another, choose **... > Deploy scene**, choose a name for the new (copied) scene, and choose an experience to receive the deployed copy. Click **Deploy** to complete the process. | Source: https://docs.sansar.com/create/worlds/deploying-scene-to-experience --- # Editing a scene **Edit a scene from the My Experiences App** To edit a scene from the My Experiences App: * Go to the [My Experiences app](/create/worlds/my-worlds-panel.md). * Select the scene or the experience with the scene that you want to edit. * Click **Edit Scene** for that scene or experience. * Once clicked, Sansar takes you to a new interface where you can edit your scene.

The scene editor

*** * Once you are in edit mode, you can start [adding objects in a scene](/create/world-editor/scene-item-inventory.md). See our [Quick start: creating experiences for Sansar](/create/worlds/build-your-first-world.md) for a quick start guide to creating an experience using Sansar. Edit a scene from the App Launcher When you are visiting one of your created experiences, an additional button is added on the App Launcher. 1. Look at the App Launcher, which can be found on the right-hand side of the interface. 2. Click the **Edit Scene** button to enter Edit Mode. **Note:** If you are visiting another creator's experience, you can click **My Experiences** to launch the My Experiences app.
Source: https://docs.sansar.com/create/worlds/editing-a-scene --- # Experience memos Memos are notes that experience creators can tie to their experiences. You can write notes to track your latest changes, access controls, and anything you see fit. Some additional details on memos: * Memos are linked to individual experiences, which means that memos cannot be added to scenes that are not tied to an experience nor to events on the calendar. * Supports up to 511 characters. * Only the creator of the experience may view the memo. | ![](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------- | | You can add notes on your experiences by creating memos. | To create a memo: 1. Open up the **My Experiences** panel. 2. Hover over the experience you want to create a memo for and click the **More options…** button. 3. Click on **Edit memo…**. 4. You can view and edit the memo on this window. 5. Click **Save** to save your changes. 6. There should now be a new **View Memo** field in the experience details on the My Experiences App. | ![](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------- | | Click on **Edit memo...** to write or view a memo. | To view a memo: * You can view your memo for that experience by clicking on that **View Memo** button. * Alternatively, you can follow the same steps to create a memo above to view the memo. | ![](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------- | | You can view memos by clicking on **View Memo** or **Edit Memo...** | Source: https://docs.sansar.com/create/worlds/experience-memos --- # Linking A Scene To A World ## Linking a scene to a world It is possible to link an existing world to a different scene template after the world has been created or after a linked scene is deleted from the world. This can be used to easily update, back up, or completely change the content of a world without breaking existing links to the world or needing to publish a new world. ## Linking a scene To link an existing world to a new scene layout: 1. Go to the [My Worlds panel](/create/worlds/my-worlds-panel.md). 2. Select the world that you want to link a scene to. 3. Click **More Options** for that world, which opens a popup menu. 4. In the popup menu, choose **Link to another scene**. | ![Link to new scene](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------- | | Select **Link to another scene**. | 5. This opens a dialog where you can link your world to a new scene template. From the dropdown menu, choose a new scene template or choose 'no scene' if you want to unlink the current scene from the world. | ![](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------ | | Choose a scene from the dropdown menu. | 6. Once you selected a scene to link, click **Replace** to change the scene template linked to the world you are managing. | ![](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------ | | Click **Replace**. | ## Scene template tags Here is a list of tags that may be attached to your scene template in the scene dropdown menu: * (unpublished) - The selected scene must first be built before it can be used in a world. You can [build your scene](/create/worlds/saving-and-building-scene.md) in the Scene Editor. * (in use) - If you choose a scene that is already linked to another world, the scene is reassigned to the new world and is unlinked from the older world. * (current) - The selected scene is the currently linked scene for this world. * _no tag_ - Unused scenes have no tags attached to the scene in the dropdown menu. **Notes:** * You can not link a world to a scene template that is currently being edited. To link a world to that scene, simply leave the scene that is being edited. * A world can only be linked to one scene at a time. However, it is possible to teleport between worlds using URLs and [teleport scripts](/scripting/guides/configuring-teleport-scripts.md) in order to transition from one scene to another without visiting the Prime Portal or using the Codex. * Likewise, each scene can only be linked to one world at a time, but you may make a copy of a scene template by [creating a new world](/create/worlds/creating-a-world.md) using the scene as the starting content. * If you attempt to link a second world to a scene, the first world becomes unlinked in favor of the new world. Source: https://docs.sansar.com/create/worlds/linking-scene-to-a-world --- # Managing your scenes and worlds Worlds vs. scenes A _scene_ is a virtual space that you have created in Sansar, which includes the ground, sky, and any imported content that you have laid out in the scene. When a user visits your world, your edited scene is what they see and explore. A scene on its own cannot be visited unless it is linked to a world. A _world_ represents the unique address pointing to a particular scene, which lays out the space that visitors see when they visit your world. A world becomes visitable when it is published in the [Codex](/explore/codex.md), which is a public listing of worlds in Sansar, or by sharing the world's URL with other Sansar users. **Note:** Each scene can only be linked to one world at a time, and each world can only be linked to one scene at a time. However, it is possible to teleport from one world to another by using an appropriate [teleport script](/scripting/guides/configuring-teleport-scripts.md) and [world URL](/create/worlds/sharing-your-experiences.md). Managing your scenes and worlds As a world creator, you will likely be spending a lot of time in Sansar with the [My Worlds panel](/create/worlds/my-worlds-panel.md) and the edit mode interface. Both the [My Worlds panel](/create/worlds/my-worlds-panel.md) and edit mode provide a variety of actions to help you manage your scenes and worlds: * [Create a world](/create/worlds/creating-a-world.md) * [Edit your scene](/create/worlds/editing-a-scene.md) * [Save and build your scene](/create/worlds/saving-and-building-scene.md) * [Visit your own world](/create/worlds/visiting-your-own-experience.md) * [Publish a world in the Atlas](/create/worlds/publishing-options-for-experiences.md) * [Link a new scene to a world](/create/worlds/linking-scene-to-a-world.md) * [Rename a scene](/create/worlds/renaming-a-scene.md) * [Delete a world and/or scene](/create/worlds/deleting-a-scene.md) * [Share your worlds](/create/worlds/sharing-your-experiences.md)
Source: https://docs.sansar.com/create/worlds/managing-scenes-and-worlds --- # Moderation Tools for World Owners As a world owner in Sansar, you have access to powerful moderation tools that help you maintain a positive environment in your worlds. These tools allow you to manage who can visit your world, remove disruptive users, and enforce your community standards. **As a world owner, you are responsible for moderating your own worlds. Sansar staff intervene only in extreme cases or violations of Sansar's [Terms of Service](https://www.sansar.com/legal/terms-of-service).** This guide covers the moderation capabilities available to world owners, including: - In-world chat commands for managing users - UI options for some commands - Permanent banning through the ban list - Access control settings to restrict who can visit your world **Note:** These tools complement the [basic moderation tools](/safety/blocking-avatars.md) available to all Sansar users. ## Quick Command Reference World owners can use these commands in [Nearby Chat](/explore/social/chat-panel.md) while visiting their world:
| Command | Usage Example | Description | |---------|-------|-------------| | `%%who` | `%%who` | Shows all users currently in the world | | `%%roles` | `%%roles` | Shows your role (staff/world owner) | | `%%kick ` | `%%kick User-1234` | Kicks a user from the world | | `%%mute ` | `%%mute User-1234` | Temporarily switches off a user's mic | | `%%mega-on ` | `%%mega-on User-1234` | Gives megaphone to a user | | `%%mega-off ` | `%%mega-off User-1234` | Removes megaphone from a user | | `%%broadcast-on ` | `%%broadcast-on User-1234` | Turns on broadcasting (shows avatar across instances) | | `%%broadcast-off ` | `%%broadcast-off User-1234` | Turns off broadcasting | | `%%backpack-on` | `%%backpack-on` | Enables backpack for all users (overrides world settings) | | `%%backpack-off` | `%%backpack-off` | Disables backpack for all users (overrides world settings) | | `%%backpack-clear` | `%%backpack-clear` | Removes all backpack items spawned by all users | | `%%muteall [seconds]` | `%%muteall 20` | Locks mics for all users unless they have megaphone (optional time delay) | | `%%unmuteall [seconds]` | `%%unmuteall 20` | Unlocks mics for all users (optional time delay) | **Important:** Commands only work in [Nearby Chat](/explore/social/chat-panel.md) and must be used while you're visiting your world. They cannot be triggered in private chat or from outside the world. ## Checking Your Permissions To verify your moderation permissions, type `%%roles` in Nearby chat. This displays your current role (such as "world owner" or "staff"), confirming which moderation commands you have access to. ## Understanding Kick vs. Ban Before using moderation tools, it's important to understand the difference between kicking and banning: - **Kicking** removes a user from your world immediately, but they can return at any time - **Banning** prevents a user from entering your world, but doesn't automatically kick them if they're already present - **Best practice:** Add abusive users to the ban list before kicking them to prevent them from immediately rejoining ## Finding Users in Your World ### To get a list of users in chat To see a list of who is currently in your world, type `%%who` in [Nearby Chat](/explore/social/chat-panel.md). This displays the Avatar IDs of all users currently present, which is helpful for determining who to kick, ban, or grant access to. ### To see a list of users in the Nearby Panel Open the **Socialize** panel from the Main Menu, select **Friends & People**, then select the **Nearby** tab. The name with the @ symbol is the one you want to use with the commands, but the symbol itself is not needed.
## Kicking Users from Your World As a world owner, you can remove users who are causing disruption or violating your world's rules. **Important: For repeat offenders, add them to the ban list before kicking to prevent them from immediately rejoining.** ### Via chat command 1. While visiting your world, open [Nearby Chat](/explore/social/chat-panel.md) 2. Type `%%kick ` where `` is the user's [Avatar ID](/account/avatar-name-id.md) - Example: To kick a user with Avatar ID @User-1234, type `%%kick User-1234` 3. Press Enter to execute the command The user is immediately removed from the world but is NOT banned and can return. **Important notes:** - Always use the Avatar ID (not the Avatar Name) when kicking users. For more information, see [Avatar Name and Avatar ID](/account/avatar-name-id.md) - You cannot kick yourself or Sansar Staff - Only the world owner can kick users; visitors cannot use this command - Kicked users receive a notification that they were removed from the world ### Via UI button 1. Open the **Socialize** panel from the Main Menu, select **Friends & People**, then select the **Nearby** tab 2. Click a user's name to open their profile window 3. As the world owner, you will see a **Kick** button in the profile window 4. Click the **Kick** button to remove the user
### What happens when a user is kicked The user is instantly teleported out of the world and sees a message indicating they were removed by the world owner. However, they can still return to your world at any time unless you add them to the ban list. ## Managing User Audio World owners have several commands to control audio in their worlds: ### Muting Individual Users The `%%mute` command temporarily turns off a specific user's microphone. They can turn it back on themselves. **Note:** Unlike `%%muteall`, the `%%mute` command only temporarily turns off a user's microphone. They can turn it back on themselves. For locked muting during events, use `%%muteall` instead. #### Via chat command Type `%%mute ` in Nearby chat. For example, `%%mute User-1234` will switch off the microphone for the user with Avatar ID @User-1234. #### Via UI button 1. Open the **Socialize** panel from the Main Menu, select **Friends & People**, then select the **Nearby** tab 2. Click a user's name to open their profile window 3. As the world owner, you will see a **Mute** button in the profile window 4. Click the **Mute** button to turn off their microphone
### Muting All Users The `%%muteall` command **locks** microphones for all users in the world, except those who have been given a **megaphone**. This is useful for controlling audio during presentations or events. Users will not be able to turn their own mics on until the unmute command has been sent. **To mute all users:** - Type `%%muteall` in the nearby chat to mute everyone immediately - Or add a time delay: `%%muteall 20` will mute all users after 20 seconds ### Unmuting All Users The `%%unmuteall` command unlocks microphones for all users in the world. **To unmute all users:** - Type `%%unmuteall` in the nearby chat to unmute everyone immediately - Or add a time delay: `%%unmuteall 20` will unmute all users after 20 seconds ## Megaphone Control The megaphone allows specific users to speak even when `%%muteall` is active, making it ideal for event hosts or speakers. They can also be heard across the entire scene by everyone. ### Via chat command **To give a user megaphone privileges:** - Type `%%mega-on ` (example: `%%mega-on User-1234`) **To remove megaphone privileges:** - Type `%%mega-off ` (example: `%%mega-off User-1234`) ### Via UI button 1. Open the **Socialize** panel from the Main Menu, select **Friends & People**, then select the **Nearby** tab 2. Click a user's name to open their profile window 3. As the world owner, you will see **Mega On** and **Mega Off** buttons in the profile window 4. Click **Mega On** to give megaphone privileges or **Mega Off** to remove them
## Broadcasting Controls Broadcasting makes a user's avatar visible across all instances of your world simultaneously, which is useful for event hosts or performers who need to be seen by everyone. **To enable broadcasting for a user:** - Type `%%broadcast-on ` (example: `%%broadcast-on User-1234`) **To disable broadcasting for a user:** - Type `%%broadcast-off ` (example: `%%broadcast-off User-1234`) ## Backpack Management World owners can control backpack access for users, which is helpful for managing when they can spawn items in your world. If you previously turned off or on your visitor backpack in your [Scene Settings](/create/world-editor/scene-settings.md), you can temporarily enable or disable it during runtime. ### Enabling/Disabling Backpack #### Via chat command **To enable backpack for all users:** - Type `%%backpack-on` in nearby chat - This turns on the backpack even if the world has it disabled in settings **To disable backpack for all users:** - Type `%%backpack-off` in nearby chat - This turns off the backpack even if the world has it enabled in settings ### Clearing Spawned Items #### Via chat command - Type `%%backpack-clear` in nearby chat - This removes all backpack items that all users have spawned in the world #### Via UI button Open your own backpack. As a world owner, you'll see three buttons at the top: - **Remove All From World** - Removes all backpack items spawned by all users (same as `%%backpack-clear`) - **Remove All** - Removes only your own spawned items - **Remove Last** - Removes the last item you spawned
## Banning Users from Your World The ban list provides permanent protection by preventing specific users from entering your world. Users on the ban list cannot visit your world even if they have the direct link. **To ban a user:** 1. Open the [Build Worlds](/create/worlds/my-worlds-panel.md) panel
2. Locate the world you wish to add someone to the ban list of and click the **Publishing options** button
3. Under [Who can visit](/create/worlds/publishing-options-for-experiences.md#who-can-visit), click **Edit list** next to **Banned users are never allowed to visit.**
4. In the Edit ban list panel, click **Add**
5. Type the user's full Avatar ID in the Add Someone panel and click **Search**. This is the name that appears in the Nearby users list and the **%%who** command results.
6. Select the correct user from the search results and click **Add selected** 7. Repeat steps 4-6 to add additional users to the ban list 8. Click **Done** to close the Add Someone panel 9. Click **Save** to save your changes ## Unbanning Someone from Your World To unban someone, follow the previous steps 1-4 to access the ban list. Select a name from the list and click **Remove**. Make sure to click **Save**, then **Done**.
**Important notes:** - You can add or remove users from the ban list at any time through the My Worlds panel - Adding a user to the ban list does not automatically kick them if they're currently in your world. You will need to use the kick moderation tools to remove them. - Banned users who attempt to visit your world see a message indicating they don't have access when they try to join. **What happens when a user is banned:** If a banned user attempts to visit your world, they receive a message stating they are not allowed to visit. They cannot enter the world through the Codex, direct links, or any other method. ## Restricting Access to Your World Beyond banning specific users, you can control who has access to your world using the Who can visit tab in the Publishing options of the [My Worlds panel](/create/worlds/my-worlds-panel.md).
**Access control options:** - **Everyone** — Anyone except banned users - **Only me and the following** — Select **Friends**, **Guest list**, or both - **Only me** — Only you **Publishing vs. Access Control:** Your world's visibility is determined by both its publishing status and access controls: - **Published worlds** appear in the Codex, but only to users who meet your access requirements, as an example even if your world is published but you have it set to **'guest list'** only people added to the list will be able to find it on their codex. - **Hidden worlds** don't appear in the Codex but can still be accessed via direct link by users who meet your access requirements You can change these settings at any time through the My Worlds panel. ## Best Practices for World Moderation To maintain a positive environment in your world, consider these moderation tips: 1. **Set clear expectations** - Communicate your world's rules to visitors. 2. **Use progressive discipline** - Consider warning users before kicking them for minor infractions. 3. **Ban before kicking** - For repeat offenders, add them to the ban list before kicking to prevent immediate return. 4. **Document incidents** - Keep notes on problematic users and incidents for your records. 5. **Review your ban list periodically** - Consider whether banned users should remain on the list over time. 6. **Use access controls proactively** - For private events, use the guest list feature to prevent disruptions. 7. **Encourage visitors to use their own moderation tools** - Your visitors have their own ability to block and mute others for themselves. ## Troubleshooting **Command not working:** - Verify you're using Nearby Chat (not private chat) - Confirm you're currently visiting your world - Check that you're using the correct command syntax - Ensure you're using the Avatar ID, not the Avatar Name **Can't find a user's Avatar ID:** - Use the `%%who` command to list all users currently in your world - Check the [People panel](/explore/social/people-panel.md) and click on their name to reveal their Avatar ID - See [Identifying and interacting with avatars](/explore/social/identifying-interacting-with-avatars.md) for additional methods - Use the player search box in the People and Friends panel **User keeps returning after being kicked:** - Add the user to your ban list to prevent them from re-entering your world - See [Banning users from a world](#banning-users-from-your-world) above for instructions **Need to report serious violations:** - For serious violations of Sansar's Terms of Service, report the user through Sansar's official reporting channels in addition to using your world moderation tools - To report abuse in Sansar, see [Reporting abuse](/safety/reporting-abuse). To block someone, see [Blocking avatars](/safety/blocking-avatars). Source: https://docs.sansar.com/create/worlds/moderation-tools-for-world-owners --- # Publishing Options for Your Experiences ## Publishing options for experiences An experience's Publishing options panel allows you to define who can visit the experience, and allows you to enter the experience's [Codex](/explore/codex.md) listing information. ## Opening the Publishing options panel The Publishing options panel can be opened from two locations: ## From the My Experiences panel 1. While in the [Atlas app](/explore/codex.md), click **Create** to open the My Experiences panel. You may also access **My Experiences** from the App Launcher while visiting or editing an experience. 2. Under your chosen experience in the My Experiences panel, click the **Publishing options** button. ## While editing an experience When editing an experience, click the **Publish** button on the toolbar to open the Publishing options panel. | **Publish** button | | ------------------------------------------------------------------------------------------------------------------ | | Click the **Publish** button to open the Publishing options panel. | ## The Publishing options panel The Publishing options panel contains two tabs: **Who can visit** and **Atlas listing**. Each panel contains important settings that allow you to control access to your experience and help others find it, respectively. ### Who can visit | ![Publishing options Who can visit](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | The **Who can visit** tab of the Publishing options panel. | The **Who can visit** tab allows you to control who is allowed to visit your experience. The dropdown menu allows you to choose from the following options: * **Everyone** - Anyone can visit the experience, as long as they have not been banned. * **Only the following** - Allows you to select the checkboxes next to **Friends** and [**Guest list**](/create/worlds/publishing-options-for-experiences.md#editing-the-guest-list-and-banned-list) to allow your friends or specifically allowed guests, respectively. * **Only me** - Only you are allowed to visit the experience. [Banned users](/create/worlds/publishing-options-for-experiences.md#editing-the-guest-list-and-banned-list), defined in the list your provide, are never allowed to visit your experience. | ![Private experience listing](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | If you have set your experience to only allow **Friends** or a **Guest list**, an icon appears on the experience's Atlas image to indicate that the experience is open to Friends or guests only. | ### Editing the guest list and banned list To add someone to the guest list or banned list: 1. Click **Edit list** next to **Guest list** or **Banned users are never allowed to visit**. 2. In the Edit Guest List or Edit Ban List panel, click **Add**. 3. In the Add Someone panel, type the user's full [Avatar ID]) and click **Search**. 4. Select a name from the search results and click **Add selected**. 5. Repeat as many times as you like until all guests or banned users are added. 6. Click **Done** to close the Add Someone panel. 7. Click **Save** to save your list and close the Edit Guest List or Edit Ban List panel. To remove someone from the guest list or banned list: 1. Click **Edit list** next to **Guest list** or **Banned users are never allowed to visit**. 2. In the Edit Guest List or Edit Ban List panel, select a name and click **Remove**. 3. Click **Save** to save your list and close the Edit Guest List or Edit Ban List panel. ### Atlas listing information | ![Publishing options Atlas listing](/media/screenshot-pending.svg) | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | The **Atlas listing** tab of the Publishing options panel. | The **Atlas listing** tab allows you to name your experience and provide a brief description and image for the [Codex](/explore/codex.md). On this tab, you can provide the following listing information: * **Hide this experience from the Atlas** - If selected, this experience does not appear in the [Codex](/explore/codex.md). Depending upon the options you selected on the **Who can visit** tab, you can still invite users to your experience by providing them with a [direct URL](/explore/codex.md). * **Experience name** - Choose an appropriate name for your experience. Note that changing this name also changes the experience's URL, which can cause the previous URL to stop working. However, [changing the name of the scene](/create/worlds/renaming-a-scene.md) that the experience is linked to does not change the URL. * **Description (required if published in Atlas)** - Enter a brief description of the experience in the Description field. If you wish to include any tags, such as "Work in progress" or a last-updated timestamp, we recommend placing them in the description rather than the title. That way, when a tag is removed or changed the experience URL is unaffected. * **Image (required if published in Atlas)** - Select an appropriate image to represent your experience and draw the attention of potential visitors. Make sure to follow the guidelines set forth in the [Atlas Publishing Guidelines](/guidelines/world-publishing-guidelines.md). Source: https://docs.sansar.com/create/worlds/publishing-options-for-experiences --- # Renaming a scene To rename a scene template: 1. Go to the [My Worlds panel](/create/worlds/my-worlds-panel.md). 2. Select the world with the scene that you want to rename. 3. Click on the **More Options** button for that world, which opens a popup menu. 4. In the popup menu, select the **Rename scene** button. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------- | | Select **Rename scene** from the **More Options** button/dropdown. | 5. This opens a dialog where you can rename the scene. Type the new name you want to use for your scene. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------- | | The rename scene dialog. | 6. Click the **Rename** button to confirm the change. **Notes:** * Scene names are only visible to you in the My Worlds panel. A world always references the world name in the URL and in the Atlas. * Renaming a scene does not affect the world URL, but renaming the world _does_ change the world URL. To rename a world rather than a scene, see [Adding information about your world](/create/worlds/publishing-options-for-experiences.md). Source: https://docs.sansar.com/create/worlds/renaming-a-scene --- # Saving and Building A Scene ## Saving and building your scene As a world creator, you will spend a lot of time within the Scene Editor, where you can edit your scene and populate it with content. This article focuses on the three action buttons on the scene toolbar found within the Scene Editor that allows you to:

When editing a scene, the toolbar gives you the option to Save, Build and Publish.

*** ## Save your progress The **Save** button allows you to save your most recent changes in your scene. We highly encourage you to save your progress frequently to avoid losing your changes. **Note:** Saved changes are not automatically pushed out to the live version of your scene. You must build your scene first before it can be visited. ## Build your scene Building the scene is an important step in creating your world and enabling it to be visited and shared. When you click **Build**, Sansar creates a live version of the scene with the most recent changes. Things to remember when building your scene: * If you want to test your scene, make sure to hit the **Build** button so that you can visit the scene and check your changes. * When you press **Build** on a world that is currently published, the new changes are automatically pushed out and become the version that visitors see when they visit your world. **Note:** A scene needs to be linked to a world in order to visit it. ## Publish your world If you want to share your creation publicly, you can publish it. See [Publishing options for worlds](/create/worlds/publishing-options-for-experiences.md) for more information.
Source: https://docs.sansar.com/create/worlds/saving-and-building-scene --- # Sharing Your Experiences ## Sharing your experiences ## Publish your experience in the Atlas You can share your experiences with a wider audience by publishing your experience in the [Codex](/explore/codex.md). See [Publishing an experience in the Codex](/create/worlds/publishing-options-for-experiences.md) for more information. ## Sharing a link to your experience Here are the ways you can get a link to one of your own experiences: * Through the My Experience App * Through the Atlas App Get the experience URL from the My Experiences App **Note:** * It is not necessary to publish your experience in the Atlas in order to get and share its experience URL. People who have the experience's URL can visit that experience, even if it is not listed in the Atlas. * In order for an experience to be visitable and shareable, you must first [build the experience](/create/worlds/saving-and-building-scene.md#build-your-scene). 1. Go to the [My Experiences app](/create/worlds/my-worlds-panel.md). 2. Select the experience you want to grab a link from. 3. Click **More Options** for that experience. This opens a popup menu. 4. In the popup menu, select **Copy URL**. | ![](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------- | | Select **Copy URL**. | 5. This copies the URL to your clipboard. Get the experience URL from the Atlas **Note:** Getting a URL from the Atlas only applies when your experience is published on the Atlas. 1. Click the **Atlas** button to open the Atlas. 2. Select an experience from the Atlas and click the image to bring up the experience details page. | ![Copy URL in the Atlas](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------- | | The experience details page. | 3. Click **Copy URL**. 4. The link is placed in your clipboard. 5. You can paste the link into Chat, email, or a webpage. People can click on the link to visit that experience without needing to find it in the Atlas. Source: https://docs.sansar.com/create/worlds/sharing-your-experiences --- # Create access links on sansar.com > Generate, share, and revoke single-use access links for a world you own, and manage the people who claim them. Generate, share, and revoke single-use access links for a world you own on sansar.com, and manage the people who claim them. Access links grant world access; they are not event tickets or public event listings. For the recipient steps, see [Claim an access link](/explore/worlds/claim-an-access-link). ## Before you start - **Sign in to the account that owns the world.** Only signed-in world owners can manage access links on sansar.com. - **Save a world in the Sansar client first.** If your account has no worlds yet, **Access Links** displays "You don't have any worlds yet", "Create a world in the Sansar client. Once it's saved, it'll show up here.", and **Browse Worlds**. ## Choose a world 1. Sign in on [sansar.com](https://www.sansar.com), open **Worlds**, and select the **Access links** tab (or open [Access Links](https://www.sansar.com/worlds/access-links) directly). The **Access Links** page displays "Pick a world to manage its single-use access links." 2. Find your world using **Search by name or handle…**, or filter by **All**, **Listed**, or **Unlisted** (each shows a count). Worlds are grouped under **With images** and **Without images**. - If your worlds span multiple pages while you search, the page displays "Searching the current page only. Use the pager below to move through the rest." - If nothing matches, the page displays "No worlds match your search or filter." 3. Select the world to manage. Its management page shows an **All worlds** back link, the world's name and handle, **Unlisted** when applicable, and **View world ›**. ## Generate access links 1. Under **Create access links**, select a **Link type**: - **Persistent** (default) — Grants permanent access to the person who claims the link, until you remove them from the access list. - **Scheduled session** — Grants access only during the time window you specify. 2. If you select **Scheduled session**, set the window in your local time: - **Access starts (optional, defaults to now)** (placeholder "Starts now"). - **Access ends** (required; placeholder "Pick an end time"). The end time must be after the start time and in the future. 3. Enter **Quantity (1–1000)** (default 1) for this batch. You can also enter a **Batch label (optional)** (up to 120 characters). 4. Select **Generate 1 link** (or **Generate N links**). While generating, the button displays **Generating…**. ## Share your links When generation finishes, a banner displays "1 link generated" or "N links generated" (with the number of links) and "Send these URLs to the people you want to grant access. Each can be redeemed once." Each link can be redeemed only once. Share a separate link with each recipient instead of sending one link to multiple people. - **Up to 100 links:** Select **Copy** (tooltip **Copy URL**) next to a link, **Copy all** to copy every URL in the batch, or **Download CSV**. - **More than 100 links:** The inline list and **Copy all** are omitted, and the banner displays "That's a lot of URLs — the CSV is the easiest way to hand them off." Select **Download CSV** to save the batch. The CSV includes each link's URL, link type, status, batch label, created timestamp, and session start and end times. Select **Dismiss** to close the banner when you finish. Recipients follow [Claim an access link](/explore/worlds/claim-an-access-link) to claim a URL. ## Manage All links, export, and revoke Under **All links**, switch between the **Active** and **Redeemed** tabs. While loading, the list displays "Loading…"; empty tabs display "No active links." or "No redeemed links." Select **‹ Previous** and **Next ›** to move between pages (the current page number appears between them). - **Columns:** The **Active** tab shows **Token**, **Type**, **Label**, **Created**, and **Window** ("Always" for persistent links, or the scheduled time window). On the **Redeemed** tab, **Redeemed by** replaces **Window**. - **Export:** When the selected tab displays links, select **Export CSV** (changes to **Exporting…** while running) to export links from that tab. This is separate from **Download CSV** on a newly generated batch. - **Copy or revoke one active link:** On the **Active** tab, select **Copy URL** to copy an unclaimed link, or select **Revoke** to cancel it. - **Revoke all active links:** On the **Active** tab, select **Revoke all active**, then confirm "Revoke all active links? This cannot be undone." The button changes to **Revoking…** while running and stays unavailable when there are no rows or a request is pending. The result displays "Revoked N." or "Revoked N. More links remain — click Revoke all again to continue." **Note:** Revoking active links cancels unclaimed links only. It does not remove people who have already claimed access; use the **Access list** to remove granted access. ## Manage the access list **Access list (N)** lists people with access grants to the world, including scheduled sessions that have not started. **Persistent** entries appear first, followed by **Session** entries ordered by start time (showing dates or time windows). Persistent access remains until you remove the person; session access expires when the window closes. While loading, the section displays "Loading…"; when empty, it displays "Nobody has access yet." - **Remove one person:** Select **Remove** next to the person's entry. - **Remove everyone:** When entries exist, select **Clear all** (changes to **Clearing…** while running) and confirm "Remove everyone from the access list? Users with access (both persistent and scheduled session) will lose it until they redeem a new link." **Note:** **Clear all** removes people who already have access; it does not revoke unclaimed links on the **Active** tab. ## If something goes wrong - **Scheduled session time errors:** If you see one of these messages, adjust your start or end time: - "Session end time is required for scheduled sessions." - "Session end must be after session start." - "Session end must be in the future." - **Other errors:** Any error returned while generating, revoking, or updating the access list appears inline in that section. If you still need help managing access links, [contact support](/help/contact-support). Source: https://docs.sansar.com/create/worlds/create-access-links --- # Visiting your own experience In order to visit an experience, it needs to be [linked](/create/worlds/linking-scene-to-a-world.md) to a built scene. To visit an experience that you've created from the My Experience App: 1. Go to the [My Experiences app](/create/worlds/my-worlds-panel.md). 2. Select the created experience you want to visit. 3. Click **Visit Experience** for that experience. 4. Once clicked, Sansar takes you to a runtime version of your scene, where you can interact with the scene that you have created. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Visiting your experience. |
Source: https://docs.sansar.com/create/worlds/visiting-your-own-experience --- # Build worlds with an AI assistant > Turn your world ideas into places you can explore, with help from an AI assistant. Imagine a moonlit hangout, a neon arcade, or a gallery for your creations. Describe what you have in mind, and an AI assistant can help you put it together in Sansar. Then step inside, see how it feels, and ask for changes: "Make the lights warmer," "Give the entrance more space," or "Arrange these props around the stage." Sansar's **editing and publishing API** gives assistants a way to work directly with the Sansar client on your PC. An API is simply a way for programs to talk to each other. You bring the idea and choose what feels right; your assistant handles the technical steps. ## What could you make? An assistant can help you: * **Set the scene.** Find items in your inventory, place and arrange objects, and adjust their size and rotation. * **Create a mood.** Change lighting, colors, materials, and scene settings. * **Bring in your own creations.** Import supported models from Blender, such as buildings, furniture, and props. If your assistant can also work with Blender, it can help prepare those models. * **Add a little life.** Write and attach scripts for behaviors such as a spinning display or an interactive prop. * **Refine the result.** Capture views, review changes, and build a world you can visit and test yourself. * **Get ready to share.** Help set up a world image, listing, and visitor access when you are happy with your creation. You don't need to write code to ask for these things. Start small, try an idea, and keep shaping it together. ## Get ready 1. **Update Sansar on your Windows PC**, open it, and log in as usual. 2. **Check local access.** In Sansar, open **Settings > SOCIAL > Privacy** and make sure **Allow local API access** is on. It is on by default. This lets programs running under your Windows account work with your client; you can turn it off in the same place. 3. **Use an assistant that can work on that PC.** It needs to be able to read local files and run programs. A chat window that only gives advice cannot make changes in Sansar for you. 4. **Choose some starting content.** You can use a scene you already own. If you need one, follow [Creating a World](/create/worlds/creating-a-world.md) to make a starting world from a template. Your assistant can copy its scene for your project. Sansar includes the connection tool, **SansarCli**, and its technical guides with the client. Your assistant can find and use them for you. Blender is optional unless your project needs new models made or prepared there. ## Copy this prompt to your assistant Replace the idea at the end with your own. You can be specific about a style, a few favorite colors, or what you want your friends to do there. ```text Help me build a world in Sansar using its local editing and publishing API. Find the installed SansarCli.exe next to SansarClient.exe. Its guides are in the AuthoringApi folder beside it. Use the bundled tool and docs for my installed version. Start with SansarCli help, help readme, help config, help features, and help quickstart. Read help recovery if work gets stuck. Use SansarCli instances list, context, and api describe to check the running client, my account, and the features available now. If several clients are running, ask me which to use. If access is off or I need to log in, guide me through that. Ask which starting scene to use, then work in a new copy. Follow the bundled guidance to create a separate private, unlisted test world and confirm that builds target it. Keep my original scene and world intact. Never discard unsaved work or delete my existing content without asking. Help me turn my idea into a small first version. Explain your plan in plain language, use supported features, and tell me if something isn't available. Capture views so we can review and refine it. Check the floor and spawn point (where visitors arrive) before building. Save and build the test world, then help me visit it to check the look and interactions. Ask before building into a world other than our new test world or changing who can find or visit a world. When I'm ready to share, help me choose its listing and access settings, and get my approval before publishing those changes. My idea: A cozy moonlit rooftop hangout with warm lights, a few seating areas, and a slowly spinning sculpture in the center. ``` ## Try it, then make it yours Treat the first version as something to play with. Visit it, look around, and give your assistant feedback in your own words: * "Move the sculpture so it is the first thing visitors see." * "Make the lighting feel more like sunset." * "Spread the furniture out so my friends have more room." Walk through the space yourself, too. A screenshot can show the mood, but visiting helps you check whether entrances, floors, and interactive objects work the way you expect. ## When you're ready to share There are three steps to know: * **Save** keeps your scene edits. * **Build** turns the saved scene into the playable version and updates its attached world immediately. If that world already has visitors, this changes the version they enter. * **Publish** controls who can find and visit the world. It does not build your latest scene edits. That is why the starter prompt uses a separate private, unlisted test world: only you can visit it, and it does not appear in the public directory. Once you are happy with it, ask your assistant to help you choose an image and description, decide who can visit, and share it. ## Want to see what the API can do? Ask your assistant: "Show me what my installed Sansar API supports, in plain language."
Explore the built-in help Your assistant can run these commands using the installed `SansarCli.exe`. You can also run them from its installation folder in PowerShell, using `./SansarCli.exe` in place of `SansarCli`. ```text SansarCli help features SansarCli help quickstart SansarCli help commands SansarCli api describe ``` The first two explain supported features and a worked example. `help commands` lists the commands included with the tool; `api describe` checks what your running client actually offers. The full guides and examples live in the `AuthoringApi` folder next to it, so they travel with your client version. For example, the Blender import workflow supports static models such as scenery and props. Rigged avatars and Blender animations are outside that workflow. Have your assistant check the installed feature guide before planning a project around a particular capability.
Source: https://docs.sansar.com/create/ai/building-with-an-ai-assistant --- # Diagnostics Toolbar The _diagnostics toolbar_ is a utility for displaying information about the performance of Sansar and the scenes you are in. It is useful for measuring graphical impact, which can help you make informed decisions about how to improve performance in your scenes.

To enable the diagnostics toolbar while editing or visiting a scene, select **More Options > Diagnostics** from the App Launcher on the left side of the screen. While editing a scene, you may also choose **Tools > Diagnostics** from the toolbar at the top of the screen.

## Disable diagnostics for visitors --- A world owner can disable the ability for visitors to use their diagnostics toolbar in the scene for various reasons. To disable the use of diagnostics in your scene, during edit mode go to the top left menu and select **Tools > Scene Settings.**

Then in the Scene Settings panel **Scroll Down to Visitor Settings > Toggle Diagnostics to off**

## Statistics --- The diagnostics toolbar displays the following statistics at all times:

* **Rate** - The current frame rate, measured in frames per second. Higher values are better, it is possible to set a cap for this in the settings panel. * **Time** - The amount of time elapsed in milliseconds for the last sampled frame. Lower values are better. * **Draws** - The number of draws required to render the current view. Larger numbers of draws have a larger negative impact on performance. This number changes as the number of visible objects enter and exit the viewable area. Number of objects, Overdraw, lighting, materials, the objects shader type and avatars are some of the things that are counted towards this. * **Prims** - The number of triangles (also known as _primitives_) currently being drawn. When visiting a scene, _occlusion culling_ reduces the number of triangles, but occlusion culling is not performed while editing a scene so this number remains fixed, visit your scene during runtime to see this change. The larger the number of triangles, the bigger the negative impact on performance. * **Geom** - Your scene's total geometry size in MB, lower amounts help with performance and loading times. * **Tex** - The total texture size of your scene, this heavily impacts loading times and VRAM usage, using smaller textures can help keep this down. **NOTES:** - Some optimizations only occur fully during runtime and require you to visit for a true performance overview. - As a rough guide for a performant world try keeping your **Draws** below 6k while in runtime, your **Prims** below 8 million and your **Tex** below 8GB. These numbers fluctuate when optimizations occur during runtime so try to visit your scene how you intend your guests to see it. ## Metadata settings --- You can temporarily adjust the lighting in your scene to provide additional contrast and visibility while using the metadata modes by clicking these two icons and adjusting the sliders.

### Lighting This setting adjusts how much of the normal scene lighting is visible. You can turn this down to help the glowing metadata highlights stand out, making it easier to identify "hot spots" of triangle density or overdraw. Turn it back up again to help navigate the scene and identify the underlying models. ### Sensitivity Adjusts the brightness of the glow from the rendering metadata modes. At low sensitivity, only the most dense or complex areas are highlighted. At high sensitivity, dense and complex areas glow very brightly. ### Extra Settings Some Metadata modes have some extra settings, if they do, a cog symbol will appear and can be clicked for other options.

## Rendering metadata modes --- The diagnostics toolbar can toggle several viewing modes to help you identify performance issues in your scene. You can use these while editing and during runtime. Select from the following modes in both VR and Desktop.

To use Diagnostics view in VR you can cycle through modes by selecting the 'Diagnostics' button located on your main wrist menu. ## No Metadata --- No rendering metadata is displayed. This is the default view.

## Lighting complexity --- Overlapping lights especially when casting shadows, is possibly the biggest hit to the performance of a scene. This mode provides information regarding the number of lights illuminating the same area in the scene (in other words, "overlapping lights"). This information is only displayed for point lights and spot lights. Areas with a low lighting complexity appear as dark purple. Objects with a high lighting complexity appear a bright yellow/orange. Areas of high lighting complexity have a negative impact on performance since processing time is required to calculate the effect of each light illuminating the area.

Here you can see 3 point lights that look like they are not touching.

But in diagnostics we can see they are actually overlapping.

Additionally when a light hits an object it is being rendered twice, making your PC need to render it again, every light that touches an object makes your PC render it another time, so in this image, cube 1 is being rendered twice, cube 2 three times and cube 3 four times! this can soon add up especially with complex objects. Reducing the overlap and the amount of lights hitting an object can drastically improve performance. ### Lighting complexity modes ---

You can use the **Lighting complexity modes** to filter which lights are displayed by the Lighting complexity metadata mode. Lighting complexity mode can filter the following kinds of lights: * **All lights** - Includes all spot lights and point lights. * **Shadow casters only** - Only includes lights that can cast shadows. * **Active shadow casters only** - Includes only lights that cast shadows that are currently being updated, or "active". Shadow casters are active when an object in the light’s region of influence moves. ## Overdraw Complexity --- Excessive overdraws is one of the main culprits of bad performance. This mode provides information regarding the number of objects in the scene that are being drawn in the same space on the screen, or "drawn on top of each other". Overdraw occurs when objects are drawn in the same line of sight, but are separated by space. Objects with low overdraw complexity glow dark purple, and objects with high overdraw complexity glow bright yellow-orange. Areas of high overdraw complexity have a large negative impact on performance as processing time is required to render objects that are ultimately hidden by objects closer to the camera and would be culled normally during runtime. If a single part of mesh is visible to the camera the entire object is being rendered. It is important to note that items with alpha shaders will not cull items behind them.

## Triangle Density --- Triangle Density provides information regarding the number of triangles on screen. Objects with a low triangle density glow dark purple. Objects with high triangle density glow bright yellow-orange. The higher an object's triangle density, the larger its negative impact on performance. Use this mode to try and find areas and objects that have a lot of density and try reducing it with less items or more performant objects.

### Triangle density modes There are two modes, which are accessible through the gear icon on the Diagnostics toolbar:

* **Screen space** - Calculates triangle density _per pixel_. Objects that are further away from the camera (and therefore smaller on the screen) have the appearance of higher triangle density, since there are more triangles within a smaller rendered area. * **World space** - Calculates triangle density relative to the size of the world. This mode is not dependent on the camera, which allows for easier identification of higher density objects in the scene. Viewing triangle density of an object in a scene, with Lighting set low and Sensitivity set to default. Areas of low triangle density appear purple, and areas of higher triangle density are highlighted more brightly.

## Visible Backfaces --- Visible backfaces shows when a mesh is showing a flipped normal or the backface of a piece of mesh, you can use this to determine if an object has flipped face normals.

## Wireframe --- This rendering metadata mode outlines all visible triangles in the scene. This directly correlates with the scene's **Prims** statistic. You can use this mode to identify objects with geometry that may be considered heavy for the size of the item, using this, you can try to find objects and layouts that can be simplified or changed in order to reduce primitive count and triangle density in the scene.

## Unlit --- Unlit shows the base colors of the world's objects without any lighting or shadow effects, this can be useful to see the true colors of items in darker areas or to build without needing to change lighting in dark scenes.

## Normals --- Normals shows the normal maps of all objects and is useful to determine if a normal map is being used on low poly objects instead of a high poly object being used where it is not needed.

## Scale --- Scale shows a grid across the scene that takes into account if an item has been scaled up compared to the others around it, there is some use for this in figuring out if an object has been scaled beyond its original intended size.

## Radiance --- Radiance shows the Global Illumination and Bounced lighting color effects within the scene without other sources of color or lighting. This mode can help you identify if the GI is achieving desired results and where certain lighting effects may be coming from.

## Texture Size --- Texture size shows using a color coded map the sizes of the texture maps used on all the objects in a scene. Use this to help identify objects using larger maps than is necessary. These show per material slot and can be filtered to just show the texture type you would like to examine or the largest map if using the default 'all' setting.

### Texture Instancing Caveat A caveat of the view is it cannot tell if objects are sharing a single texture. Sansar uses texture instancing so having a single 4k atlas that is used on many objects can be considered ok as it uses no more resources if more objects use the same texture. For example: if you used a 4k concrete on a very large bridge that required it, you can use that same 4k map on all your concrete objects in the scene and its only counted as being used once, but these objects can all show as using 4k. Once you have identified objects you think could be improved, check your scene stats panel in build mode to see if the texture is shared with other objects and weigh up the usecase. ### Reading the color map - Using the Cog symbol next to the diagnostics selector choose the map type you wish to examine, if you select 'All' the largest texture size of the material slot will be shown, you can then change the type to determine the individual map sizes of that object. - Map sizes are determined using the power of 2. For a map to be in the 2k range it must be over 2048x2048 but lower than 4096x4096. - The tool accounts for maps being any size within these ranges by using brightness. - a map that is nearing the 4k range but is still under the threshold will appear as a brighter red than one that is closer to 2048x2048. - If an object does not contain the map you are filtering it will appear as Dark Grey or Black.

### Color Reference | Size | Color | |------------|--------------| | 0 | Darker Gray | | < 8x8 | Dark Gray | | < 128x128 | Dark Green | | 128x128+ | Bright Green | | 256x256+ | Cyan | | 512x512+ | Yellow | | 1024x1024+ | Orange | | 2048x2048+ | Red | | 4096x4096+ | Magenta | Source: https://docs.sansar.com/create/world-editor/diagnostics-toolbar --- # Object Stats Toolbar ## Object stats toolbar The _Object stats_ toolbar is a utility for displaying information about selected objects in a scene. It is useful for providing information about the triangle count, texture count, and file size of one or more selected scene objects. To enable the Object stats toolbar while editing a scene: 1. Click the **Tools** button from the Scene toolbar. This reveals a list of Tools which are either currently visible or hidden. 2. Select **Object stats** from the Tools list to make the object info toolbar visible. Once selected, the object toolbar appears on the top portion of the screen, next to the scene toolbar. 3. Select the object or multi-select the objects that you want to see information about. ## Statistics The object info toolbar displays the following statistics at all times: * **Selected** - The number of scene objects currently selected. * **Triangles** - The number of triangles the selected scene object or objects have. * **Textures -** The number of textures present on the selected objects. * **Size (KB) -** The file size of the selected objects.

The Object stats toolbar can be viewed while editing a scene.

*** ## Generating a scene report You can generate a report of all objects in the scene, including statistics for triangles, textures, and file size for each individual object. The report is generated as a CSV (comma-separated values) file that may be opened in a spreadsheet or text editor. To generate the scene report: 1. Click **About this scene** in the Scene toolbar. 2. Click **Generate report** under About this scene. 3. Choose a location on your computer to save the report and click **Save**.

Click Generate report to save a CSV report of statistics for all objects in the current scene.

Source: https://docs.sansar.com/create/world-editor/object-stats-toolbar --- # Object Components Objects can contain components, such as lights, scripts, and sounds, that may add additional properties for you to adjust. You can view and adjust the components of objects in a scene while in edit mode. Right-click an object in the Scene Objects panel and choose Structure to view the object's components. ## Adding containers Objects can include one or more containers, which are groups of additional content and components associated with the object. Containers may contain scripts, audio features, lights, and additional physics volumes for the object. Typically, an object that is added to the scene automatically has a container that holds the object's existing components. This container can be accessed by right-clicking the object's name in the Scene Objects panel and choosing Structure to open the Object Structure panel.
To add a container to your object: 1. In the **Scene Objects** panel, right-click the object's name. 2. Choose **Add > Container**. A new container is created within the object, with the name "Container" followed by a sequential number. For example, the first new container created in an object is named "Container 1". The next is named "Container 2", "Container 3", and so on. ![Numbered object containers](/media/screenshot-pending.svg) ## Adding lights You can add lights to an object. Depending on the **LightType** property you choose, the light can behave exactly like any of the lights under the Lights tab of the Inventory. To add a light to an object: 1. In the **Scene Objects** panel or **Object Structure** panel, right-click the object name or a container within the object where you would like to add the light. 2. Choose **Add > Light**. 3. Right-click the new light component and choose **Properties**. This opens the light's properties panel, where you can set the following light properties: * **Name** — Provide a name for the light. * **LightType** — Choose **Point** or **Spot** from the dropdown menu. Each light type provides additional properties like those found in their counterparts under the Lights tab of the System Objects Inventory. * **Color** — Set the color of the light. Click the eyedropper tool to select a color, or provide red, green, and blue values between 0 and 255. * **Intensity** — Set the brightness of the light. * **Range** — Set how far the light can shine. * **Scriptable** — Allow the light to be changed by scripts. 4. Click the **LightType** dropdown menu to set the type of light you want to use. 5. Set additional light properties based on the type of light you selected. ![Light component properties](/media/screenshot-pending.svg) ![Point light on a robot](/media/screenshot-pending.svg) The **Point** LightType and the parameters set above give the robot a glowing effect. **Note:** You can only edit the **LightType** of a light component via the individual light properties panel. However, you can edit the light's properties (such as color and range) both in the light properties panel and the main object's properties panel. ## Adding scripts You can add scripts to objects in order to make them perform actions or interact with avatars and the environment. Some scripts allow you to enter parameters; the name and function of each parameter is defined by the writer of the script. To add a script to an object: 1. In the **Scene Objects** panel, right-click the object name or a container within the object where you would like to add the script. 2. Choose **Add > Script**. A new script component appears in the object, for example **Script 1**. 3. In the **Object Structure** panel, right-click the name of the script and choose **Properties** from the list of available actions to open the script's **Properties** panel. 4. In the **Script** dropdown, choose a script you have uploaded, purchased, or one of the scripts provided by default. 5. Set the parameters of the script to your liking. The parameters available depend upon the script and which parameters the writer of the script wished to expose. ![Script component properties](/media/screenshot-pending.svg) **Note:** You may also change your script and edit script parameters from the object's main properties panel. For more information, see [Importing custom scripts](/create/import/importing-custom-scripts) and [Adding scripts to an object](/scripting/guides/adding-scripts-to-an-object). ## Adding audio To attach a sound to an object: 1. In the **Scene Objects** panel or **Object Structure** panel, right-click the object name or a container within the object where you would like to add the sound. 2. Choose **Add > Audio**. A new sound is created within the object with the name "Audio" followed by a sequential number (for example, **Audio 1**). 3. In the **Object Structure** panel, right-click the name of the audio and choose **Properties**. From the **Properties** panel, you can set the same properties as in a standalone sound emitter, which are explained in [Audio emitter](/create/audio-and-video/audio-emitter). 4. In the audio component's **Properties** panel, select a **Sound** (see [Importing items](/create/import/importing-items) to upload a sound) and set its other properties as described in [Audio emitter](/create/audio-and-video/audio-emitter). ![Audio component properties](/media/screenshot-pending.svg) **Note:** You may also change your sound and edit sound properties from the object's main properties panel. For more information, see [Working with audio](/create/audio-and-video/working-with-audio). Because the audio emitter is attached to the object, when the object moves, the sound moves with it. By default, a sound is attached to the center of an object. You can reposition the emitter relative to the object: 1. In the object's **Object Structure** panel, click the sound inside the container (it is named something like **Audio 1**). This selects the audio emitter instead of its containing object. 2. Drag the emitter by the XYZ handles to reposition it. ![Repositioning an audio emitter](/media/screenshot-pending.svg) This is useful for times when you want a sound to come from another position on an object. For example, if you have a dinosaur that roars, you probably want the sound emitter to be placed at the dinosaur's mouth. ## Adding collision volumes You can add collision volumes to an object: 1. In the **Scene Objects** panel or **Object Structure** panel, right-click the object name or a container within the object where you would like to add the collision volume. 2. Choose **Add > Volume**. A new volume is created within the object with the name "Volume" followed by a sequential number. 3. In the **Scene Objects** panel, right-click the volume component you want to edit and choose **Properties** to open the volume's properties panel, where you can set the following properties: * **Volume Type** — Choose **Box** or **Sphere**. Depending on which mode you choose, a different scaling option appears. * **Has Collision** — Allows physical objects and avatars to collide with the object. This must be set to **On** as a prerequisite to making the object dynamic. * **Radius** — Appears if the **Volume Type** is **Sphere**. Use the slider or enter a value to define the bounds of the sphere. * **Extents** — Appears if the **Volume Type** is **Box**. Enter values to define the X, Y, and Z dimensions of the box. 4. Optionally, choose an impact sound for the object by setting **Custom Sound** to **On** under **Impact Sound**: * **Sound** — Choose a sound from your inventory. * **Loudness Offset** — Set the relative loudness of the impact sound, in decibels. * **Pitch Variation** — Randomly vary the pitch of the impact sound each time it plays, set in half-steps of the musical scale. A value of 12 means that the sound can be randomly shifted up or down by up to a full octave. ## Editing the Animation component The Animation component is specific to objects that have been created and uploaded with an animation. Animations cannot be added to an object after it has been uploaded to Sansar. For animation controls, see [AnimationComponent](/scripting/api/sansar.simulation/animationcomponent). Source: https://docs.sansar.com/create/world-editor/object-components --- # Parenting objects
Parent objects are a way of organizing a group of objects in a scene such that they can be moved, rotated, and scaled as though they are one object. The parent object itself is not an actual object in the scene, but instead represents its collective child objects as a group. ## Creating a new parent object To group one or more objects into a parent object while editing a scene: 1. In the **Scene Objects** panel, select one or more objects (hold **Ctrl** to select or de-select multiple individual objects). 2. Right-click one of the selected objects and choose **Group into new parent**. 3. Enter a name for the new parent object. The child objects are grouped and indented under the parent object in the Scene Objects panel. You can move, rotate, and scale the entire group by selecting the parent object, or you can manipulate each object by selecting it individually.

Select multiple objects by holding Ctrl, then right-click one of them and choose Group into new parent.

Make sure to give your new parent object a meaningful name. The selected child objects are grouped under the parent object and indented for easy identification.

## Removing objects from a parent object To move a child object back out of a parent object, right-click it and choose Move to top level. ## Cut and paste You can cut and paste objects between parent objects by selecting them and choosing Cut, then Paste on the destination parent. If you choose to cut a second time before pasting, the previous cut is canceled. Source: https://docs.sansar.com/create/world-editor/parenting-objects --- # Scene Item Inventory ## Scene item inventory When editing a scene, the Inventory panel is what allows you to manage items you have uploaded to Sansar or purchased from the [Sansar Store](https://www.sansar.com/store). In addition, it contains several basic system objects and items that have been provided by default in Sansar. It also allows creators to add items to their scenes and sellers to list and sell items in the Sansar Store.

The inventory panel.

*** The Inventory panel can be found at the bottom of the screen in edit mode. From here, you can select, drag, and drop an object into your scene. You can also change the size of the window to your liking. ## Navigating the inventory There are three drop-down menus on the Inventory, which will help you navigate and filter through your inventory items. ## Filter by inventory items In the first dropdown, you can filter inventory items, which include items you uploaded using the **Upload** tool, items you purchased in the store, and system objects. Toggle between the following choices in the first dropdown to filter your items: * **Created** - Lists all the items that you have [uploaded](/create/import/importing-items.md) using the **Upload** button. * **Purchased** - Lists all of the items that you have [purchased](/store/shopping/buy-items.md) through the [Sansar Store](https://www.sansar.com/store). * **System** - Lists several basic objects that you can add to your scene. To know more about these system objects, see [System objects](/create/world-editor/system-objects.md).

The Inventory contains all of your purchased and uploaded items, as well as, several basic items and system objects.

*** ## Filter by type In the second dropdown, you have the option to view all items or filter your items by type: **audio**, **objects**, **interactive**, **lights**, **objects**, **scripts**, **terrain** or **texture**. Please keep in mind that the interactive, lights, and terrain filters only apply to system objects.

Filter by type.

*** ## Inventory sort On the third drop-down, you can sort the inventory by newest or alphabetically.

Sort your items.

*** ## Inventory Search Find items in your inventory faster by using the search bar on the top right corner of the Inventory panel. Please take note that you need to search separately between the Created, Purchased, and System items. ## Action menu Right-click on an item to reveal a menu with a set of options that helps you manage the items in your inventory. These buttons are: * **Rename** - Allows you to rename an object you have created or purchased. Enter the new name into the New Item Name panel that appears, and click **Rename** to rename the item in your inventory. You may not rename system objects or pre-supplied assets, such as certain textures and scripts that come with Sansar by default. * **Sell Item -** Allows you to list your items for sale in the [Sansar Store](https://www.sansar.com/store). For more information on creating item listings, please see [Selling items in the Sansar Store](/store/selling/manage-listings.md). Note that you can only list items that you have uploaded in Sansar; you cannot list items that you have purchased from the Sansar Store, nor any system objects. * **Delete -** Allows you to delete an item from your inventory. If you delete an item that you purchased from the Sansar Store, you can redeliver the item to your inventory from the item's store details page or from your [Purchases](https://www.sansar.com/store/purchases) list. However, if you delete an item that you uploaded, you need to re-upload it to use it again.

The action buttons.

Source: https://docs.sansar.com/create/world-editor/scene-item-inventory --- # Scene Objects Panel ## The Scene Objects panel The Scene Objects panel lists every object in your scene. To toggle the Scene Objects panel on or off, choose **Scene Objects** under **Tools** while editing a scene.

You can toggle the Scene Objects list on and off by clicking Scene objects under Tools.

*** ## Search and filter You can filter the objects shown in the Scene Objects panel by clicking the dropdown (**All types** by default) at the top of the panel. You may also search your objects by typing into the **Search by name** field. To end a search and show all objects again, delete all text from the Search by name field. ## Parent objects _Parent objects_ are a way of organizing a group of objects in a scene such that they can be moved, rotated, and scaled as though they are one object. The parent object itself is not an actual object in the scene, but instead represents its collective _child_ objects as a group. **Note:** Parent objects share many similarities to legacy _folders_ in Sansar, with added functionality. For this reason, existing legacy folders and their contents have been converted to parent objects and child objects respectively. The children of a parent object can still be manipulated independently and retain all their properties as individual objects. For more information about parent objects, see [Parent objects](/create/world-editor/parenting-objects.md). ## Object structure To view the various components of each object in the Scene Objects panel, right-click an object and choose **Object structure**. For more information about object components, see [Object editing](/create/world-editor/object-components.md). ## Toggle visibility and selectability of objects You can toggle an object's visibility in the scene by clicking the **Show/Hide** icon next to its name in the Scene Objects list. If hidden, the object will be invisible in the scene but may still otherwise be moved, rotated, or otherwise manipulated, but cannot be clicked in order to select it. This feature may be useful if an object in the scene is obscuring your view and making it difficult to work with other objects.

Click the Show/Hide icon to toggle an object's visibility in the scene.

*** You can disable or enable an object's selectability by clicking the **Disable/Enable object selection** icon next to its name in the Scene Objects list. If disabled, you will not be able to select the object by clicking on it in the scene. You may wish to disable an object's selectability if it is obscuring your ability to click on or select another object that is behind or inside it.

Click the Enable/Disable object selection icon to toggle an object's selectability.

*** You can toggle an object's editability in the scene by clicking the **Lock/Lunlock** icon next to its name in the Scene Objects list. If locked, the object cannot be edited unless it is unlocked.
Source: https://docs.sansar.com/create/world-editor/scene-object-panel --- # Collision Volumes ## Collision Volumes Collision meshes are simplified, invisible versions of objects that help things like avatars and items interact with each other. Instead of using the detailed, visible version of the object (which could slow things down), these simplified meshes make interactions faster and smoother, especially for things like physics or when objects collide in a scene. They improve performance by reducing the complexity of calculations when objects need to touch or interact with each other. ## Viewing Collision Volumes During edit mode you can view the collision volumes of objects individually or the entire scene, currently you cannot preview animated collision volumes as these do not play during edit mode. Each volume type has a color associated with it's [Motion Type](/create/world-editor/object-motion-types.md) to help identify them - Grey - Static objects - Yellow - Dynamic objects - Cyan - Keyframed objects - Black - Unknown type (Dev test assets) rarely seen
[Image: scene volumes]

### Viewing selected objects collisions With your objects selected 1. Right click your objects. 2. Select Structure from the context menu. 3. If your object contains a collision it should display as 'Volume' by default but the symbol can be used to identify the collision if it has been renamed. Left click this and it should now display the volume on your object. Note: with this selected the adjustment gizmo will affect the volume allowing you to make some changes to its position.
[Image: collision]

### Viewing the entire scenes collision volumes Its possible to see the entire scenes collision volumes in one go to get a quick idea of how everything is working for visitors to your scene compared to the visual mesh. 1. In edit mode, at the top left click the EYE 'visibily' symbol 2. select 'Physics Shapes'
[Image: scene volumes]

It is quite common to see flickering of the collision mesh overlapping the render mesh this is generally seen as fine and a close matching collision. While in this mode you should see if any collision volumes could be removed or simplified to help with optimization. ## Using Collision Volumes To optimize performance in Sansar and avoid issues when adding collision meshes to your objects, follow these best practices: - Avoid using your "render" mesh as a collision mesh. The render mesh is the detailed version that’s seen in the scene, but it’s too complex for fast physics calculations. - Keep collision meshes simple and low-polygon. They should be basic "convex cages" that cover the areas you don’t want avatars to pass through. Collision meshes should always be as light as possible to minimize strain on the system. - Opt for basic shapes when possible. For smaller objects like tables, chairs, or props, consider using basic shapes like cuboids, spheres, or capsules for the collision mesh. This keeps the calculation simple and reduces unnecessary complexity. - Triangulate your collision before import, this is done automatically if not and can create issues Important Note: For performance reasons, dynamic objects (objects that can move or be interacted with) have their collision meshes automatically converted into simplified convex hulls during the experience. This ensures faster calculations when players are interacting with them. However, the original collision mesh will still be preserved in your inventory and while you're editing your scene.
[Image: scene volumes]

## When not to use collision meshes you are able to remove a collision volume from an objects structure panel as part of your scene optimization by right clicking the volume from the structure menu and select delete. **reasons to remove a volume or not use one** - If the collision volume seems really complex for your objects needs replace it with a simpler volume. - If an item is a background/distant object. - Something is small and not intended to be interacted with. - Decorative wall items or ground clutter. - many large objects in a small space makes it hard to navigate the area removing some may help players get around. ## Importing collision volumes Please see [Importing Collision Volumes](/create/import/importing-collision-volumes.md) on how to import and add volumes to objects. Source: https://docs.sansar.com/create/world-editor/collision-volumes --- # Scene Settings ## Scene Settings Panel The Scene Settings panel allows you edit certain properties of an entire scene, such as the skybox, [global illumination](https://en.wikipedia.org/wiki/Global\_illumination), background sound, and media surface settings, gravity and jump amounts, and some visitor settings. to open your scene settings panel in edit mode select **Tools > Scene Settings** to open the Scene Settings Properties panel.
## Physics settings
These settings allow you to define the laws of physics in the scene. Currently, there is only two physics settings: * **Avatars Can Collide** **-** Choose whether or not avatars are allowed to collide with each other in this world. If set to **No**, avatars cannot collide and pass harmlessly through each other instead. **Note:** Setting **Avatars Can Collide** to **No** can help with performance and navigation in spaces where you expect large crowds of people. * **Gravity** - Move the slider or enter a value between 0.0G (no gravity) and 5.0 G (5 times Earth gravity). You may also use the dropdown to change the units between meters per second squared (m/s^2) and G's. By default, this setting is 1.0 G or 9.81 m/s^2, normal Earth gravity. ## Backpack settings This setting is used to select the backpack inventory your world visitors can use, a custom one is not available currently and you must choose between: - System Backpack (these are global items provided by sansar) - None (this will turn off spawning of items for you visitors) See [Moderation Tools - Backpack](/create/worlds/moderation-tools-for-world-owners.md#backpack-management) for how to change this during runtime.
## Skybox settings
These settings define the scene's Skybox, the texture that is used to represent the sky in your scene. You can adjust the following settings: * **Skybox -** Choose from one of the predefined skybox textures, or pick one that you have got from the store or uploaded yourself. see [Importing a Skybox](/create/import/importing-a-skybox.md) * **Sky Brightness** - Move this slider to increase or decrease the brightness of the entire sky. * **Sky Rotation -** Enter X, Y, and Z values in degrees (from 0.0 to 360.0) to rotate the skybox texture along X, Y, and Z axes. ## Atmospherics settings
These settings define the look of the atmosphere in a scene: * **Fog color -** Defines the color of atmospheric fog in the scene. Provide values from 0-255 for Red, Green, and Blue or click the dropper icon to open the Color panel and choose a color from the palette. * **Fog Scattering -** Affects the direction that light is scattered when looking at a light. At low values, an "aura" can be seen around light sources and fog farther away seems darker. At high values there is no halo around light sources and the fog seems more uniformly lit. * **Ground Fog Falloff -** Adjusts the rate at which the fog density decreases with altitude. * **Ground Fog Density -** Adjusts the overall density of fog in the scene. Set this to zero in order to disable fog in the scene. * **Sky Distance -** Set the simulated height of the skybox for atmospheric scattering purposes; lower values cause atmospheric scattering to show more of the sky's color. ## Exposure settings
Exposure settings allow you to adjust how bright or dark your scene appears: * **Exposure Bias -** Adjust between -2.0 and 2.0 (corresponding to photographic [f-number](https://en.wikipedia.org/wiki/F-number)) to darken or brighten your scene, respectively. * **Underexposure Adapt -** Affects how much the scene is allowed to compensate when looking at an area that is too dark. Higher values allow for increased brightness in dark areas. * **Overexposure Adapt -** Affects how much the scene can compensate for overly bright areas. Higher values increase the amount the scene dims when viewing something brightly lit. ## Shading posterization effect
Allows you to create a cartoon-like effect for the scene. **Effect Strength** - Controls the overall strength of the effect. **Strata Frequency** - Controls the number of shading bands. **Phase Shift** - Fine tuning for the placement of shading bands. ## Post effects
Allows you to create a cartoon-like effect for the scene. **Outline Weight** - Adjust the heaviness of the outline around objects. **Outline Inset** - Control how far to inset the outline into the object. **Saturation Boost** - Increase the saturation of colors in the scene. ## Bloom settings
The [Bloom](https://en.wikipedia.org/wiki/Bloom\_\(shader\_effect\)) settings allow you to adjust how blown-out or "glowy" bright lights in your scene appear: * **Bloom Strength** - Adjusts the bloom effect of lights in a scene. Move the slider to control the balance between the blurred and the original version of the scene. * **Bloom Width** - Affects how wide the blurry fringe gets around light sources. ## Light settings
Global illumination quality settings. There is currently only one property under Light settings: **Global Illum Quality**. For more information, see [Global illumination](/create/lights/global-illumination.md). ## Background Sound & Web Audio Streams
Background Sound let you set and adjust a background sound for the whole scene and choose whether or not to compute reverb on sounds in the scene. * **Sound Source -** Switch between using inventory audio or a web stream. For more information on using a web stream, see [Streaming web audio](/create/audio-and-video/streaming-web-audio.md). * **Background Sound** - When you choose **Inventory** as a sound source, choose a sound you have uploaded to Sansar. The sound is played in a loop while visiting the scene. You can preview the looping sound while editing the scene by clicking **Options** and enabling [**Audio/Video Preview**](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md). * **Loudness** - Increase or decrease the volume of the looping background sound, measured in decibels (dB) or level. * **Compute Reverb** - Enable to allow the scene to simulate realistic reverb based on objects and materials in the scene. For full information, see [Compute Reverb](/create/audio-and-video/high-quality-spatial-audio.md#compute-reverb). * **Audio streams** - Allows you to add an Audio stream URL, and name it respectively. See [Streaming web audio](/create/audio-and-video/streaming-web-audio.md) for more information. ## Media surface settings
Media surface settings allow you to customize web content playback in your scene. For details on how to use these settings, see [creating a media surface](/create/audio-and-video/creating-media-surface.md) and [using and previewing media streams](/create/audio-and-video/using-media-streams.md). ## Visitor settings
Visitor settings allow you to customize or restrict certain privileges for all visitors to your world. * **Allow Free Camera** - Set to **Off** to disable the use of free camera in your world. * **Allow Teleport to Free Camera** - Allows your visitors to use the freecam (F4) to teleport their avatar to the cameras location by pressing the 'T' Key. * **Allow flying** - When 'On' allows visitors to fly in your world. * **Max Jump Count** - This allows visitors to multi jump, i.e double/triple jump setting to 0 allows infinite jumps. * **Allow Teleport** - Set to **Off** to disable teleporting within the world. This only effects teleporting within the world and does not restrict visitors' ability to travel to other worlds using the Codex. * **Teleport Range Maximum** - Set maximum teleport range within the world. * **Bypass Spawn Point** - Allow visitors to bypass the world's spawn point by bookmarking a specific location when they leave and return or when they join by teleporting to a friend from another world. * **Diagnostics** - This allows visitors to use their diagnostics menu in your world, turning this off disables their menu stopping them using it to inspect your world.
Source: https://docs.sansar.com/create/world-editor/scene-settings --- # System objects _System objects_ are a category of special, predefined intangible objects that can be placed in a scene for various effects. These categories include audio emitters, light sources, and interactive objects like spawn points. You can access system objects while editing a scene by clicking the **System Objects** tab of the Inventory panel. You can then filter your search by clicking **All**, **Lights**, **Audio**, or **Interactive**. | ![System objects tab](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------- | | The System Objects tab, found in the inventory panel at the bottom of the screen. | While editing a scene, system objects are represented by abstract shapes, but they are otherwise invisible while visiting the scene. Lights | ![Directional light](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------ | | A directional light, represented by three arrows pointing in the direction the light shines. | System object lights are intangible sources of light that can illuminate your scene. Each type of light operates differently; make sure to choose the right light for each situation. For more information on working with lights in a scene, see [Working with lights](/create/lights/working-with-lights.md). Audio Audio Emitter | ![Point audio emitter](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------ | | A _point_ audio emitter, shaped like a stylized speaker. Cuboid and sphere audio emitters are shaped like cubes and spheres. | Audio emitters act as the source of localized sounds in a scene. For detailed information on how to upload sounds and use audio emitters, see [Working with audio](/create/audio-and-video/working-with-audio.md). Interactive Spawn Point | ![Spawn point](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------------- | | A spawn point, represented by footprints inside a circle. The pointy end of the circle indicates which way visitors face when entering the scene. | The spawn point represents the exact location where visitors enter your scene. If you place more than one spawn point in the scene, visitors can potentially arrive at any of them, chosen at random: **Position -** The location where visitors enter the scene. **Rotation -** The direction visitors face when they enter the scene. **Scale -** Has no effect. Trigger Volume | ![Trigger volume](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | A **Box**-type trigger volume, represented by a translucent blue box. Trigger volumes cannot be seen by visitors to your scene, but can trigger events when objects and avatars enter. | A _trigger volume_ is an invisible, non-collidable area that generates a Trigger event whenever an object or avatar enters or exits the area. This can be useful for opening automatic doors, counting visitors, and many other applications. For more information, see [Working with trigger volumes](/scripting/guides/working-with-trigger-volume.md).
Source: https://docs.sansar.com/create/world-editor/system-objects --- # Object Motion Types For any object in a scene that has a collision volume, you may choose one of three motion types. A motion type defines how an object moves in the scene and how it acts when it collides with other objects. An object's motion type can be set using the Motion Type dropdown in the object's Properties panel. At this time, the three motion types are Static, Keyframed, and Dynamic. ## Setting Motion Type Note: Objects must have a collision volume in order to set a motion type. See [Importing Collision Volumes](/create/import/importing-collision-volumes.md) to find out how to add a collision volume to an object that does not already have one. While editing a scene, you can set an object's motion type by doing the following: 1. Select the object, either by clicking it in the scene or by selecting it from the **Scene Objects** panel. 2. Click the **Properties** button that appears on the object. 3. In the **Properties** window that appears, click the dropdown next to **Motion Type** and select **Static**, **Keyframed**, or **Dynamic**. ![Motion Type set to Dynamic](/media/screenshot-pending.svg) It is also possible to set an object's motion type when you import it to Sansar. For more information, see [Importing items](/create/import/importing-items). ## Motion type properties The following additional properties are associated with objects that have a movement type selected: * **Density** (Dynamic only) — Adjusts the mass of the object by increasing or decreasing its density. Higher density objects are harder to move and are more affected by gravity. * **Friction** — Set the amount of friction the object exerts on other objects that touch it. * **Bounce** — Set the amount of energy absorbed by the object when another object or avatar collides with it. The higher the setting, the more force the object "pushes back" with when something collides with it. * **Audio Material** — Set the sound the object makes when something collides with it or an avatar walks on it. For more information, see [Using audio materials](/create/audio-and-video/using-audio-materials). * **Can Grab** (Dynamic only) — Set whether or not an avatar can grab the dynamic object with the mouse or VR motion controllers. ![Dynamic object motion properties](/media/screenshot-pending.svg) **Density** and **Can Grab** are exclusive to dynamic objects and do not appear for static or keyframed objects. ## Motion type definitions This section describes the differences between static, keyframed, and dynamic objects. ### Static Static objects are completely immobile and cannot be moved under any circumstances while visiting a scene. Avatars and other mobile objects may still collide with static objects. Static is the default motion type for all objects. ### Keyframed Keyframed objects are almost exactly like static objects, except that they can be moved by object animations and certain script API functions. This means that, while they are capable of movement, they are unaffected by gravity, cannot collide with static or keyframed objects, and can collide with dynamic objects and avatars, but are not moved by them. Keyframed objects are useful for creating moving parts of a scene, such as doors, that need to perform a specific motion reliably without adding unnecessary strain to the physics simulation. Note: Animated objects that have been incorrectly set to Static are automatically converted to keyframed objects when visiting the scene. However, scripted objects are not converted in this way and may fail to move if they are not properly set to the Keyframed motion type. Note: Keyframed and dynamic objects do not have separate script API functions for movement. Keyframed objects can be moved using the same script API functions as dynamic objects, such as those used in [Random movement example](/scripting/examples/random-movement). ### Dynamic Dynamic objects in Sansar can be affected by physics; this means they can fall, roll, bounce, and slide within a scene according to their density, friction, and bounce settings. When visiting a scene, you can grab and toss dynamic objects using VR controllers or the left mouse button. You can easily play with these interactions in the Toppleton Toy Town experience provided by Sansar Studios. For performance reasons, the mesh collision shapes of dynamic objects are converted to a simplified convex hull when visiting the scene. Dynamic objects with collision made from scaled parts collide at their visible size after hull conversion. If you compensated for the old collision size, check these objects after rebuilding. If you need a moving object with a more precise collision shape, try using a keyframed object instead. Source: https://docs.sansar.com/create/world-editor/object-motion-types --- # Importing Items to Sansar Importing items into Sansar depends on where you intend to use them. Currently, players have access to two separate inventories: one for avatar-related items and another for world-building assets. These inventories are not connected, so you must import your items based on their intended purpose. The Import guides found in [Importing Things to Sansar](/create/import/importing-items.md) are separated into the specific type of items you may be trying to bring in, please see these guides. ## Avatar inventory import guides - [Avatars](/avatars/import/importing-avatar-related-items.md) - [Accessories](/avatars/import/importing-accessories.md) - [Marvelous Designer Clothing](/create/marvelous-designer/import-export.md) - [Rigged Clothing](/avatars/import/importing-avatar-related-items.md) - [Emotes](/avatars/import/importing-custom-emote-animation.md) - [Hair](/avatars/import/importing-avatar-related-items.md) ## World build inventory import guides - [General prop items](/create/import/importing-world-items.md) - [Skybox](/create/import/importing-a-skybox.md) - [Audio](/create/audio-and-video/working-with-audio.md) - [Collision Volumes](/create/import/importing-collision-volumes.md) - [Custom Scripts](/create/import/importing-custom-scripts.md)
Source: https://docs.sansar.com/create/import/importing-items --- # Supported file types ## Objects Currently, you may import the following item types. For tips on uploading each file type into Sansar and adding them into your Scene see the other sections contained in: [Importing things to sansar](/create/import/importing-items.md) | Category | Supported File Types | |---------------|---------------------------------------| | 3D Objects | .fbx, .obj | | Scripts | .cs | | Sound | .wav (Uncompressed PCM or ADPCM),
.ambix / .ambix.wav (Ambisonic),
.mp3 / .mp2, .flac, .ogg, .aif / .aiff, .wma, .it / .mod / .s3m / .xm | | Skyboxes | .exr | | Clothing and Hair | .fbx, .obj, .samd | | Accessories | .fbx, .obj | | Avatars | .fbx | ## Texture Maps The following maps are used in sansars predefined shaders, you are able to utilize the color channel of your texture maps. some maps use black and white to keep it simple indicated by 'BW' but you can use the RGB channels listed instead. for more info see: [Shaders and Materials](/create.md#materials) ### Selling This Asset Type To sell this asset type, follow this guide: [Selling Materials](/store/selling/selling-materials.md). | Map | Supported File Type | Supported Channels | |-----------------------|---------------------|--------------------| | Albedo | .png | RGBA | Normal | .png | RGB OpenGL | Roughness | .png | BW - RG | Metalness | .png | BW - R | Ambient Occlusion | .png | BW - | Emissive | .png | BW - RGBA | Emissive Mask | .png | BW - RGBA | Displacement | .png .exr | BW - RGB | Displacement Factor | .png .exr | BW - RGB | Blend | .png | RGBA Source: https://docs.sansar.com/create/import/supported-file-types --- # AABB Bounding Box and Item Restrictions ## What is the AABB?

The AABB and Animation Cube

The AABB, or 'Active Area Bounding Box,' is a set size limit for avatars, clothing, accessories, and emotes. All parts of the mesh and skeleton of avatars, clothing, and avatar accessories must be within the bounding boxes to be imported. ## AABB Reference Files
File NameDescription
AABB v2.fbx AABB v2.blendExperimental AABB's
AABB v1.fbxOutdated AABB's Pre 2023
## Avatar and Accessory Bounding Box The Maximum bounding box is the size limit for avatars, clothing and accessories. Avatars must also be over the minimum bounding box but clothing and accessories need only adhere to the maximum.

Maximum Bounding Box

Minimum Bounding Box

## Animation Bounding Box Emote animations are bound to a different much larger bounding box, All bones must remain within the animation box to be able to import the emote.

Animation Bounding Box

## World items World items used for building worlds are not bound by any restrictions in terms of size but is suggested to use a avatar mesh as a size reference ## AABB Changes The AABB was expanded Late 2023 on an experimental basis to allow greater freedom to creators, now allowing items to be placed into the floor in order to hide them plus more room in front for held items like swords, staves, umbrellas etc and animations to be able to pass through the ground.\ some bugs are expected and the AABB is subject to change.

Experimental AABB expansion

## Item Restrictions \ Certain requirements and restrictions are applicable to the import of avatar-related items. Please ensure that your items adhere to these guidelines. All items must fit within the boundaries of the AABB. For world-building items, there are currently no restrictions in place. However, it is recommended to keep textures below 4k and maintain lower polygon counts that correspond to the intended size and visibility of the items. This approach will help avoid any adverse impact on performance. | Asset type | File type | Triangle count | | --------------- | ---------------------------------------------------------------- | -------------- | | Hair |

.fbx, .obj (rigged mesh)

.samd (Marvelous Designer)

| 12,000 | | Clothing |

.fbx, .obj (rigged mesh)

.samd (Marvelous Designer)

| 8,000 | | Accessory | .fbx, .obj (rigged mesh) | 5,000 | | Emote Animation | .fbx | 30seconds | | Avatar | .fbx, .obj | 40,000 | Source: https://docs.sansar.com/create/import/aabb-bounding-box-and-item-restrictions --- # Importing World Items Importing items into your World Build Inventory in Sansar is done by using the Import menu in the toolbar at the top of the screen. ## Selling These Asset Types To sell asset types that use this importer, follow these guides: * [Selling Mesh Objects](/store/selling/manage-listings.md) * [Selling Collaborative Assets](/store/selling/manage-listings.md) * [Selling Multiple Objects](/store/selling/manage-listings.md) ### Importing items to Sansar The following instructions apply to all content types: 1. To start importing an item into Sansar, first enter edit mode by clicking the **Edit scene** button on any of your projects under the My Experiences App. 2. Once your scene loads, look at the toolbar at the top of the screen. Click **Import**, then select a content type from the menu. This opens an Import panel for that specific content type. 3. In the Import panel, click **Browse**. 4. Once the browse panel is open, select the file from your drive. For information on what file types Sansar supports, see [supported file types](/create/import/supported-file-types.md) below. * (Optional) If you are uploading a 3D model, we encourage you to add a [collision mesh](/create/import/importing-collision-volumes.md) to make your objects dynamic in the Scene. Click **Browse** under **Optional collision/physics mesh** to add a .fbx or .obj file and to use it as the object's collision volume. * If your object has a collision mesh, you may choose a starting **Motion type** for the object. For more information on motion types, see [Object motion types](/create/world-editor/object-motion-types.md). * For 3D models, you may click **Materials Settings** to change the object's shaders and textures at this time. See [Materials editing and shaders](/create/materials/materials-editing-and-shaders.md) for additional information. 5. Under the **Item name in Inventory**, enter an appropriate name for the item. Keep in mind that this name can not be changed once the item has been uploaded in Sansar. **Note:** If you are a seller who plans to sell items in the Sansar Store, make sure to think about the name of your item carefully. The Item Name is the name that appears in the buyer's inventory once they have purchased the item. 6. Once you are ready to upload your item to Sansar, press **Upload**. 7. A status panel appears as your item uploads into Sansar. Press **Close** on the status panel once this upload process is complete. 8. Once your file is uploaded, you can find it in the Inventory panel under the **All** or **Created** tab. Source: https://docs.sansar.com/create/import/importing-world-items --- # Importing Collision Volumes This page covers importing of collision volumes see [Collision Volumes](/create/world-editor/collision-volumes.md) for info on what they are and do. Collision volumes are currently only editable on world items and not avatars or avatar based objects. ## Adding a collision mesh on import When importing your item a second field is available for your collision mesh file we highly suggest you do not use your Render mesh file as your collision. if you wish to set the [Motion type](/create/world-editor/object-motion-types.md) you are required to have a collision volume. You can add a system volume later but it is limited to a 'Cube' and 'Sphere'.
[Image: scene volumes]

## Setting up a file for automatic collision import It is also possible to setup your original objects .FBX to bring in collision volumes automatically when you follow the naming convention within a program like blender, your intended volume must have the naming convention of 'yourmeshname_collision' you can import multiple volumes and multiple meshes at the same time this way when exporting have them all selected and make sure the transforms and origin points are the same between object and collision.
[Image: scene volumes]

## Adding a collision to an existing object Existing objects that did not originally contain a collision on import can be given new volumes but only from the two system types 'Cube' and 'Sphere' you are able to add multiple volumes to an object to build up a new shape. Its not currently possible to add a new custom shape to an object without reimporting it. 1. Select the object and right click. 2. Left Click 'add' then select 'Volume' 3. A structure panel should automatically open if not 'Right click the object and select 'Structure' 4. locate the newly added Volume left click to select it and then right click then select 'properties' you can now manipulate the volume and adjust some settings like size and position relative to the render mesh. ## removing a collision volume from an object In the structure menu right click the Volume you wish to remove and select 'Delete' if this was a Mesh Volume it is not able to be recovered and you will need to respawn the original from your inventory. Source: https://docs.sansar.com/create/import/importing-collision-volumes --- # Importing Materials ## Selling This Asset Type To sell this asset type, follow this guide: [Selling Materials](/store/selling/selling-materials.md). For supported texture map types and channels, see [Supported file types - Texture Maps](/create/import/supported-file-types.md#texture-maps). placeholder overview: To create a material asset import maps onto any object you own with the amount of material slots you wish, a cube will suffice, setup the shader settings, save materials, then right click the object and save the entire material setup to inventory. Improved guide coming soon... Source: https://docs.sansar.com/create/import/importing-materials --- # Importing Custom Scripts
## Import a custom script You must be editing a scene in order to import a custom script, it is suggested to create a blank scene to use for testing purposes as in order to test the script you must build the world and visit. 1. Navigate to edit mode via the left side menu and edit a scene of your choice or create a new one.
[Image: Customize avatar]

2. At the top left press 'Import' then 'Script'
[Image: Customize avatar]

3. Click 'Browse' and choose the script file you wish to import, you can import files with the extensions .cs or .json 4. Name your script, this is the name it will appear with in your inventory. 5. Click 'Import' and the importer will start compiling, if the script compiles it is now added to your inventory, if not check the log tab for more information on what the problem may be. 6. You can now test your script by adding it to a object in the scene then you must build and visit the world during runtime to test. If you are the owner of a world you can press CTRL+D to open the Debug window for scripts in a scene, this is where your `Log.Write(" ")` messages would appear for your scripts. Source: https://docs.sansar.com/create/import/importing-custom-scripts --- # Importing a Skybox ## Overview A short overview for skyboxes: - Supported import format is `.exr`. - The input image must be a horizontal 6:1 strip where `width = 6 * height`. - If the image is not exactly 6:1, the skybox import fails. - Skybox processing uses an HDR cubemap path with preview disabled. - Effective maximum imported size is `24576 x 4096` (which is `4096 x 4096` per cube face). - Per-face dimensions are capped at `4096`, so larger inputs are clamped to that maximum. ## What Is a Skybox? A skybox is a large cube that surrounds an entire scene and represents the sky and distant environment. Each face of the cube has an image applied to it, creating the illusion of a world beyond the playable area. Skyboxes also affect scene mood by influencing lighting color, tone, and atmosphere. ## Creating a Skybox Map Skybox textures are mapped onto a cube, so your source image must follow a strict 6:1 layout (six square faces in one horizontal strip).
[Image: Skybox face orientation layout]

Skybox strip orientation order from left to right: +X, -X, +Y, -Y, +Z, -Z.

you can get the matching skybox here to see in world [Sansar Skybox Orientation](https://www.sansar.com/store/listings/71fbe0ef-0fea-4c0a-a397-8e4042f3b7e6/sansar-skybox-orientation) - Sansar skyboxes use `Y+` as up and `Z+` as forward. - Use `.exr` for skybox source files. - Keep your strip within the effective maximum limit of `24576 x 4096` (`4096` per face). - Try to use smaller texture resolution if you can for performance. a full blender step by step guide coming soon.... ## Importing to Sansar 1. Open an Edit Mode scene.
[Image: Main menu create and build options]

2. From the top toolbar, choose **Import** and select **Skybox**.
[Image: Skybox import panel]

.

3. Browse to your `.exr` skybox strip file.
[Image: Skybox import settings]

4. Wait for import to complete. These can take several minutes due to size. If an error occurs, confirm the image follows the required 6:1 layout. 5. Enter an item name for your inventory and upload. 6. After upload, apply the imported skybox from scene settings.
Source: https://docs.sansar.com/create/import/importing-a-skybox --- # Troubleshooting Import Errors This page lists common import-time error messages in Sansar and possible fixes. Related FAQs: [General FAQ](/help/general-faq.md) | [Error Message FAQ](/help/error-message-faq.md) ## General import errors ### Upload Failed - [item name] Solution: Try the import again. If it fails again, use the more specific error shown in the importer or log to identify the actual cause. --- ### Opening Material Editor Failed - [item name] Solution: Deselect the object and reselect it again, then try. --- ### Something went wrong during the upload. Please try again. Solution: Retry the upload. If it repeats, check the specific importer message or log entry shown with it. --- ### Failed to import the item in Sansar. Solution: Check the more specific importer error or log entry, correct that issue, then re-export and import again. --- ### Unable to load resource Id Solution: _A confirmed solution has not been documented for this error yet._ --- ### Upload failed Solution: Retry the upload. If it fails again, use the more specific error shown in the importer to find the actual cause. Can be VPN related or size of the object is large, trying again will continue from current progress. --- ### Failed to add item to inventory Solution: Check the specific importer error that appeared with the failure, correct that issue, then reimport. --- ### Compile status unknown Solution: The servers may be having issues, try again. ## Converter and pipeline errors ### Loading filters failed Solution: _A confirmed solution has not been documented for this error yet._ --- ### Unable to set the Havok tools root directory environment variable Solution: _A confirmed solution has not been documented for this error yet._ --- ### Can't load FilterManager '[path]' Solution: _A confirmed solution has not been documented for this error yet._ --- ### Loding option file failed Solution: _A confirmed solution has not been documented for this error yet._ --- ### Errors happened during option filters processing Solution: _A confirmed solution has not been documented for this error yet._ --- ### Can't find processed scene after running filters Solution: _A confirmed solution has not been documented for this error yet._ --- ### Unable to load oodle library, error code [code] (0x[code]) Solution: _A confirmed solution has not been documented for this error yet._ --- ### Can't resolve path for '[path]' Solution: Make sure the referenced file path is valid and that the file still exists in that location, then retry the import. --- ### Failed to load hko file '[path]' Solution: Make sure the referenced file exists and can be opened, then retry. --- ### Failed to acquire filter interface Solution: _A confirmed solution has not been documented for this error yet._ ## Thumbnail and inventory image errors ### Invalid image file format: [ext]. Valid image file formats are: [list]. Solution: Use one of the listed image formats and reselect the image file. --- ### Invalid image file format: [ext]. The only valid image file format is [ext]. Solution: Convert or re-export the image to the required file format, then try again. --- ### File does not exist. Solution: Browse to an image file that still exists on disk or check the path exists, check path is correct. --- ### Could not open file. Solution: Make sure the file can be opened normally, is not locked by another app, and that you still have access to its location. --- ### File size mismatch. Solution: Re-export the image file and try again. --- ### File size must be less than [size] MB Solution: Reduce the image file size so it is under the limit, then upload it again. --- ### Could not load PNG image data Solution: Use a valid PNG file and re-export it if needed before uploading again, Image file may be corrupted, try a fresh copy. --- ### Could not decode PNG image data Solution: Re-export the image as a standard PNG and try again. --- ### Unsupported image size: [width] x [height]. Your image must be between [min] x [min] and [max] x [max]. Solution: Resize the image so it falls within the allowed width and height range, then retry. --- ### Unsupported aspect ratio: [width]:[height]. Your image must have an approximate aspect ratio of [width]:[height]. Solution: Crop or resize the image to match the required aspect ratio, then upload it again. --- ### Failed to upload Thumbnail Solution: Use a valid thumbnail image that meets the format, file size, size, and aspect-ratio requirements, then retry, Can be connection related. ## Avatar, clothing, accessory, and animation import errors ### Multiple skeletons ([count]) found. Character imports require a single skeleton! Solution: Re-export the file with only one skeleton or armature in it, Make sure only one armature modifier is present, make sure to only export selected and not an entire scene. --- ### This item is missing information on the avatar skeleton. Please ensure that the skeleton data is included. Solution: Re-export the file with the skeleton included and make sure it is rigged against Sansar's current reference skeleton. --- ### This item could not be added to the inventory because its AABB extends beyond the Avatar's AABB. Refer to the Knowledge base for guidelines. Solution: Resize or reposition the mesh and skeleton so they stay inside the current AABB limits. Use the AABB reference files to check your bounds before exporting, Toggle the experimental Apply Transforms tickbox in blender. --- ### This item could not be added to the inventory because its AABB is over the maximum AABB limit for custom Avatars. Refer to the Knowledge base for guidelines. Solution: Scale the avatar down so it fits inside the maximum AABB, then re-export, Make sure no stray verts are outside the limit, Toggle the experimental Apply Transforms tickbox in blender --- ### This item could not be added to the inventory because its AABB is below the minimum AABB limit for custom Avatars. Refer to the Knowledge base for guidelines. Solution: Scale the avatar up so it is above the minimum AABB, then re-export. --- ### This item could not be added to the inventory because it has [count] triangles. Attachments may only have [count] triangles. Solution: Reduce the accessory mesh to 5,000 triangles or fewer, then re-export. --- ### This item could not be added to the inventory because it has [count] triangles. Clothing may only have [count] triangles. Solution: Reduce the clothing mesh to 8,000 triangles or fewer, then re-export. --- ### This item could not be added to the inventory because it has [count] triangles. Hair may only have [count] triangles. Solution: Reduce the hair mesh to 12,000 triangles or fewer, then re-export. --- ### This item could not be added to the inventory because it has [count] triangles. An imported avatar mesh may only have [count] triangles. Solution: Reduce the avatar mesh to 40,000 triangles or fewer, then re-export. If needed, use decimation on the mesh before exporting. --- ### This item could not be added to the inventory because it contains no avatar mesh data. Solution: Re-export the avatar with the mesh included, then import it as an avatar item. --- ### This item could not be added to the inventory because it contains no accessory data. Solution: Make sure the file contains the accessory mesh and import it from the Accessories tab. --- ### This item could not be added to the inventory because it contains no clothing data. Solution: Make sure the file contains the clothing mesh and import it from the Clothing tab. --- ### This item could not be added to the inventory because it does not contain an animation Solution: Re-export the FBX with an animation clip included. --- ### This item could not be added to the inventory because it contains more than one animation Solution: Export one animation per FBX file, then import the clip you want. --- ### This item could not be added to the inventory because the animation is [length]s long. An imported animation must be less than 30s long. Solution: Shorten the animation so it is under 30 seconds, then re-export. --- ### This item could not be added to the inventory because the animation is [length]s long. An imported animation must be greater than 0.6s long. Solution: Lengthen the animation so it is longer than 0.6 seconds, then re-export. --- ### This item could not be added to the inventory because animation's AABB extends beyond the Avatar's AABB. Refer to the Knowledge base for guidelines. Solution: Keep all animated bones inside the animation AABB, then re-export. Use the AABB reference files to check the animation bounds. --- ### The following bone is missing with respect to the reference skeleton. Please check Sansar skeleton and skinning details on the help center for more information: [bone] Solution: Rig the item to Sansar's current reference skeleton and make sure the listed bone is present before exporting again. --- ### The following bones are missing with respect to the reference skeleton. Please check Sansar skeleton and skinning details on the help center for more information: [bones] Solution: Rig the item to Sansar's current reference skeleton and make sure all listed bones are present before exporting again. --- ### The following bone is not following the correct hierarchical order with respect to the reference skeleton. Please check Sansar skeleton and skinning details on the help center for more information: [bone] Solution: Rebuild the rig so the bone hierarchy matches Sansar's reference skeleton exactly, then re-export. --- ### The following bones are not following the correct hierarchical order with respect to the reference skeleton. Please check Sansar skeleton and skinning details on the help center for more information: [bones] Solution: Rebuild the rig so the listed bones follow Sansar's reference hierarchy exactly, then re-export. --- ### The mesh is skinned to the following bone which is not present in Sansar's reference skeleton. Please check Sansar skeleton and skinning details on the help center for more information: [bone] Solution: Remove weights from bones outside Sansar's reference skeleton and re-skin the mesh to the supported bones only. --- ### The mesh is skinned to the following bones which are not present in Sansar's reference skeleton. Please check Sansar skeleton and skinning details on the help center for more information: [bones] Solution: Remove weights from bones outside Sansar's reference skeleton and re-skin the mesh to the supported bones only. --- ### The AABB for the asset's skeleton is below the minimum AABB limit for rigged assets. Refer to the Knowledge base for guidelines. Solution: Scale the rigged asset up so the skeleton is above the minimum AABB, then re-export. --- ### The AABB for the asset's skeleton is over the maximum AABB limit for rigged assets. Refer to the Knowledge base for guidelines. Solution: Scale the rigged asset down so the skeleton fits inside the maximum AABB, then re-export. --- ### The item was created against the old avatar skeleton that is no longer supported. Please check out Avatar Reference Files on the help center to get the latest files. Solution: Rebuild the item against the current Avatar 2.0 reference files and re-export it. --- ### Failed to load reference skeletons Solution: Make sure the file contains the skeleton and try again. --- ### animation file contains no animations data Solution: Re-export the file with animation data included, make sure to click bake on export. --- ### animation file contains no animation binding Solution: Re-export the animation with the Sansar animation skeleton binding included. If you are using Mixamo, download the FBX with Skin. --- ### animation file contains no animation pose Solution: Re-export the file with keyed pose data in the animation. --- ### Animation data not found Solution: Re-export the file with animation data included. --- ### Animation bindings not found Solution: Re-export the animation so the skeleton binding data is included. --- ### Animation for skeleton [name] has [count] bones which exceeds the 256 bone limit. Solution: Retarget or simplify the animation so it uses 256 bones or fewer. If possible, use Sansar's low-resolution animation skeleton for emotes. ## Rig, skeleton, and animation-conversion errors ### Cannot open supplied rig file to create bone list Solution: Make sure the supplied rig file exists and the path to it is correct, then retry. --- ### Can't load file '[path]' Solution: Make sure the referenced file still exists at that path and can be opened, then retry. --- ### Unable to open arguments file '[path]', Error: [error] Solution: Make sure the referenced file exists and is accessible, then retry. --- ### Please check the position of the following bones and ensure that they are in the right position with respect to the reference skeleton: Solution: Move the listed bones back to the positions used by Sansar's reference skeleton, then re-export. Do NOT rotate or scale any bones. --- ### [bone] has position ([x], [y], [z]). Expected position ([x], [y], [z]) Solution: Match that bone's position to the reference skeleton, then re-export. Do NOT rotate or scale any bones. --- ### Please check the rotation of the following bones and ensure that they are in the right rotation with respect to the reference skeleton: Solution: Reset the listed bones to the same rotations used by Sansar's reference skeleton, then re-export. Do NOT rotate or scale any bones. --- ### You can only change the position of the bones. You cannot change the rotation of the bones. Please check the rotation of the following bones and ensure that they are in the right rotation with respect to the reference skeleton: Solution: Reset the listed bones to the reference skeleton rotations. Bone rotations should not be changed. Do NOT rotate or scale any bones. --- ### [bone] has rotation ([x], [y], [z]). Expected rotation ([x], [y], [z]) Solution: Reset that bone's rotation to the reference value, then re-export. --- ### Please check the scale of the following bones and ensure that they are in the right scale with respect to the reference skeleton: Solution: Reset the listed bones to the same scales used by Sansar's reference skeleton, then re-export. --- ### You can only change the position of the bones. You cannot change the scale of the bones. Please check the scale of the following bones and ensure that they are in the right scale with respect to the reference skeleton: Solution: Reset the listed bones to the reference skeleton scales. Bone scale should not be changed. --- ### [bone] has scale ([x], [y], [z]). Expected scale ([x], [y], [z]) Solution: Reset that bone's scale to the reference value, then re-export. --- ### No scene container found. Solution: Re-export the file and make sure it contains actual scene data. --- ### No scene data found. Solution: Re-export the file and make sure the mesh, skeleton, or animation data is actually included. --- ### No scene data found Solution: Re-export the file and make sure the mesh, skeleton, or animation data is actually included. --- ### No bones or float slots in this skeleton. Solution: Re-export the file with a real skeleton included. Make sure you used an actual armature and not placeholder mesh. --- ### No bones in this skeleton - using only float slots. Solution: Re-export the file with a real skeleton included. --- ### Rig file path is empty Solution: Provide a valid rig file path before retrying the import. --- ### Couldn't open rig file: [path] Solution: Make sure the rig file exists at that path and can be opened, then retry. --- ### Skeletons not present Solution: Re-export the file with the skeleton included. ## Mesh and geometry import errors ### Mesh '[name]' is missing 'Vertice' channel Solution: Re-export the mesh with vertex position data included. --- ### Mesh '[name]' is missing 'TexCoord' channel Solution: UV unwrap the mesh and re-export it with texture coordinates included. --- ### Mesh '[name]' is missing 'Normal' channel Solution: Re-export the mesh with normals included. --- ### Mesh '[name]' is missing 'Tangent/Binormal' channel Solution: Re-export the mesh with tangents and binormals included. --- ### Unsupported index buffer type, expected triangles Solution: Triangulate the mesh before exporting, then reimport it. --- ### Mesh Data is not valid! Solution: Make sure to export with valid mesh and not geometry nodes or particles. ## Material and texture import errors ### Edit failed: one texture source could not be fetched from the cloud. If your edit was a normal map, try assigning a roughness map as well (or vice-versa) Solution: Retry the edit. If you are editing a normal map, also assign a roughness map, or do the reverse if you are editing roughness. --- ### Edit failed: the path [path] could not be resolved to an actual disk location. Solution: Make sure the referenced texture path is still valid and points to a real file on disk. --- ### Edit failed: couldn't write to temporary image file [path]. The disk might be full, or writing to this location disallowed. Solution: Free disk space or use a location your account can write to, then try again. --- ### Unable to locate material mapping named '[name]' Solution: Use a valid material mapping or re-create the material setup and retry. --- ### Unable to load material type descriptors, no path provided Solution: No path was given. --- ### Unable to load material type descriptors from file: [path] Solution: Make sure the referenced descriptor file exists and can be opened, then retry. --- ### Unable to get [texture field] abstract path: [path] Solution: Make sure the referenced texture file path is valid and still exists. --- ### Unable to load texture resource: [texture field] Solution: Reassign that texture field to a valid texture file and retry. --- ### Error processing texture field '[field]' for material Solution: Remove and reassign that texture, then retry the import. --- ### Unable to locate texture field thought to have existed: '[field]' Solution: _A confirmed solution has not been documented for this error yet._ --- ### Duplicate value for '[field]' will be ignored Solution: Remove the duplicate field entry from the material setup or layout file. --- ### Unable to get texture field name for '[field]' in material type '[type]' Solution: Use a supported material type and valid texture field names for that shader. --- ### Unable to get float field name for '[field]' in material type '[type]' Solution: Use a supported material type and valid float field names for that shader. --- ### Unable to get vector field name for '[field]' in material type '[type]' Solution: Use a supported material type and valid vector field names for that shader. --- ### Unable to get color field name for '[field]' in material type '[type]' Solution: Use a supported material type and valid color field names for that shader. --- ### Unable to get bit field name for '[field]' in material type '[type]' Solution: Use a supported material type and valid bit field names for that shader. --- ### Unable to create material descriptor - no instance of qualified material type found Solution: Use a supported Sansar material type and retry. --- ### Unknown material type - [type] Solution: Change the material to a supported Sansar material type, then retry. --- ### No material layout file provided Solution: Provide a material layout file if your import depends on one, or rebuild the material setup and retry. --- ### Invalid material layout file - texture file ([count]) and texture resource ([count]) count do not match texture layer count ([count]) Solution: Fix the material layout so the texture files and texture resources match the number of texture layers. --- ### Invalid material layout file - texture file name '[name]' does not match texture layer name '[name]' Solution: Rename the texture file entry so it matches the texture layer name exactly. --- ### Invalid material layout file - texture resource name '[name]' does not match texture layer name '[name]' Solution: Rename the texture resource entry so it matches the texture layer name exactly. --- ### Unable to locate material type descriptor: '[shader]' Solution: Use the correct shader identifier for a supported Sansar material type. --- ### Ensure you use the system not descriptive name of the shader required Solution: Use the shader's system name instead of its descriptive display name. --- ### Primary file resource for '[resource id]' is missing or invalid. Solution: Reassign the missing primary file resource to a valid file, then retry. ## Script import errors ### Cannnot initialize Asset Store with output file path [path] Solution: _A confirmed solution has not been documented for this error yet._ --- ### Cannot finalize Asset Store for serialization Solution: _A confirmed solution has not been documented for this error yet._ --- ### Cannot serialize to import file '[path]' Solution: _A confirmed solution has not been documented for this error yet._ --- ### Cannot load input file '[path]' Solution: Make sure the referenced script or project file exists at that path and can be opened. --- ### Importing [script]: Could not load file Solution: Make sure the file exists and is still in the location you selected. --- ### Importing [path]: Could not read file Solution: Make sure the file is readable, not locked by another app, and that you still have permission to access it. --- ### Cannot serialize to source file '[path]' Solution: _A confirmed solution has not been documented for this error yet._ --- ### Importing [script]: Compilation failed: [error] Solution: Import the script while editing a scene, open the Log tab to review the compile error, fix the script, and try again. Supported script imports are `.cs` files and `.json` script project files. ## Behavior project import errors ### Could not load [path] as a Behavior project. Solution: Make sure the selected file is a valid Behavior project and that its referenced files still exist. --- ### Could not load Behavior Project [path] Solution: Make sure the project file exists and can be opened, then retry. --- ### No characters found in project file [path] Solution: _A confirmed solution has not been documented for this error yet._ --- ### Cannot load character file: [path] Solution: Make sure the referenced character file exists and can be opened. --- ### Rig filename for character [name] is null in project [path] Solution: Set a valid rig file for that character in the project, then retry. --- ### Could not load Behavior Graph: [path] Solution: Make sure the referenced Behavior Graph file exists and can be opened. --- ### Could not load Character [path] Solution: Make sure the referenced character file exists and can be opened. --- ### Cannot load skeleton file: [path] Solution: Make sure the referenced skeleton file exists and can be opened. --- ### Skeleton file does not have a valid animation container: [path] Solution: _A confirmed solution has not been documented for this error yet._ --- ### Could not load Behavior Graph: Solution: Make sure the referenced Behavior Graph file exists and that its dependencies are valid. --- ### Behavior graph has circular dependencies. Solution: Remove the circular references in the Behavior Graph, then retry. --- ### The asset in the animationBundle doesn't have a corresponding fixed animation filename.. Solution: _A confirmed solution has not been documented for this error yet._ --- ### Animation bundles are not supported: [path] Solution: Import the animations as supported individual animation files instead of an animation bundle. --- ### Cannot parse character filename into character name.: [path] Solution: _A confirmed solution has not been documented for this error yet._ --- ### Cannot load project file: [path] Solution: Make sure the project file exists and can be opened, then retry. Source: https://docs.sansar.com/create/import/troubleshooting-import-errors --- # Materials editing and shaders ## Materials editing and shaders ### Materials editing and shaders Instead of using the Phong shader in your 3D modeling tool, you can use the Materials Settings panel to apply shaders and texture maps to objects. ## Accessing Materials Settings ### Access Materials Settings when uploading an object in edit mode 1. Click **Import > 3D Model** in the top toolbar. See [Uploading items in Sansar](/create/import/importing-items.md). 2. When the Import 3D Model panel appears, you will need to select a .fbx file first to upload. Under 3D model file, click **Browse** and choose a 3D model (.fbx or .obj) from your computer. 3. Once a file is selected, click the **Materials Settings** button to access the **Materials Settings** panel.\ | [Image: Import 3D model panel with fields for the model file, an optional collision mesh, and the item name] | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | The upload panel once a .fbx file has been selected from your local drive. | ### Access Materials Settings for an object that is already in a scene You can edit materials on objects placed in a scene, save materials to your inventory, and copy and paste materials between objects. Saving a material preset requires its original texture imports. 1. Find the object in the Scene Objects panel. 2. Right-click the object's name and choose **Materials...** | **Note:** When changing materials settings for an object that is already in a scene, those changes are previewed on the object. The changes are reverted if you close the Materials Settings panel by clicking **Cancel.** | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Image: Scene Objects panel with an object menu open and an arrow pointing to Materials] | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Accessing the Materials Settings panel for an object that is already in the scene. | #### Materials Settings panel overview | [Image: Materials Settings panel with callouts for the list of materials, the shader selector, and the Browse buttons for texture maps] | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | The Materials Settings panel. | ### Loaded materials The **Loaded materials** list shows the materials applied to the model at the time of upload. If no materials are assigned, a single default material is applied to all parts of the model. Select each material to assign a shader and texture maps to each. ### Shader Setting The **Use shader** dropdown lists all shaders that can be applied to the currently selected object part. Each shader is ideal for a different application, and comes with its own subset of possible texture maps. For a full list of available shaders and some suggested uses, see [Shaders](/create/materials/shaders-information.md). | [Image: Three example crates rendered with different shaders: standard, transparent, and emissive] | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | Example usage of **Standard**, **Standard+Alpha Mask**, and **Standard+Emissive** shaders. | ### Applying maps | [Image: Materials Settings panel with a callout explaining that texture maps can be imported with the model or chosen with the Browse button] | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | Choose one of the object's existing texture maps or click the **Browse** button to choose one from your computer. | For each kind of map supported by a shader, you may choose any of the object's existing textures from the dropdown, or choose **Custom Texture File**. If you choose a custom texture, click **Browse** to choose a suitable texture from your computer to use as the map. ### Tips Here are a few tips to help you get the most out of Shaders and Materials * The maximum texture resolution is 4096 x 4096 pixels. * When in doubt, use the simplest shader you can. If you don't need an alpha mask, don't use a shader with that feature. The **Standard** shader is the fastest, most efficient shader available. * Sansar uses a custom physically based renderer (PBR) and doesn't use specular maps. However, Sansar does use roughness and metalness maps to define the specular highlights of an object. * When applying maps on an object that is already in the scene, a preview of the result is shown on the object in the scene. If you choose to cancel your changes, the object reverts back to its previous maps. Known changes * As of July 18th, 2018, the Tint attribute, which affects the color of a surface, now affects emissive surfaces. Previously, Tint attribute only affected non-emissive surfaces. This means that emissive textures (e.g. a light bulb) can now be colored via “Tint”. However, these changes may affect existing content where the Tint value had been changed from the default value. Source: https://docs.sansar.com/create/materials/materials-editing-and-shaders --- # Shaders Information ## What is a shader? Shaders are what determines the appearance of all objects in sansar, each shader is capable of different looks and effects, some make items glow, others make them follow the camera and some even have the ability to make items morph and textures animate! Sansar has a predefined set of shaders and you must choose from these when making assets for avatars and edit world mode, below is a list of every shader in sansar and what they are capable of try to pick the lightest shader possible for the item you are creating. Every shader has Map slots that accepts a image texture, Most maps accept PNG and JPEG, Displacement accepts PNG or EXR, sansar shaders uses the PBR Metallic+Roughness workflow and is OpenGL Normal. See [Materials information](/create/import/supported-file-types.md) for more. ## Selecting a shader **In Edit mode -** Right clicking a object or opening the structure menu if a asset contains multiple objects and right clicking the meshname from there then selecting 'Materials' from the drop down will open the materials Settings menu **In Lookbook -** During the import of a item select the 'Materials Settings' Button at the bottom of the import menu Each material slot on a asset can have a different shader allowing objects to have multiple different effects and texture sets on them, each material slot and shader you have on a object will increase the impact on performance try to keep these as low as possible.

The left menu is the material slots and the dropdown on the top right is where you select what shader you want to use

The following _shaders_ and settings can be applied to objects retroactively during Edit mode and can be changed and previewed while changing settings, currently you must set everything up during the import process for avatar items in lookbook. It is highly recommended to test your settings in edit mode as you can see the changes live. ## Shader weights Shaders in Sansar fall into the following _weight_ categories, according to their potential impact on performance: * **Feather weight** - Lowest performance impact. Use these shaders as much as you like. * **Light weight** - Moderate performance impact. Use these shaders in specific cases to achieve a desired effect, but try to avoid applying them to objects that don't require them. * **Heavy weight** - Substantial performance impact. Use these shaders sparingly! If overused, these shaders can cause a significant drop in performance. ## Shader Notes * _Alpha mask_ shaders should not be used for transparent assets such as water or glass. The alpha mask threshold and softness values are used to remove artifacts and jagged edges from the opaque portions of the masked texture. Alpha masks are meant to create areas of 100% or 0% transparency and nothing in between. Instead, use **Transmissive + Emissive**, **Transparent**, or **Transparent + Multibump** when intermediate transparency is needed. * All shaders have the ability to be tinted, located at the bottom of each shaders menu is a eye dropper button and number fields for sRGB this is additive to the Albedo's color map, for best results using a greyscale map will yield matching tint colour but is not necessary. * Some of the settings can be adjusted via scripting live in runtime see [Shader Scripting](/create/materials/shader-scripting.md) for more * Displacement is a new addition in its early release (Oct 2023) and has static and animated forms, it is not intended to replace Normal Map detail as assets would be too high poly for this to be effective, it is however able to manipulate mesh within the edit mode without the original upload files. see the [Displacement guide](/create/materials/displacement-guides.md) for more. *** ## Standard * Light weight * A basic, high performance, general shader. Suitable for most Assets, texture is only visible on one side. * Has static displacement * UV scale + UV rotate ## Standard Two Sided * Light weight * Slightly heavier than the Standard shader, but suitable for single-sided planes that can be viewed from both sides. * Has static displacement * UV scale + UV rotate ## Standard + Alpha Mask * Light weight * Allows fully transparent and opaque areas on a surface. Useful for details on objects such as hair, leaves, or chain-link fences, texture is only visible on one side. * Mask Threshold + Softness * Has static displacement * UV scale + UV rotate ## Standard Two Sided + Alpha Mask * Light weight * Allows both sides of an alpha shader's texture to render. Use cases include grass, bushes, or chain-link fences that are visible from both sides. * Mask Threshold + Softness * Has static displacement * UV scale + UV rotate ## Standard + Emissive * Heavy weight * Similar to the Standard shader, but additionally allows portions of the texture to glow. Examples include texture with glowing lights, such as a car with glowing headlamps. * Because emissive lighting affects scene lighting, emissive shaders should be used sparingly. * Accepts a Emissive Map and contains a intensity slider * Has static displacement * UV scale + UV rotate ## Standard Two Sided + Emissive * Heavy weight * A Two sided version of the Standard + Emissive, texture is visible from both sides and shading of textures is affected differently * Accepts a Emissive Map and contains a intensity slider * Has static displacement * UV scale + UV rotate ## Billboard * Feather weight * A surface with a single emissive or alpha texture that always faces the camera, regardless of viewing angle. Can use UV animation such as UV scrolling, or stepped frames such as a sprite sheet. * Has the following editable properties: * **Brightness**: Controls how brightly the emissive map glows. * **Flipbook - Frame:** Choose which frame the step animation begins on. * **Flipbook - Step Rate:** Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to 0, the textures will not animate and shows only the first frame. * **Flipbook - Loop:** Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture. * **Flipbook - UV Frames:** When equally divided into rectangular frames, define the number of frames your texture contains from left to right (**X**) and top to bottom (**Y**). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0. * **UV Scroll - Rate:** For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions. * **Lollipop:** Causes the surface to face the camera on the horizontal axis only; does not turn to face the camera vertically. * **ClampUV -** Stops flip book frames repeating incorrectly and fits them to the face. ## Standard + Detail * Light weight * Similar to the Standard shader, but includes a secondary detail normal map and roughness that have X Y and Z (strength) scale. This allows close-up, repeatable details to be displayed, or used to adjust the secondary maps independently from the first set. Useful for including details such as clothing threads, divots on golf balls, or wood grain. * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Standard Two Sided + Detail * Light weight * Similar to Standard + Detail, but renders textures on both sides. Useful for inspection of close-up objects that can function as 2D assets, such as a piece of paper. * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Standard + Detail + Alpha Mask * Light weight * Allows close-up detail inspection of objects that also have transparent and opaque sections of the texture, such as plant leaves. * Mask Threshold + Softness * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Standard Two Sided + Detail + Alpha Mask * Light weight - but this is the heaviest compared to the previous Detail shaders * Similar to Standard + Detail + Alpha Mask, but allows both sides of a asset to display the texture. * Alpha Mask Threshold + Softness * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Subsurface + Detail * Heavy weight * This is a performance-intensive, specialty shader that should be used only as needed. * Allows a different color to shine through a texture's diffuse colors. Bright areas of the surface begin to inherit the bleed tint colors. Useful for surfaces such as skin, stones such as jade or quartz, or other assets that display a subsurface color when exposed to bright light. * Bleed Distance: How strongly the subsurface color appears when a light shines directly on the surface. * Bleed Tint: The subsurface color that appears in bright light. * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Subsurface + Detail + Alpha Mask * Heavy weight * Similar to Subsurface + Detail, but additionally allows transparent areas. * Performance-intensive, and should only be used when absolutely necessary for a specific object. * Bleed Distance: How strongly the subsurface color appears when a light shines directly on the surface. * Bleed Tint: The subsurface color that appears in bright light. * Has static displacement * UV scale + UV rotate * Secondary detail map scaling * Alpha Mask Threshold + Softness ## Standard + Detail + Emissive * Heavy weight * Allows detail and emissive textures to be used on the same object. For example, a flashlight with a detailed handle. * Textures can only be seen from one side * Accepts a Emissive Map and contains a intensity slider * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Standard TwoSided + Detail + Emissive * Heavy weight * Similar to the Standard + Detail + Emissive * Textures can be seen from both sides * Accepts a Emissive Map and contains a intensity slider * Has static displacement * UV scale + UV rotate * Secondary detail map scaling ## Four Layer Non-Specular * Heavy weight * The most basic texture blender. Allows up to four Albedo + Normal maps to be blended using one _blend texture_ that uses red, green, blue, and black to determine where to place the diffuse textures. Most commonly used for terrain, such as to blend grass into dirt to create trails. * The colors for the blend map are as follows: * **Black:** Layer 1 * **Red:** Layer 2 * **Green:** Layer 3 * **Blue:** Layer 4 * UV Rotate - this affects all 4 map sets * UV Scale - this is controlled separately via 4 input boxes that affect each set independently denoted by X, Y, Z, W * Has static displacement ## Standard Three Layer + Detail * Heavy weight * Similar to Four Layer Non-Specular, but allows the inclusion of normal, rough, metal, and a secondary set of detail maps in addition to standard sets. * The colors for the blend map are as follows: * **Red:** Layer 1 * **Green:** Layer 2 * **Blue:** Layer 3 * UV Rotate - this affects all 3 map sets * UV Scale - this is controlled separately via 3 input boxes that affect each set independently denoted by X, Y, Z * Detail Scale - This affects the scale of the detail maps separately to the main set of maps ## Emissive + UV animation * Feather weight * The most basic light-emitting texture. Allows you to control areas of the object that appear to emit light, and areas that remain dark. Useful for skyboxes, custom-shaped lights, or neon signs. * only contains emissive map and mask no roughness, normal or metal * Has the following editable properties: * **Mask map:** Behaves like an alpha mask, except for the RGB channels of the emissive material. * **Emissive Intensity:** Toggle to set the brightness or dimness of the emissive map. * **Absorption:** Determines how much of the light coming from behind the material is prevented from being transmitted through the material (i.e. absorbed). A value of 1.00 means 100% is absorbed - thus 0% is transmitted through the material and the material will appear ‘opaque’. * **Uv Scale** - Sets the size of the UV texture. Repeats the texture if higher than 1.0. * **Flipbook - Frame:** Choose which frame the step animation begins on. * **Flipbook - Step Rate:** Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to 0, the textures will not animate and shows only the first frame. * **Flipbook - Loop:** Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture. * **Flipbook - UV Frames:** When equally divided into rectangular frames, define the number of frames your texture contains from left to right (**X**) and top to bottom (**Y**). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0. * **UV Scroll - Rate:** For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions. * **Scroll option:** Toggle which maps will be subject to the scrolling effect. * **ClampUV -** Stops flip book frames repeating incorrectly and fits them to the face. * Has Animated displacement * Fluid distortion slider (wiggly texture) ## Emissive Two Sided + UV Animation * Light weight * Similar to the Emissive + UV Animation but two sided and can be seen from both sides * UV scale * Has animated displacement * Fluid distortion slider (wiggly texture) * ClampUV **-** Stops flip book frames repeating incorrectly and fits them to the face. ## Transmissive + Emissive * Heavy weight * Allows partially see-through areas on emissive surfaces. Does not force transparent areas to become fully transparent (such as with the Alpha Mask shaders). Useful for creating surfaces that can be seen through while adding some color and emissive glow, such as stained glass. * UV scale * Emissive intensity slider ## Standard + Emissive + Stereographic * Heavy weight * Allows side-by-side or top-and-bottom 3D images to be viewed in VR. In desktop mode, only the image for the left eye is shown. * Orientation of the left and right images can be adjusted using the **Rotation Factor** property. The Rotation Factor setting is multiplied by 90 degrees as follows: * **0:** "Wall-eyed" orientation, where the left image is meant for the left eye and the right image is meant for the right eye. * **1:** Orientation where the top image is meant for the left eye and the bottom image is meant for the right eye. * **2:** "Cross-eyed" orientation, where the right image is meant for the left eye and left image is meant for the right eye. * **3:** Orientation where the bottom image is meant for the left eye and the top image is meant for the right eye. * UV scale ## Standard + Emissive + UV Animation * Heavy weight * Similar to Emissive + UV but contains the standard set of maps also * Allows flip frame or smooth scrolling of a texture that can also emit light. Useful for animating texture lights that blink on and off or flickering neon signs, glowing effects on clothing etc. * The relevant settings are as follows: * **Flipbook - Frame:** Choose which frame the step animation begin * **Flipbook - Step Rate:** Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to zero, the texture will not animate and will show only the first frame. * **Flipbook - Loop:** Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture. * **Flipbook - UV Frames:** When equally divided into rectangular frames, define the number of frames your texture contains from left to right (**X**) and top to bottom (**Y**). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0. * **UV Scroll - Rate:** For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions. * **Scroll option:** Toggle which maps will be subject to the scrolling effect. * **Fix Shimmering:** Addresses shimmering artifacts that can occur when bright emissive materials are scrolling at high speed on thin objects. * **Clamp UV -** Stops flip book frames repeating incorrectly and fits them to the face. * Has animated displacement * Fluid distortion slider (wiggly texture) ## Standard Two Sided + Emissive + UV Animation * Heavy weight * Similar to the Standard + Emissive + UV Animation but is visible from both sides * Has animated displacement * Fluid distortion slider (wiggly texture) * ClampUV **-** Stops flip book frames repeating incorrectly and fits them to the face. ## Standard + Alpha Mask + UV Animation * Heavy weight * Has the standard set of maps but also allows Alpha and UV animation * Allows flip frame or smooth scrolling of a texture that allows Alpha Masks. Useful for making _sprite_-based assets. * The relevant settings are as follows: * **Flipbook - Frame:** Choose which frame the step animation begin * **Flipbook - Step Rate:** Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to zero, the texture will not animate and will show only the first frame. * **Flipbook - Loop:** Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture. * **Flipbook - UV Frames:** When equally divided into rectangular frames, define the number of frames your texture contains from left to right (**X**) and top to bottom (**Y**). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0. * **UV Scroll - Rate:** For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions. * **Scroll option:** Toggle which maps will be subject to the scrolling effect. * Has animated displacement * Fluid distortion slider (wiggly texture) ## Standard Two Sided + Alpha Mask + UV Animation * Heavy weight * Similar to the Standard + Alpha Mask + UV Animation but is visible from both sides * Has the standard set of maps but also allows Alpha and UV animation * Has animated displacement * Fluid distortion slider (wiggly texture) ## Media Surface * Heavy weight * A streaming surface used to display video media. This shader when combined with media based scripts is able to display web pages, streams and videos. Useful for theater or television screens. * A world supports up to four media streams. Choose **Media Channel** (1–4) for each media surface; surfaces assigned to the same channel show the same stream. * Any avatars items worn using this will automatically display what is being played on the in world media stream. * UV Scale * Has all standard maps + Emissive map and intensity for when a media is not being played, this can show through on video and be used to create stylised screens such as ice and cracked/damaged screens. ## Media Surface + Stereographic * Heavy weight * Similar to Media Surface, but capable of displaying stereographic video for a 3D effect while in VR. When in desktop mode, only the image for the left eye is shown. * Orientation of the left and right images can be adjusted using the **Rotation Factor** property. The Rotation Factor setting is multiplied by 90 degrees as follows: * **0:** "Wall-eyed" orientation, where the left image is meant for the left eye and the right image is meant for the right eye. * **1:** Orientation where the top image is meant for the left eye and the bottom image is meant for the right eye. * **2:** "Cross-eyed" orientation, where the right image is meant for the left eye and left image is meant for the right eye. * **3:** Orientation where the bottom image is meant for the left eye and the top image is meant for the right eye. ## Media Surface + ChromaKey * Heavy weight * A Chromakey version of the Media Surface shader, this is used for removing a chosen key color from any media displayed on the surface i.e. Green/Blue screens, a live video of a DJ in front of a greenscreen could be used and keyed out to add to a events experience. * UV Scale. * Has all standard maps + Emissive map and intensity. * Includes multiple sliders to adjust the Keying. * Secondary color input field to choose Key Color. ## Transparent * Light weight * Accepts a Albedo, Normal and Roughness map only. Creates an object that appears to be transparent. The amount of transparency is determined by the brightness of the colors in the albedo map; a totally white albedo map results in a colorless, totally transparent object whereas a totally black albedo map results in a black, opaque object. Scene lighting may still affect how the surface of the object looks while visiting the scene. * Only one transparent layer is visible any overlapping transparent shader behind the top one will be rendered completely invisible * UV scale ## Transparent + Multibump * Heavy weight * Similar to Standard with an Albedo map, Normal map, and Roughness map, but is transparent and overlays and scrolls the Normal map at 3 additional perceived depths for a flowing water-like effect.\ * **Uv Scale** - Sets the size of the UV texture. Repeats the texture if higher than 1.0. * **Bump Scale** - Sets the "roughness" of the normal map. Low values look nearly smooth, and high values look exceptionally rough or bumpy. * **Octave Wavelength Decay** - Set the perceived depth of the three scrolling normal maps. At low values the lower layers appear to be deep below surface, and at high values all three layers appear to be near the surface. * **Octave Bump Decay** - Controls how "rough" the sub-layers appear. At low values the layers appear smoother, and at high values they appear rougher. * **Uv Scroll Rate** - Sets how fast to scroll the normal map across the surface in the X and Y directions. * Has Static Displacement * Fluid distortion slider (wiggly texture) Source: https://docs.sansar.com/create/materials/shaders-information --- # Shader Lookup Table This page shows information about each shader setting and its **System Names** this is mainly used for [Automating Shader Setup](/create/materials/automating-shader-setup.md) but the info is rather useful for other purposes. Each section shows one shader variant its naming convention and only the enabled properties of that shader plus type and any ranges. The shader properties are either Strings, Floats, Integers or Bools please follow the guides in [Automating Shader Setup](/create/materials/automating-shader-setup.md) for where to use these.
## Table Key - **Float** - **Float in Blender** A single number value. Can include decimal values (for example: `1.5`, `0.025`). - **Float3** - **Float Array in Blender** A group of three numbers used together, Any `Float` with a number after it indicates how many values are required. **Example:** `1.0, 0.5, 0.0` Some settings expect extra values even if they are not actively used. - **Integer** - **Integer in blender** A whole number only (Float works but the shader only uses whole numbers) (for example: `1`, `10`). - **Bool** **Boolean in Blender** A simple on/off setting. - **N/A** This setting is not available for import automation. - **Property** The name of the setting inside Sansar - **System Name** The formatting and name you need to use in blender - **Type** The type of property Sansar is expecting you to use - **Range** The range of values for the property this is so you can set the blender property to the same. ## Standard **Display Name:** Standard **System Name:** OpaqueSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Environment **Display Name:** Standard + Environment **System Name:** OpaqueEnvironmentSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Skybox Intensity | Sansar_Skybox_Intensity | Float (0.0-2.0)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided **Display Name:** Standard Two Sided **System Name:** TwoSidedOpaqueSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Alpha Mask **Display Name:** Standard + Alpha Mask **System Name:** OpaqueMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Environment + Alpha Mask **Display Name:** Standard + Environment + Alpha Mask **System Name:** OpaqueEnvironmentMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Skybox Intensity | Sansar_Skybox_Intensity | Float (0.0-2.0)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Alpha Mask **Display Name:** Standard Two Sided + Alpha Mask **System Name:** TwoSidedOpaqueMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Emissive **Display Name:** Standard + Emissive **System Name:** OpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Apply Uv Offset to Emissive | Sansar_Apply_Uv_Offset_To_Emissive | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Emissive **Display Name:** Standard Two Sided + Emissive **System Name:** TwoSidedOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Apply Uv Offset to Emissive | Sansar_Apply_Uv_Offset_To_Emissive | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Billboard **Display Name:** Billboard **System Name:** Billboard | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Brightness | Sansar_Brightness | Float (0.0–10.0)| | Absorption | Sansar_Absorption | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Lollipop | Sansar_Lollipop | Bool | | Inherit Orientation | Sansar_Inherit_Orientation | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Mask | Sansar_Scroll_Mask | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Scroll_Displacement_In_LocalSpace | Bool | | Clamp Uvs | Sansar_Clamp_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Detail **Display Name:** Standard + Detail **System Name:** OpaqueSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Detail **Display Name:** Standard Two Sided + Detail **System Name:** TwoSidedOpaqueSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Detail + Alpha Mask **Display Name:** Standard + Detail + Alpha Mask **System Name:** OpaqueMaskSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Detail + Alpha Mask **Display Name:** Standard Two Sided + Detail + Alpha Mask **System Name:** TwoSidedOpaqueMaskSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Subsurface + Detail **Display Name:** Subsurface + Detail **System Name:** OpaqueSubsurfaceSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Bleed Distance | Sansar_Bleed_Distance | Float (0.01–5.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Tint | Sansar_Tint | Float3 (0–255) | | BleedTint | Sansar_Bleed_Tint | Float3 (0–255) | ## Subsurface + Detail + Alpha Mask **Display Name:** Subsurface + Detail + Alpha Mask **System Name:** OpaqueMaskSubsurfaceSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Bleed Distance | Sansar_Bleed_Distance | Float (0.01–5.0)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | | BleedTint | Sansar_Bleed_Tint | Float3 (0–255) | ## Standard + Detail + Emissive **Display Name:** Standard + Detail + Emissive **System Name:** OpaqueEmissiveSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Apply Uv Offset to Emissive | Sansar_Apply_Uv_Offset_To_Emissive | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Detail + Emissive **Display Name:** Standard Two Sided + Detail + Emissive **System Name:** TwoSidedOpaqueEmissiveSingleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Apply Uv Offset to Emissive | Sansar_Apply_Uv_Offset_To_Emissive | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Four Layer Non-Specular **Display Name:** Four Layer Non-Specular **System Name:** OpaqueDiffuseMultiLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Scales | Sansar_Uv_Scales | Float (0.01-1000)| | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Three Layer + Detail **Display Name:** Standard Three Layer + Detail **System Name:** OpaqueTripleLayerDetail | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Scales | Sansar_Uv_Scales | Float (0.01-1000)| | Detail Scale | Sansar_Detail_Scale | Float3 (0.1–1000)| | Tint | Sansar_Tint | Float3 (0–255) | ## Emissive + Uv Animation **Display Name:** Emissive + Uv Animation **System Name:** Emissive | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Afterimage Decay Rate | Sansar_Afterimage_Decay_Rate | Float (0.1–0.9)| | Absorption | Sansar_Absorption | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Mask | Sansar_Scroll_Mask | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Draw Afterimages | Sansar_Draw_Afterimages | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Emissive Two Sided + Uv Animation **Display Name:** Emissive Two Sided + Uv Animation **System Name:** TwoSidedEmissive | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Afterimage Decay Rate | Sansar_Afterimage_Decay_Rate | Float (0.1–0.9)| | Absorption | Sansar_Absorption | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Mask | Sansar_Scroll_Mask | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Draw Afterimages | Sansar_Draw_Afterimages | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Transmissive + Emissive **Display Name:** Transmissive + Emissive **System Name:** TransmissiveEmissive | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Emissive + Stereographic **Display Name:** Standard + Emissive + Stereographic **System Name:** StereographicOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Rotation Factor | Sansar_Rotation_Factor | Float (0–4.0) | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Uv Animation **Display Name:** Standard + Uv Animation **System Name:** ScrollingOpaqueSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Uv Animation **Display Name:** Standard Two Sided + Uv Animation **System Name:** TwoSidedScrollingOpaqueSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Emissive + Uv Animation **Display Name:** Standard + Emissive + Uv Animation **System Name:** ScrollingOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Emissive + Uv Animation **Display Name:** Standard Two Sided + Emissive + Uv Animation **System Name:** TwoSidedScrollingOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard + Alpha Mask + Uv Animation **Display Name:** Standard + Alpha Mask + Uv Animation **System Name:** ScrollingOpaqueMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Standard Two Sided + Alpha Mask + Uv Animation **Display Name:** Standard Two Sided + Alpha Mask + Uv Animation **System Name:** TwoSidedScrollingOpaqueMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Index: Standard + Uv Animation **Display Name:** Index: Standard + Uv Animation **System Name:** IndexScrollingOpaqueSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Index | Sansar_Flipbook_Index | Integer (0–3) | | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Index: Standard Two Sided + Uv Animation **Display Name:** Index: Standard Two Sided + Uv Animation **System Name:** TwoSidedIndexScrollingOpaqueSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Index | Sansar_Flipbook_Index | Integer (0–3) | | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Media: Media Surface **Display Name:** Media: Media Surface **System Name:** VideoScreen | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Media Channel | Sansar_Media_Channel | Integer (1–4) | | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Tint | Sansar_Tint | Float3 (0–255) | ## Media: Media Surface + Stereographic **Display Name:** Media: Media Surface + Stereographic **System Name:** StereographicVideoScreen | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Media Channel | Sansar_Media_Channel | Integer (1–4) | | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Rotation Factor | Sansar_Rotation_Factor | Float (0–4.0) | | Tint | Sansar_Tint | Float3 (0–255) | ## Media: Media Surface + ChromaKey **Display Name:** Media: Media Surface + ChromaKey **System Name:** ChromaKeyVideoScreen | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Media Channel | Sansar_Media_Channel | Integer (1–4) | | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Hue Threshold (Transparency) | Sansar_Hue_Threshold_Transparency | Float (0.0–1.0)| | Saturation Threshold (Transparency) | Sansar_Saturation_Threshold_Transparency | Float (0.0–1.0)| | Value Threshold (Transparency) | Sansar_Value_Threshold_Transparency | Float (0.0–1.0)| | Hue Threshold (Glare) | Sansar_Hue_Threshold_Glare | Float (0.0–1.0)| | Saturation Threshold (Glare) | Sansar_Saturation_Threshold_Glare | Float (0.0–1.0)| | Value Threshold (Glare) | Sansar_Value_Threshold_Glare | Float (0.0–1.0)| | Tint | Sansar_Tint | Float3 (0–255) | | Chroma Key Color | Sansar_Chroma_Key_Color | Float3 (0–255) | ## Media: Displacement Media + Uv Animation **Display Name:** Media: Displacement Media + Uv Animation **System Name:** MediaScrollingOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Media Channel | Sansar_Media_Channel | Integer (1–4) | | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Max Displacement Clamp | Sansar_Max_Displacement_Clamp | Float (0.000–1.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Use Media Stream for Displacement | Sansar_Use_Media_Stream_For_Displacement | Bool | | Use Media Stream for Albedo | Sansar_Use_Media_Stream_For_Albedo | Bool | | Split Color And Displacement | Sansar_Split_Color_And_Displacement | Bool | | Use Gamma Curve for Media Displacement| Sansar_Use_Gamma_Curve_For_Media_Displacement | Bool | | Use Luma for Media Displacement | Sansar_Use_Luma_For_Media_Displacement | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Media: Two Sided Displacement Media + Uv Animation **Display Name:** Media: Two Sided Displacement Media + Uv Animation **System Name:** TwoSidedMediaScrollingOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Media Channel | Sansar_Media_Channel | Integer (1–4) | | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Max Displacement Clamp | Sansar_Max_Displacement_Clamp | Float (0.000–1.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Use Media Stream for Displacement | Sansar_Use_Media_Stream_For_Displacement | Bool | | Use Media Stream for Albedo | Sansar_Use_Media_Stream_For_Albedo | Bool | | Split Color And Displacement | Sansar_Split_Color_And_Displacement | Bool | | Use Gamma Curve for Media Displacement| Sansar_Use_Gamma_Curve_For_Media_Displacement | Bool | | Use Luma for Media Displacement | Sansar_Use_Luma_For_Media_Displacement | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Transparent **Display Name:** Transparent **System Name:** Transparent | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Adv. Albedo Blending | Sansar_Adv_Albedo_Blending | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Skip motion vectors for reflections | Sansar_Skip_Motion_Vectors_For_Reflections | Bool | | Skip accumulation for reflections | Sansar_Skip_Accumulation_For_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Transparent + Multibump **Display Name:** Transparent + Multibump **System Name:** TransparentMultibump | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Bump Scale | Sansar_Bump_Scale | Float (0.01–2.0)| | Octave Wavelength Decay | Sansar_Octave_Wavelength_Decay | Float (0.3–0.9)| | Octave Bump Decay | Sansar_Octave_Bump_Decay | Float (0.3–0.9)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Adv. Albedo Blending | Sansar_Adv_Albedo_Blending | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Skip motion vectors for reflections | Sansar_Skip_Motion_Vectors_For_Reflections | Bool | | Skip accumulation for reflections | Sansar_Skip_Accumulation_For_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Diffractive: Transparent + Multibump **Display Name:** Diffractive: Transparent + Multibump **System Name:** TransparentMultibumpDiffract | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Diffractive Index | Sansar_Diffractive_Index | Float (-2.5-2.5)| | Bump Scale | Sansar_Bump_Scale | Float (0.01–2.0)| | Octave Wavelength Decay | Sansar_Octave_Wavelength_Decay | Float (0.3–0.9)| | Octave Bump Decay | Sansar_Octave_Bump_Decay | Float (0.3–0.9)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Skip motion vectors for reflections | Sansar_Skip_Motion_Vectors_For_Reflections | Bool | | Skip accumulation for reflections | Sansar_Skip_Accumulation_For_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Diffractive: Transparent + Multibump + Environment **Display Name:** Diffractive: Transparent + Multibump + Environment **System Name:** TransparentMultibumpEnvironmentDiffract | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Diffractive Index | Sansar_Diffractive_Index | Float (-2.5-2.5)| | Bump Scale | Sansar_Bump_Scale | Float (0.01–2.0)| | Octave Wavelength Decay | Sansar_Octave_Wavelength_Decay | Float (0.3–0.9)| | Octave Bump Decay | Sansar_Octave_Bump_Decay | Float (0.3–0.9)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Skybox Intensity | Sansar_Skybox_Intensity | Float (0.0-2.0)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Skip motion vectors for reflections | Sansar_Skip_Motion_Vectors_For_Reflections | Bool | | Skip accumulation for reflections | Sansar_Skip_Accumulation_For_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Diffractive: Standard + Alpha Mask **Display Name:** Diffractive: Standard + Alpha Mask **System Name:** OpaqueDiffractionMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Diffractive Index | Sansar_Diffractive_Index | Float (-2.5-2.5)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Tint | Sansar_Tint | Float3 (0–255) | ## Diffractive: Standard Two Sided + Alpha Mask **Display Name:** Diffractive: Standard Two Sided + Alpha Mask **System Name:** TwoSidedOpaqueDiffractionMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Diffractive Index | Sansar_Diffractive_Index | Float (-2.5-2.5)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Tint | Sansar_Tint | Float3 (0–255) | ## Diffractive: Standard + Alpha Mask + Uv Animation **Display Name:** Diffractive: Standard + Alpha Mask + Uv Animation **System Name:** ScrollingOpaqueDiffractionMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Diffractive Index | Sansar_Diffractive_Index | Float (-2.5-2.5)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Diffractive: Standard Two Sided + Alpha Mask + Uv Animation **Display Name:** Diffractive: Standard Two Sided + Alpha Mask + Uv Animation **System Name:** TwoSidedScrollingOpaqueDiffractionMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Diffractive Index | Sansar_Diffractive_Index | Float (-2.5-2.5)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Fresnel: Standard + Emissive **Display Name:** Fresnel: Standard + Emissive **System Name:** OpaqueEmissiveFresnelSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Fresnel Intensity | Sansar_Fresnel_Intensity | Float (0.0–32.0)| | Fresnel Exponent | Sansar_Fresnel_Exponent | Float (0.1–2.0)| | Fresnel Bias | Sansar_Fresnel_Bias | Float (-1.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Invert Fresnel | Sansar_Invert_Fresnel | Bool | | Blend Outside Albedo Into Fresnel | Sansar_Blend_Outside_Albedo_Texture_Into_Fresnel | Bool | | Blend Outside Emissive Into Fresnel | Sansar_Blend_Outside_Emissive_Texture_Into_Fresnel | Bool | | Tint | Sansar_Tint | Float3 (0–255) | | Fresnel Tint | Sansar_Fresnel_Tint | Float3 (0–255) | ## Fresnel: Standard Two Sided + Emissive **Display Name:** Fresnel: Standard Two Sided + Emissive **System Name:** TwoSidedOpaqueEmissiveFresnelSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Fresnel Intensity | Sansar_Fresnel_Intensity | Float (0.0–32.0)| | Fresnel Exponent | Sansar_Fresnel_Exponent | Float (0.1–2.0)| | Fresnel Bias | Sansar_Fresnel_Bias | Float (-1.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Invert Fresnel | Sansar_Invert_Fresnel | Bool | | Blend Outside Albedo Into Fresnel | Sansar_Blend_Outside_Albedo_Texture_Into_Fresnel | Bool | | Blend Outside Emissive Into Fresnel | Sansar_Blend_Outside_Emissive_Texture_Into_Fresnel | Bool | | Tint | Sansar_Tint | Float3 (0–255) | | Fresnel Tint | Sansar_Fresnel_Tint | Float3 (0–255) | ## Pixelize: Billboard **Display Name:** Pixelize: Billboard **System Name:** BillboardPixelize | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Brightness | Sansar_Brightness | Float (0.0–10.0)| | Absorption | Sansar_Absorption | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Lollipop | Sansar_Lollipop | Bool | | Inherit Orientation | Sansar_Inherit_Orientation | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Mask | Sansar_Scroll_Mask | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Scroll_Displacement_In_LocalSpace | Bool | | Clamp Uvs | Sansar_Clamp_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Billboard + Alpha Mask + Uv Animation **Display Name:** Pixelize: Billboard + Alpha Mask + Uv Animation **System Name:** ScrollingOpaqueMaskPixelSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Lollipop | Sansar_Lollipop | Bool | | Inherit Orientation | Sansar_Inherit_Orientation | Bool | | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Standard + Emissive **Display Name:** Pixelize: Standard + Emissive **System Name:** OpaqueEmissivePixelizeSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Standard Two Sided + Emissive **Display Name:** Pixelize: Standard Two Sided + Emissive **System Name:** TwoSidedOpaqueEmissivePixelizeSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Standard + Alpha Mask **Display Name:** Pixelize: Standard + Alpha Mask **System Name:** OpaquePixelizeMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Standard Two Sided + Alpha Mask **Display Name:** Pixelize: Standard Two Sided + Alpha Mask **System Name:** TwoSidedOpaquePixelizeMaskSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Standard + Emissive + Uv Animation **Display Name:** Pixelize: Standard + Emissive + Uv Animation **System Name:** ScrollingOpaqueEmissivePixelizeSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Pixelize: Standard Two Sided + Emissive + Uv Animation **Display Name:** Pixelize: Standard Two Sided + Emissive + Uv Animation **System Name:** TwoSidedScrollingOpaqueEmissivePixelizeSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Pixel Size | Sansar_Pixel_Size | Float (1.0–256)| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Screenspace: Standard + Emissive **Display Name:** Screenspace: Standard + Emissive **System Name:** ScreenspaceOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Tint | Sansar_Tint | Float3 (0–255) | ## Screenspace: Two Sided Standard + Emissive **Display Name:** Screenspace: Two Sided Standard + Emissive **System Name:** TwoSidedScreenspaceOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Tint | Sansar_Tint | Float3 (0–255) | ## Screenspace: Standard + Emissive + Uv Animation **Display Name:** Screenspace: Standard + Emissive + Uv Animation **System Name:** ScrollingScreenspaceOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Screenspace Uv Scale | Sansar_Screenspace_UV_Scale | Float (0.0-10.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Screenspace: Standard Two Sided + Emissive + Uv Animation **Display Name:** Screenspace: Standard Two Sided + Emissive + Uv Animation **System Name:** TwoSidedScrollingScreenspaceOpaqueEmissiveSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Screenspace Uv Scale | Sansar_Screenspace_UV_Scale | Float (0.0-10.0)| | Fluid Distortion Speed | Sansar_Fluid_Distortion_Speed | Float (0.0–8.0)| | Fluid Distortion Scale | Sansar_Fluid_Distortion_Scale | Float (0.0–100.0)| | Fluid Distortion Amplitude | Sansar_Fluid_Distortion_Amplitude | Float (0.0–1.0)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Albedo | Sansar_Scroll_Albedo | Bool | | Scroll Normal/Roughness | Sansar_Scroll_Normal_Roughness | Bool | | Scroll Metalness | Sansar_Scroll_Metalness | Bool | | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Emissive Mask | Sansar_Scroll_Emissive_Mask | Bool | | Scroll Ambient Occlusion | Sansar_Scroll_Ambient_Occlusion | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Fix Shimmering | Sansar_Fix_Shimmering | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## No Shadow: Standard **Display Name:** No Shadow: Standard **System Name:** OpaqueSingleLayerNoShadow | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## No Shadow: Standard + Emissive **Display Name:** No Shadow: Standard + Emissive **System Name:** OpaqueEmissiveSingleLayerNoShadow | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Apply Uv Offset to Emissive | Sansar_Apply_Uv_Offset_To_Emissive | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## No Shadow: Standard + Alpha Mask **Display Name:** No Shadow: Standard + Alpha Mask **System Name:** OpaqueMaskSingleLayerNoShadow | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## No Shadow: Standard Two Sided + Alpha Mask **Display Name:** No Shadow: Standard Two Sided + Alpha Mask **System Name:** TwoSidedOpaqueMaskSingleLayerNoShadow | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | Mask Threshold | Sansar_Mask_Threshold | Float (0.0–0.1)| | Mask Softness | Sansar_Mask_Softness | Float (0.0–0.1)| | Uv Offsets | Sansar_Uv_Offsets | Float3 (-1.0-1.0)| | Apply Uv Offset to Diffuse layers | Sansar_Apply_Uv_Offset_To_Diffuse_Layers | Bool | | Apply Uv Offset to Ambient Occlusion | Sansar_Apply_Uv_Offset_To_Ambient_Occlusion | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## Audio Reactive: Emissive + Uv Animation **Display Name:** Audio Reactive: Emissive + Uv Animation **System Name:** AudioEmissive | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Afterimage Decay Rate | Sansar_Afterimage_Decay_Rate | Float (0.1–0.9)| | Absorption | Sansar_Absorption | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Flipbook - Frame | Sansar_Flipbook_Frame | Float (0–255) | | Flipbook - Step Rate | Sansar_Flipbook_Step_Rate | Float (0–100) | | Flipbook - Loop | Sansar_Flipbook_Loop | Float (1.0–256)| | Displacement Scale | Sansar_Displacement_Scale | Float3 (-250–250)| | Flipbook - Uv Frames | Sansar_Flipbook_Uv_Frames | Float3 (1.0–100)| | Uv Scroll - Rate | Sansar_Uv_Scroll_Rate | Float3 (-100–100)| | Scroll Emissive | Sansar_Scroll_Emissive | Bool | | Scroll Mask | Sansar_Scroll_Mask | Bool | | Scroll Displacement | Sansar_Scroll_Displacement | Bool | | Scroll Displacement Factor | Sansar_Scroll_Displacement_Factor | Bool | | Blend Displacement Flipbook | Sansar_Scroll_Blend_Displacement_Flipbook | Bool | | Blend On Displacement Loop | Sansar_Scroll_Blend_On_Displacement_Loop | Bool | | Loop Displacement Flipbook | Sansar_Scroll_Loop_Displacement_Flipbook | Bool | | Ping-Pong Displacement Flipbook | Sansar_Scroll_Ping-Pong_Displacement_Flipbook | Bool | | Loop Flipbook | Sansar_Scroll_Loop_Flipbook | Bool | | Displacement in LocalSpace | Sansar_Displacement_In_LocalSpace | Bool | | Clamp Flipbook Uvs | Sansar_Clamp_Flipbook_Uvs | Bool | | Draw Afterimages | Sansar_Draw_Afterimages | Bool | | Audio React - Emissive Color | Sansar_Audio_React_Emissive_Color | Bool | | Audio React - Emissive Brightness | Sansar_Audio_React_Emissive_Brightness | Bool | | Audio React - Adaptive Displacement | Sansar_Audio_React_Adaptive_Displacement | Bool | | Audio React - Displacement on Low | Sansar_Audio_React_Displacement_On_Low | Bool | | Audio React - Displacement on Mid | Sansar_Audio_React_Displacement_On_Mid | Bool | | Audio React - Displacement on High | Sansar_Audio_React_Displacement_On_High | Bool | | Audio React - Flipbook Frame | Sansar_Audio_React_Flipbook_Frame | Bool | | Audio React - Adaptive Flash Emissive | Sansar_Audio_React_Adaptive_Flash_Emissive | Bool | | Audio React - Flash Emissive on Low | Sansar_Audio_React_Flash_Emissive_On_Low | Bool | | Audio React - Flash Emissive on Mid | Sansar_Audio_React_Flash_Emissive_On_Mid | Bool | | Audio React - Flash Emissive on High | Sansar_Audio_React_Flash_Emissive_On_High | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## VAT: Standard **Display Name:** VAT: Standard **System Name:** OpaqueVATSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | VAT - Frame | Sansar_VAT_Frame | Float (0-4096)| | VAT - Step Rate | Sansar_VAT_Step_Rate | Float (0.0-100.0)| | VAT - Loop - Start Frame | Sansar_VAT_Loop_Start_Frame | Float (0-4096)| | VAT - Loop - Run Length | Sansar_VAT_Loop_Run_Length | Float (0-4096)| | VAT Scale | Sansar_VAT_Scale | Float3 (-25–25)| | Loop Animation | Sansar_Loop_Animation | Bool | | Ping-Pong Animation | Sansar_Ping-Pong_Animation | Bool | | Blend Animation Loop | Sansar_Blend_Animation_Loop | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Shadow casting | Sansar_Shadow_Casting | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## VAT: Standard + Alpha Mask **Display Name:** VAT: Standard + Alpha Mask **System Name:** OpaqueMaskVATSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | VAT - Frame | Sansar_VAT_Frame | Float (0-4096)| | VAT - Step Rate | Sansar_VAT_Step_Rate | Float (0.0-100.0)| | VAT - Loop - Start Frame | Sansar_VAT_Loop_Start_Frame | Float (0-4096)| | VAT - Loop - Run Length | Sansar_VAT_Loop_Run_Length | Float (0-4096)| | VAT Scale | Sansar_VAT_Scale | Float3 (-25–25)| | Loop Animation | Sansar_Loop_Animation | Bool | | Ping-Pong Animation | Sansar_Ping-Pong_Animation | Bool | | Blend Animation Loop | Sansar_Blend_Animation_Loop | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Shadow casting | Sansar_Shadow_Casting | Bool | | Tint | Sansar_Tint | Float3 (0–255) | ## VAT: Standard + Emissive **Display Name:** VAT: Standard + Emissive **System Name:** OpaqueEmissiveVATSingleLayer | Property | System Name | Type / Range | |---------------------------------------|----------------------------------------------------|----------------| | Emissive Intensity | Sansar_Emissive_Intensity | Float (0.0–32.0)| | Ambient Occlusion Strength | Sansar_Ambient_Occlusion_Strength | Float (0.0–1.0)| | Uv Scale | Sansar_Uv_Scale | Float (0.001-100)| | Uv Rotate | Sansar_Uv_Rotate | Float (-360–360)| | VAT - Frame | Sansar_VAT_Frame | Float (0-4096)| | VAT - Step Rate | Sansar_VAT_Step_Rate | Float (0.0-100.0)| | VAT - Loop - Start Frame | Sansar_VAT_Loop_Start_Frame | Float (0-4096)| | VAT - Loop - Run Length | Sansar_VAT_Loop_Run_Length | Float (0-4096)| | VAT Scale | Sansar_VAT_Scale | Float3 (-25–25)| | Loop Animation | Sansar_Loop_Animation | Bool | | Ping-Pong Animation | Sansar_Ping-Pong_Animation | Bool | | Blend Animation Loop | Sansar_Blend_Animation_Loop | Bool | | Receive reflections | Sansar_Receive_Reflections | Bool | | Shadow casting | Sansar_Shadow_Casting | Bool | | Tint | Sansar_Tint | Float3 (0–255) | Source: https://docs.sansar.com/create/materials/shader-lookup-table --- # Automating Shader Setup Using Blender, you can automate the import of certain texture maps and most shader settings by saving them directly into the FBX file. This setup works on a per-material-slot basis. After the initial setup, this can significantly reduce import time, especially if you plan to upload the asset multiple times, places or if it requires a lot of configuration. This is completely optional. All materials and settings can still be adjusted manually when importing or editing the asset in-game.
## Import Texture Maps Guide Some PBR texture maps can be automatically imported if they are set up correctly in Blender. Currently, only a limited number of maps support auto-import; any others must be assigned manually during the import process. ### Supported Auto-Import Maps The following texture maps can be automatically imported: - Albedo - Normal - Roughness - Metalness - Emissive Map ### How Auto-Import Works To enable auto-import, connect your texture files to the correct inputs on the **Principled BSDF** shader in Blender. When the material is imported, Sansar will automatically assign these textures to their corresponding map slots, if they are supported by the shader. You can use the **Node Wrangler** Blender add-on to set this up automatically when proper texture naming is used. Alternatively, you can connect the textures manually by following this guide.
1. In blender, make sure you have at least one material slot assigned to your model, additional materials will need setting up also in the same way. Click on the Shading tab at the top (you can open additional windows)
2. In the Shading window, you will need a principled BSDF, this should be added by default but if not you can add one.
3. In the shader node window add a `Image Texture` node for each map and a `Normal Map` node.
4. With your nodes added, now add your maps to each node, naming doesn't matter as it uses the BSDF connection to determine the maps use.
5. Once your maps are added, connect the nodes to the BSDF by clicking and dragging the sockets to each slot, make sure to include the `Normal Map` node.
6. When you export your model, the texture file paths will be embedded into the FBX so Sansar can locate and import them automatically. Your texture maps must be saved somewhere on your computer. During export, choose one of the following options: - **Match** – Use this if the textures are already saved in the correct location. - **Copy** – Use this if the textures are packed inside the Blender file and need to be extracted during export.
## Import Settings Guide ### Assigning The Shader This section covers assigning the selected shader associated with the material slot.
1. In Blender, open the material Properties Panel
2. Choose the material slot you want to set up. Each slot is configured individually, so you’ll need to set up each one you want to control. Any options you leave unchanged will fall back to Sansar’s defaults, and can still be modified during import.
3. In the **Custom Properties** Tab of the material select **New** and then open the **Edit Property** panel by pressing the cog icon.
4. Change the type to **String** and change the Property name to be **Sansar_MaterialType** then click OK make sure to include the capitals.
5. Now enter the **System Name** (not the **Display Name**) of the shader you want to assign to this material slot. This should be typed into the input field on the main Properties panel, not in the previous setup window. If you try to input an unrecognized name or a **Display Name** the import will fail with a error.
Example input: **OpaqueSingleLayer** for the **Standard** Shader.
The following is a list of the shader's **Display Name** and its **System Name**.
Click to reveal Shader names

Property Name: **Sansar_MaterialType** | Display Name | System Name | |--------------------------------------------------------|------------------------------------------------------| | Standard | OpaqueSingleLayer | | Standard + Environment | OpaqueEnvironmentSingleLayer | | Standard Two Sided | TwoSidedOpaqueSingleLayer | | Standard + Alpha Mask | OpaqueMaskSingleLayer | | Standard + Environment + Alpha Mask | OpaqueEnvironmentMaskSingleLayer | | Standard Two Sided + Alpha Mask | TwoSidedOpaqueMaskSingleLayer | | Standard + Emissive | OpaqueEmissiveSingleLayer | | Standard Two Sided + Emissive | TwoSidedOpaqueEmissiveSingleLayer | | Billboard | Billboard | | Standard + Detail | OpaqueSingleLayerDetail | | Standard Two Sided + Detail | TwoSidedOpaqueSingleLayerDetail | | Standard + Detail + Alpha Mask | OpaqueMaskSingleLayerDetail | | Standard Two Sided + Detail + Alpha Mask | TwoSidedOpaqueMaskSingleLayerDetail | | Subsurface + Detail | OpaqueSubsurfaceSingleLayerDetail | | Subsurface + Detail + Alpha Mask | OpaqueMaskSubsurfaceSingleLayerDetail | | Standard + Detail + Emissive | OpaqueEmissiveSingleLayerDetail | | Standard Two Sided + Detail + Emissive | TwoSidedOpaqueEmissiveSingleLayerDetail | | Four Layer Non-Specular | OpaqueDiffuseMultiLayer | | Standard Three Layer + Detail | OpaqueTripleLayerDetail | | Emissive + UV Animation | Emissive | | Emissive Two Sided + UV Animation | TwoSidedEmissive | | Transmissive + Emissive | TransmissiveEmissive | | Standard + Emissive + Stereographic | StereographicOpaqueEmissiveSingleLayer | | Standard + UV Animation | ScrollingOpaqueSingleLayer | | Standard Two Sided + UV Animation | TwoSidedScrollingOpaqueSingleLayer | | Standard + Emissive + UV Animation | ScrollingOpaqueEmissiveSingleLayer | | Standard Two Sided + Emissive + UV Animation | TwoSidedScrollingOpaqueEmissiveSingleLayer | | Standard + Alpha Mask + UV Animation | ScrollingOpaqueMaskSingleLayer | | Standard Two Sided + Alpha Mask + UV Animation | TwoSidedScrollingOpaqueMaskSingleLayer | | Index: Standard + UV Animation | IndexScrollingOpaqueSingleLayer | | Index: Standard Two Sided + UV Animation | TwoSidedIndexScrollingOpaqueSingleLayer | | Media: Media Surface | VideoScreen | | Media: Media Surface + Stereographic | StereographicVideoScreen | | Media: Media Surface + ChromaKey | ChromaKeyVideoScreen | | Media: Displacement Media + UV Animation | MediaScrollingOpaqueEmissiveSingleLayer | | Media: Two Sided Displacement Media + UV Animation | TwoSidedMediaScrollingOpaqueEmissiveSingleLayer | | Transparent | Transparent | | Transparent + Multibump | TransparentMultibump | | Diffractive: Transparent + Multibump | TransparentMultibumpDiffract | | Diffractive: Transparent + Multibump + Environment | TransparentMultibumpEnvironmentDiffract | | Diffractive: Standard + Alpha Mask | OpaqueDiffractionMaskSingleLayer | | Diffractive: Standard Two Sided + Alpha Mask | TwoSidedOpaqueDiffractionMaskSingleLayer | | Diffractive: Standard + Alpha Mask + UV Animation | ScrollingOpaqueDiffractionMaskSingleLayer | | Diffractive: Standard Two Sided + Alpha Mask + UV Animation | TwoSidedScrollingOpaqueDiffractionMaskSingleLayer | | Fresnel: Standard + Emissive | OpaqueEmissiveFresnelSingleLayer | | Fresnel: Standard Two Sided + Emissive | TwoSidedOpaqueEmissiveFresnelSingleLayer | | Pixelize: Billboard | BillboardPixelize | | Pixelize: Billboard + Alpha Mask + UV Animation | ScrollingOpaqueMaskPixelSingleLayer | | Pixelize: Standard + Emissive | OpaqueEmissivePixelizeSingleLayer | | Pixelize: Standard Two Sided + Emissive | TwoSidedOpaqueEmissivePixelizeSingleLayer | | Pixelize: Standard + Alpha Mask | OpaquePixelizeMaskSingleLayer | | Pixelize: Standard Two Sided + Alpha Mask | TwoSidedOpaquePixelizeMaskSingleLayer | | Pixelize: Standard + Emissive + UV Animation | ScrollingOpaqueEmissivePixelizeSingleLayer | | Pixelize: Standard Two Sided + Emissive + UV Animation | TwoSidedScrollingOpaqueEmissivePixelizeSingleLayer | | Screenspace: Standard + Emissive | ScreenspaceOpaqueEmissiveSingleLayer | | Screenspace: Two Sided Standard + Emissive | TwoSidedScreenspaceOpaqueEmissiveSingleLayer | | Screenspace: Standard + Emissive + UV Animation | ScrollingScreenspaceOpaqueEmissiveSingleLayer | | Screenspace: Standard Two Sided + Emissive + UV Animation | TwoSidedScrollingScreenspaceOpaqueEmissiveSingleLayer | | No Shadow: Standard | OpaqueSingleLayerNoShadow | | No Shadow: Standard + Emissive | OpaqueEmissiveSingleLayerNoShadow | | No Shadow: Standard + Alpha Mask | OpaqueMaskSingleLayerNoShadow | | No Shadow: Standard Two Sided + Alpha Mask | TwoSidedOpaqueMaskSingleLayerNoShadow | | Audio Reactive: Emissive + UV Animation | AudioEmissive | | VAT: Standard | OpaqueVATSingleLayer | | VAT: Standard + Alpha Mask | OpaqueMaskVATSingleLayer | | VAT: Standard + Emissive | OpaqueEmissiveVATSingleLayer |

6. Finally when you export your object make sure to use .FBX and tick the **Custom Properties** box.
Now when you import to sansar the material slots shader will automatically be assigned to your defined shader. --- ### Assigning Shader Settings This section explains how to assign shader settings such as sliders, toggle boxes, and input fields. These settings use one of the following data types: **Float**, **Integer**, or **Bool**.
Each shader has its own set of available settings. You must first assign the shader you want to use before configuring any settings. If you add a setting that is not supported by the selected shader, it will be ignored. #### NOTE: Follow the guide above to assign your shader before continuing. --- 1. **Choose the material slot** you want to configure. Each material slot is set up individually, so you must repeat this process for every slot you want to control. Any settings you do not configure will fall back to Sansar’s default values and can still be adjusted during import. Make sure your shader is assigned first—you should see it listed in the material’s **Custom Properties**.
2. In the material’s **Custom Properties** tab, click **New** to create a property, you can add multiple. Then open the **Edit Property** panel by clicking the cog icon next to the new property.
3. Using the [Shader Lookup Table](/create/materials/shader-lookup-table.md), find the shader and property you want to configure. Take note of the property’s **System Name**, **Type**, and **Range**.
4. Choose the property **Type** that matches the shader setting you want to control.
--- ### Table Key - **Float – Float** A single number value. Can include decimal values (for example: `1.5`, `0.025`). - **Float3 – Float Array** A group of numbers used together. Any `Float` followed by a number indicates how many values are required. **Example:** `1.0, 0.5, 0.0` Some settings expect additional values even if they are not actively used—leave these extra values set to `0`. - **Integer – Integer** A whole number only. While floats may be accepted, the shader will only use whole numbers (for example: `1`, `10`). - **Bool – Boolean** A simple on/off setting. --- 5. Set the property’s **System Name**, include capitals, along with any **Minimum** and **Maximum** values based on the shader’s **Range**. You only need to define the limits you plan to use, but it is best practice to match the full supported range. You do **not** need to set the **Default Value** here, this is done in the main properties panel instead. Once done click OK
6. In the main panel you can now add your number values to the fields.
You can add as many properties as you need, you do not need to add them if you do not need to control on import as they will just be defaulted if no property is given. The order these appear in blender is not importent, just make sure you always have your shader defined. 7. Finally when you export as .FBX make sure to enable the **Custom Properties** box.
Now when you import to sansar the material slots shader will automatically be assigned to your defined shader and any sliders settings or bools will be setup! ## Settings Lookup Table A full table of the shaders settings names ranges and types is available here [Shader Lookup Table](/create/materials/shader-lookup-table.md) ## Troubleshooting Settings not working: - Make sure to check for capitals or extra spaces. - You are using the system names, and the correct type. - Your shader was defined. Source: https://docs.sansar.com/create/materials/automating-shader-setup --- # Shader Scripting Some settings on shaders can be scripted to change, currently the list of available options is rather small but intended to be increased in future. ## Known scriptable settings **Absorption - float** **Brightness - float** **Emissive intensity - float** **Flipbook Frame - float** **flipbook index - float** **VatFrame - float** **VatLoopRunLength - float** **VatLoopStartFrame - float** **VatStepRate - float** **RGB tint values - sansar.color** **ShadowCasting - bool** Source: https://docs.sansar.com/create/materials/shader-scripting --- # VAT Shader Basics ## What are VATs? A VAT (Vertex Animation Texture) is a shader and texture map combo technique used in 3D graphics to achieve efficient vertex animation without the use of bones. It's particularly useful for complex or deformable objects and animations that would otherwise require too many bones to be efficient. The VAT shader requires access to the object's source file to create the required textures. This contrasts with the Displacement shader, where it’s possible to create maps by understanding the UV layout of an asset. **NOTES:** - VAT only affects the appearance of the visual mesh and not its collision. - Sansar VATs are implemented differently from those in other external engines. A tool is available for most users (details below), while advanced users can see [VAT Technical Info](/create/materials/vat-technical-info.md) for more. - The VAT shader requires the creator to have access to the object's source file to generate the necessary textures, as it relies on a secondary UV map to control animation. In contrast, the Displacement shader can work with maps created by understanding the UV layout of an asset, even without access to the source file. The advantage of the VAT shader is that its color maps are separate from the animation maps. - VAT maps are not considered human-editable. While technically possible to edit them, it is not straightforward. --- ## Sansar VAT Tool A Blender addon has been created to assist in making VAT assets. Visit [Sansar Blender Tools](https://github.com/TENS0R/Sansar-Blender-Tools) to download the free tool for Blender 3.4 and above. The tool is untested on earlier versions. ### Using the Tool After downloading the latest release of the tool, install it in Blender like any other addon. *(User Preferences -> Addons -> Install from File)* and then select the `.zip` file. Once installed, you should see the Sansar Tools addon in the sidebar.
- **Frame Range:** Specify the first and last frame for export, as well as the frame step size. A smaller step size captures more frames of animation. Sansar includes some interpolation between frames. - **Generate Mesh:** If checked, the mesh to be uploaded to Sansar is generated along with the displacement and normal maps. If unchecked, only the textures are generated. - **Encode Map as Z-Curve:** If checked, the generated images store the data in Z-order (Morton Code), which optimizes caching inside Sansar. Additionally, the first pixel encodes the number of vertices and frames. This option is required for generating Sansar assets. If disabled, the images store the data such that the vertices are columns and the frames are rows, making them compatible with other engines. - **Export Files:** Exports both images and the mesh (if generated) to the specified path and filename prefix. --- ## VAT Limits ### Constraints on Vertices and Frames The maximum number of vertices and frames is limited by two factors: 1. **Precision of Encoding**: This independently limits the number of vertices and frames. 2. **Available Pixels in an 8K Texture**: This limits the product of the number of vertices multiplied by the number of frames. #### Exact Limits: - **Maximum number of vertices:** 16,773,120 (after split normals). - **Maximum number of frames:** 4,096. - **Maximum product of vertices and frames:** 67,108,863. #### Example: - If you want 4,096 frames, the number of vertices must be limited to **16,383**. - Halving the number of frames allows you to double the number of vertices, continuing this trade-off up to the maximum allowed vertices. - 4,096 pixels are used for encoding, so factor this into your calculations. --- ## Creating VAT Animated Assets This is a basic guide to creating VAT assets. The Blender tool converts keyframed animation into a usable mesh and texture set for Sansar VAT. All objects will be combined into a single mesh with the tool, so ensure individual objects are scaled and transforms are applied. - Your objects need a clean UV layout to create a VAT map. Ensure no overlapping vertices before creating the VAT UV. Once done, you can modify UV Map 1 as needed. - Animate your object using any method (shape keys, bones, vertex-based animation with Blender’s *AnimAll* addon, object animation, etc.). - Ensure your UV unwrap has no overlapping vertices (e.g., from mirroring). - After finalizing your keyframes, select your objects, set the frame Start, End, and step rate in the Sansar addon. - Choose the export path and filename prefix, then click the process button. The tool will create the mesh and textures required for import into Sansar. - The generated mesh is essential for Sansar VAT and must be used as your import model. In Sansar: 1. Import the VAT Mesh files. 2. Set up the shader using the provided **VatMap** and **VatNormals**. 3. Adjust the step rate in the editor to see the animation. There is a chance you may need to save the material to see this correctly and allow the processing of the texture to complete. 4. Add other material maps (albedo, roughness, etc.) and save. --- ## Non-Vertex-Based Keyframed Animations For animations not inherently keyframed (e.g., cloth simulations), use workarounds like *Point Cache* `.mdd` import/export or Blender's *Bake to Keyframes* modifier. These methods generate usable keyframes. **Steps:** 1. Apply the scale, location, and rotation to the object (`Ctrl-A`). 2. In User Preferences -> Add-ons, enable: - *Import/Export NewTek MDD Format* 3. Export your animation using *File -> Export -> Lightwave Point Cache (.mdd)*. 4. Delete unsupported modifiers (e.g., Cloth Sim in Physics). 5. Re-import the `.mdd` file (*File -> Import -> Lightwave Point Cache*). The object will now have keyframes and shape keys, making it compatible with the VAT tool. Source: https://docs.sansar.com/create/materials/vat-shader-basics --- # VAT Technical Info ## Technical information on Sansar VATs This page covers the technical aspects of how Sansar VATs are done. This info is aimed towards advanced users who intend to try and create tools or use other programs to create VAT assets. If you wish to use the existing Blender tool, please see [VAT Shader Basics](/create/materials/vat-shader-basics.md). --- ## Texture Format Sansar expects both VAT textures (vertex displacement and normal rotation) as float (half) and in a specific format. Each pixel (except the pixel at x=0, y=0, which is the header pixel) specifies the displacement/rotation of a vertex at one point in time. In order to optimize GPU cache, the vertex/frame index is not directly related to an x/y coordinate in the texture but has to be specified in a sequence encoded in a z-curve (see https://en.wikipedia.org/wiki/Z-order_curve).

The order of the sequence is as follows: - The first pixel is a header pixel which contains information about the number of vertices and frames. - Then the displacement/rotation of all vertices in the first frame is given. - Then the displacement/rotation of all vertices in the second frame is given and so forth for all frames of the animation.

### Header Pixel The header pixel uses the Red and Green channels to encode the total number of vertices. It uses two channels in order to increase the allowed number of vertices beyond the capacity of a half-precision number. Sansar will decode the header pixel as follows: ```python vertex_count = (header.R + 2048) * 2048 + header.G + 2048 frame_count = header.B + 2048 ``` Thus, the header has to be encoded as follows: ```python header.R = (vertex_count // 2048) - 2048 header.G = (vertex_count % 2048) - 2048 header.B = frame_count - 2048 ``` ### Vertex Displacement The displacement of a vertex at one frame is given by the Red, Green, and Blue channels of the corresponding pixel, whereas the color channels directly correspond to the x, y, z displacement, respectively, given in object coordinates. ### Normal Rotation The rotation of the normal vector (better said the rotation of the tangent space) is specified for each vertex in a separate texture (VAT_normal.exr). Here the Red, Green, Blue, and Alpha channels correspond to the x, y, z, and w of a rotation quaternion, respectively. ### Mesh Format The mesh is given by an FBX format with the following specific requirements: * A secondary UV-map has to be provided to encode the vertex numbering. This is required because the order of vertices may be changed during import into Sansar due to mesh optimization. * Vertices with multiple different normals (e.g., at a sharp edge) need to be split if the animation moves the adjacent faces independently. This is required to specify a unique normal rotation for both sides. #### Secondary UV-map The exported mesh requires a secondary UV-map (which is generated automatically by the Blender add-on). The u/v coordinates of this map specify the vertex index to be used in the displacement and rotation map. Again both channels are used combined to increase the maximum number of vertices to be encoded with half precision. Sansar will decode the vertex index from the u/v coordinates by: ```python vertexIdx = u + 2048 + (v + 2047) * 2048 ``` Note that the v coordinate is shifted only by 2047 because Sansar internally flips the v coordinate on import and back in the shader. Therefore, the zero is shifted only by 2047 instead of 2048, which is the maximum number to be encoded by the 10-bit fraction in half precision. Thus, the UV data has to be encoded as follows: ```python vertIdx_LSH = (vertexIdx % 2048) - 2048 vertIdx_MSH = (vertexIdx // 2048) - 2047 uv_data = (vertIdx_LSH, vertIdx_MSH) ``` Source: https://docs.sansar.com/create/materials/vat-technical-info --- # Displacement Guides ## what is Displacement? Displacement is a new addition in its early release (Oct 2023) it has been added to most of the [Sansar shaders](/create/materials/shaders-information.md) and has static and animated forms, it is not intended to replace Normal Map detail as assets would be too high poly for this to be effective, it is however able to manipulate mesh and create animations within the edit mode without the original upload files. Please note, the displacement will move the existing vertices of the mesh according to the displacement map color, corresponding with the same vertex location on the UV map, but it will not create new vertices or the appearance of having more vertices, like pixel shaders do. ## How to use displacement The sansar displacement shader can be used in multiple ways we have defined it with two methods, a simple method and a Advanced method ## Local and Tangent Space A checkbox on the Animated shaders allows the Displacement to affect the mesh differently.\ **Local Object Space:** takes into account what the original model was exported with as its transform position (this can be different to what the sansar editor gizmo displays) **UV Tangent Space:** takes into account the direction of the face normals of the model.

Local Object Space

UV Tangent Space

Source: https://docs.sansar.com/create/materials/displacement-guides --- # Simple Displacement These example textures provided below can be used for any purpose and in any combination for static and animated displacement within Sansars material editor.

Files contained in the following folder

[Example textures for use with Simple Displacement](/downloads/simple-displacement-textures.zip) The simple displacement in Sansar uses "Red, Green, Blue, White and Black" or "RGB" to define each direction of vertices on mesh in 3D space, if using PNG textures you can only displace in a Positive direction, if you wish to utilise negative direction you will need to create EXR maps, covered more in [Advanced Displacement](/create/materials/displacement-guides.md). Displacement is influenced by the UV layout of a model. When applying displacement to items from the store for which you don't have access to the original files, the outcome may differ due to the significance of the model's UV layout and export settings. ## Displacement Map colors: This is a texture map that the shader reads the color information to determine the displacement strength and direction of the corresponding vertex. * Red = X axis direction * Green = Y axis direction * Blue = Z axis direction * White = All directions in the positive * Black = No displacement ## Displacement Factor Map: Think of this as a mask slot or as a 'strength' * functional as a greyscale mask, black being full strength and white being no displacement, this is the opposite to how other masks work within the shaders. ## Using Simple Displacement maps Avatar items are able to utilise the new displacement to create animated clothing and accessories, it is recommended to create a test within a edit world scene to be able to see what settings are required. **While in world edit:** 1. **Open the Materials edit window** * Right click the object you want to add displacement to. * You should see a pop-up menu appear, choose "Materials..." alternately you can use the short-cut "Ctrl + M" while your object is selected. 2. **Choose the shader and locate the map slots** * Select the shader you would like to use in the top right drop down menu. * Make sure the shader you are using supports the displacement you require (static or animated) by scrolling down to see if it has the right texture map slots or checking the [Shader info](/create/materials/shaders-information.md) page. * You are looking for the Displacement Map and Displacement Factor slots. * See "Texture Settings" screenshot that is also provided in the folder for reference.

Displacement Map and Factor slots

3. **Add Texture Maps to the Displacement Map and Factor slots.** ### Displacement Map Slot * Add any texture you like from the provided folder into the "Displacement Map" slot to see your object displace, you can also create your own! * White in this Displacement Map slot acts as full strength, while black acts as zero strength. * The displacement may initially be quite strong and distorted but can be adjusted further down the shader under "Displacement Scale" or with a factor map. ### Displacement Factor Slot * Optionally you can use the second slot "Displacement Factor" as a simple black and white mask. * Black by default in this Displacement Factor slot acts as full strength, while White acts as zero strength, the inverse to the Displacement Map menu. * Example: The gradient textures included in this pack will go from white (masked out) to black (full strength displacement) * All values in between black and white act as a sliding scale between the two values which determine the level of displacement strength. 4. **Tweak and adjust displacement settings** * Scroll down until you see "Displacement Scale" input boxes * This is where you can have greater control over the strength and turn on or off each direction, you can use these to compensate for a model rotation set by export. * To turn off a direction, type in 0 when using black and white texture maps. * I recommend trying values like 0.5 or 0.05 to get more subtle or toned down results. 5. **Choose between Local or UV Tangent space** * Displacement is defined by Local and Tangent Space for its direction, Local space is determined by the models export setting (this can differ from the editor Gizmo). UV Tangent Space is determined by the face direction of the mesh.

Local Space

UV Tangent Space

* Scroll down and find the "Displacement in LocalSpace" tick box, you toggle this on and off to see which result is preferable for your needs as it affects what direction the mesh is being displaced. 6. **Choose additional settings** * If using an animated shader the Factor and Map can also be animated either together or one or the other instead of remaining static this can be used to create interesting effects like bubbling water, flowing grass or leaves, waving flags, etc. ## Scrolling animated Displacement * For simple UV scrolling displacement animations, you can scroll the Map and Factor like other maps in sansar to achieve animated effects. "TextureSettings2" screenshot has also been provided in the folder for future reference.

Additional settings and options

## Flipbook Displacement * It is possible to use Flipbook sprite sheets to create an animated displacement that can be used to create more advanced looking assets, even mimicking particles, you need to create a sprite map of 'keyframed' displacement that you can use the regular flipbook settings to change between. * A new 'Blend Displacement Flipbook' checkbox has been added that interpolates between frames creating a smoother animation\
Source: https://docs.sansar.com/create/materials/simple-displacement --- # Working With Lights > Lights are intangible sources of light that can illuminate your scene. ## Working with lights in Sansar

All three types of lights interacting with an object in the scene.

*** **Light types** There are three types of lights in Sansar: directional, point, and spot lights - all of which behave differently. It is important to choose the right light in your scene to achieve the right effect. See [Light types](/create/lights/light-types.md) for information on the three types. Global illumination _Global illumination_ simulates the way light reflects off objects in a scene. For more information, see [Global illumination](/create/lights/global-illumination.md). **Adding lights to a scene** To add an object to your scene, click on the object and drag it into the scene area. This action adds the object into the _scene objects_ list and creates a model which you can position and edit in the scene. **Adding lights to an object** You can edit objects and add lights on it to make the object emit light. You can add any of the [three light types](/create/lights/light-types.md) on an object. See [adding lights](/create/world-editor/object-components.md) under [Object editing](/create/world-editor/object-components.md). Additionally, you can [import 3D models](/create/import/importing-items.md) with [point lights](/create/lights/light-types.md#point-light) already in place as part of an .fbx file.
Source: https://docs.sansar.com/create/lights/working-with-lights --- # Light Types ## Light types Lights are intangible sources of light that can illuminate your scene. Each type of light operates differently; make sure to choose the right light for each situation. ## Directional Light The directional light is a powerful light that can illuminate an entire scene. Typically, it is used to simulate the sun or the moon and is responsible for creating believable shadows in the scene. Only one directional light may be active in a scene at a time.

A directional light, represented by three arrows pointing in the direction the light shines.

*** Directional lights have the following editable properties, accessed by selecting the directional light and clicking the **Properties** button that appears: * **Position -** Set the position of the directional light in X, Y and Z coordinates. Regardless of this position, the directional light shines from the sky _behind_ the arrow pointers that represent the system object. This means that the arrows point at the area to be illuminated, not where the light appears to be emitted from. * **Rotation -** Set the rotation of the light. Light is emitted in the direction that the directional light is facing, from the sky _behind_ the system object. While the directional light typically provides illumination for a whole scene, this setting combined with **Position** can create the effect of the light shining directly on objects in the scene, and allows you to effectively set the time of day. * **Scale -** Has no effect on the light emitted. * **Color** **-** Set the color light emitted by the directional light. Set precise color values in Red, Green and Blue or click the dropper tool to open the Color panel and choose from a palette. * **Intensity -** Define how bright the directional light shines. Move the slider or enter precise values in the input field. ## Point Light

A point light emitting light in all directions, represented by a sphere.

*** Point lights emit light in all directions at once and can be placed in a scene in more than one location: * **Position -** Sets the location of the point light. Light appears to shine in all directions from this position in the scene. * **Rotation -** Does not have any apparent effect on the light emitted. * **Scale -** Does not have any effect on the light emitted. * **Color** - Set the color of the light emitted by the point light. Set precise color values in Red, Green and Blue or click the dropper tool to open the Color panel and choose from a palette. * **Intensity -** Define how bright the point light shines at its origin. Move the slider or enter precise values in the input field. * **Range -** Set the maximum radius to which illuminating light shines from the point light, regardless of intensity. Move the slider or enter precise values in the input field. * **Scriptable** - Allows the light's properties to be adjusted by the [Sansar Script API](/scripting/api-overview.md). If this switch is set to **Off**, scripts will throw an exception when trying to set the light's properties. ## Spot Light Spot lights shine in a specific direction, and can be placed throughout a scene: * **Position -** Sets the location of the spot light. Light appears to shine in one direction from this position in the scene. * **Rotation -** Sets the direction in which the light shines, represented by the wide end of the cone when editing a scene. * **Scale -** Does not have any effect on the light emitted. * **Color -** Set the color light emitted by the spot light. Set precise color values in Red, Green and Blue or click the dropper tool to open the Color panel and choose from a palette. * **Intensity -** Define how bright the spot light shines at its origin. Move the slider or enter precise values in the input field. * **Range -** Set the maximum range at which illuminating light shines from the spot light, regardless of intensity. * **Angle -** Sets the width of the spot light beam, allowing for a narrow, focused area of light or a wide floodlight. * **AngularFalloff -** Adjusts how much the light fades at the edges of the spotlight. Set close to zero to allow the light to shine at full brightness throughout the full arc. * **NearClip -** Sets the _near clipping plane_ of the spot light. This stops the light from shining on anything within the set distance of the spot light. * **CastsShadows** **-** Set to **On** to allow the spot light to cast shadows behind objects it shines upon. * **Scriptable** - Allows the light's properties to be adjusted by the [Sansar Script API](/scripting/api-overview.md). If this switch is set to **Off**, scripts will throw an exception when trying to set the light's properties.
Source: https://docs.sansar.com/create/lights/light-types --- # Global Illumination ## Global Illumination [_Global illumination_](https://en.wikipedia.org/wiki/Global\_illumination), also called GI for short, simulates the way light reflects off objects in the scene, providing more realistic-looking rendering at the cost of potentially reduced performance as the light reflections are calculated. Global illumination can be set with the **Global Illum Quality** dropdown menu under [Light Settings](/create/world-editor/scene-settings.md) in the [Scene Settings](/create/world-editor/scene-settings.md) properties panel. This setting determines the quality of global illumination shown in the scene, with increasing detail at each level. **Preview** provides the lowest detail and the fastest build time for the scene, and **Best** shows the most detail at the cost of a very extended scene build time. | ![](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------- | | Global illumination quality settings. | | **Note:** Activating global illumination can substantially extend the processing time required to build a scene. | **Tips and best practices** Here are a few tips, tricks, and best practices to help you get the most out of global illumination in its current evolving state: * If light leaks through some of the walls in your scene, consider making your walls thicker. * If your scene seems overly bright, try adjusting **Sky Brightness** in the [scene settings](/create/world-editor/scene-settings.md). * If you notice that the shadows in your scene that are lit by global illumination seem "noisy" or look like mosaic artifacts, you may need to consider setting **Global Illum Quality** higher. **Note:** Increasing global illumination quality also substantially increases processing time when building the scene.
Source: https://docs.sansar.com/create/lights/global-illumination --- # Working With Audio > Uploading audio in Sansar ## Working with Audio In Sansar, audio can be uploaded in [several file formats](/create/import/supported-file-types.md). If you are interested in uploading an sound file to your inventory from your computer, see [Uploading items in Sansar](/create/import/importing-items.md) for a step-by-step guide on the upload process. Adding audio to a scene Once a sound file is uploaded in Sansar, it becomes available in your [Inventory](/create/world-editor/scene-item-inventory.md). You can [manage](/create/world-editor/scene-item-inventory.md) and use your objects from your Inventory. In Sansar, you can [add sounds to an Audio Emitter](/create/audio-and-video/audio-emitter.md) or [add it as a component in an object](/create/world-editor/object-components.md). Previewing audio while editing a scene After uploading, the sound appears in your Inventory. You can right-click it and choose **Play** to preview it in a continuous loop, then right-click again and choose **Stop** to stop previewing. Audio Preview lets you hear sounds live during the layout editing process. It's a great time saver for playing sounds in a scene before publishing, as well as balancing sound emitter positions and volumes relative to each other. See [Audio Preview](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md) to learn more. See [Selling sounds](/store/selling/manage-listings.md). ## Ambisonic Sounds Sansar supports ambisonic surround sounds in [**AmbiX (ACN-SN3D)**](https://iem.kug.ac.at/fileadmin/media/iem/projects/2011/ambisonics11_nachbar_zotter_sontacchi_deleflie.pdf) format. See [Ambisonic sounds](/create/audio-and-video/ambisonic-sounds.md) to learn more. ## High-quality spatial audio The Sansar audio engine is designed to take full advantage of spatial cues. See [High-quality spatial audio](/create/audio-and-video/high-quality-spatial-audio.md) for more information on how you can take advantage of [Compute Scene Reverb](/create/audio-and-video/high-quality-spatial-audio.md) and [Occlusion](/create/audio-and-video/high-quality-spatial-audio.md) to enhance sounds in your scenes. ## Sansar audio FAQ See [Sansar audio FAQ](/create/audio-and-video/sansar-audio-faq.md) for answers to frequently asked questions about audio in Sansar.
Source: https://docs.sansar.com/create/audio-and-video/working-with-audio --- # Creating Media surface ## Creating Media Surface Media surfaces allow you to play web content in your scene using [Chromium Embedded Framework](https://bitbucket.org/chromiumembedded/cef), meaning that you can display most content that could normally be displayed in a web browser. A scene supports up to four media streams. Choose **Media Channel** (1–4) for each surface; multiple surfaces can display the same channel. Objects using the [Media Surface shader](/create/materials/shaders-information#media-surface) display web and video content. Sansar also supports interactive media screens; interaction on supported screens is local to you. Audio from the media plays back separately, from a position designated in [media stream settings](/create/audio-and-video/using-media-streams). You can create media surfaces yourself, or you can purchase one from another creator on the [Sansar Store](https://www.sansar.com/store).

An avatar watching a YouTube video on a media surface.

*** **Creating a media surface** Any object can be used as a media surface, but flat planes are typically most suitable for video and web playback. To upload an object as a media surface while in edit mode: 1. Click **Import > 3D Model**. 2. Click **Browse** under **3D model file** and choose a suitable model (.fbx) from your computer. [Here is a 16x9 screen that we have provided](/downloads/16x9.fbx). 3. Click **Materials Settings** to open the Materials Settings panel. 4. From the **Use shader** dropdown, choose **Media Surface**. 5. (Optional) Choose an **Albedo Map**, **Normal Map**, **Roughness Map**, **Metalness Map**, and/or **Emissive Map** to apply to your media surface. Note that these maps can potentially interfere with media playback if they are not designed to look like part of a media screen. 6. Click **Save Settings** to close the Materials Settings panel. 7. Click **Upload** to upload your media surface. 8. Drag your media surface from your inventory to the scene in order to place it in your scene. To set a media stream for your media surface, see [using and previewing media streams](/create/audio-and-video/using-media-streams.md). **Note:** To display side-by-side 3D content, choose the **Media Surface + Stereographic** shader. For more details on this shader and how to properly align side-by-side 3D content using the Media Surface + Stereographic shader, see [Materials editing and shaders](/create/materials/shaders-information.md). Tips Here are some suggested settings for setting up a media surface: * In the Materials Settings panel, under the **Media Surface** shader: * Set **Emissive intensity** to 0.25 for optimal results. The higher this scale, the more "glowy" the media surface becomes. Try to keep this setting below 1.0. * Set **UV scale** to 1.0, unless you want the video to be duplicated across the surface. * Set **Tint** to white (255, 255, 255) or gray (127, 127, 127). Download links * [16x9 media surface screen](/downloads/16x9.fbx)
Source: https://docs.sansar.com/create/audio-and-video/creating-media-surface --- # Streaming Web Audio ## Streaming Web Audio You can now stream live radio stations and more in Sansar. We support various formats like Shoutcast, Icecast, and other services using MP3-based URLs. **Note**: OGG format also works, but AAC format is not supported. **Streaming web audio in Sansar** There are currently two ways to stream web audio in Sansar: (1) using an audio emitter or (2) the [Scene Settings](/create/world-editor/scene-settings.md) menu. For both ways, you can click **Options** > [**Audio Preview**](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md) on the toolbar in the upper-left corner of the screen to test the audio in your scene. If it's a valid stream, you should hear the sound start shortly. | | | ------------------------------------------------------- | | Sansar Video Tutorial - Setting Up A Web Audio Stream. | Stream audio using an audio emitter To stream web audio in Sansar using an audio emitter: 1. Add an [audio emitter](/create/audio-and-video/audio-emitter.md) in a scene. You can learn more about adding audio emitters [here](/create/audio-and-video/audio-emitter.md). 2. Select the audio emitter to show its contextual menu, and click the properties button. 3. On the Properties panel, set the Sound Source to **Stream**. This changes the Sound field to **Stream**. 4. In the **Stream** dropdown, choose one of the [audio or media streams you defined](/create/audio-and-video/using-media-streams.md) in the [Scene Settings](/create/world-editor/scene-settings.md) under Web Audio Streams or Media Surface Settings. An audio emitter set to Stream is treated like any other sound in Sansar, which means that the sound is spatialized and can be an immersive part of in-scene sound. And just like any other emitter, you can change its shape to a cuboid or sphere to fill a larger area with sound, as shown here: | ![Audio emitter stream URL](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------- | | The Audio Emitter properties panel with Stream set as the Sound Source. | **Stream audio as a background sound** To stream web audio in Sansar as a scene sound: 1. Click on **Tools** > [**Scene Settings**](/create/world-editor/scene-settings.md) on the toolbar to open the Scene Properties panel. 2. In the Scene Properties panel, scroll down to the Background Sound section. 3. Set the Sound Source to **Stream**. This changes the Sound field to **Stream**. 4. In the **Stream** dropdown, choose one of the [audio or media streams you defined](/create/audio-and-video/using-media-streams.md) in the Scene Settings under Web Audio Streams or Media Surface Settings. If you stream web audio using the scene settings, the sound is non-spatialized, meaning it's not coming from within the scene, and is the same volume regardless of camera position. Be careful what you set the Loudness level to, because if it's too loud, your in-scene sounds will be drowned out and visitors will have a hard time using voice chat to communicate. | ![Scene settings stream URL](/media/screenshot-pending.svg) | | ----------------------------------------------------------------------------------------------------------------------------------------- | | The scene settings properties panel with Stream set as the Sound Source under sound settings. | **Getting web audio stream URLs from websites** Getting the link to an audio stream is pretty easy, as some websites provide the link directly. Simply copy and paste the link right into Sansar. If you're used to streaming audio in media players such as iTunes, they usually have an option to copy the Stream URL. **Shoutcast directory** For example, to get URLs from the popular Shoutcast directory: 1. Go to [shoutcast.com](https://shoutcast.com/) . 2. Click a genre you like. 3. Click the **Play** button to preview a station. 4. Once you've decided on a station you want to stream in Sansar, click the **Download** button to open a dropdown. 5. On the dropdown, choose **Any player (.m3u)** to start downloading the file. (The other formats work too, if you know how to parse the files.) 6. Find the downloaded file on your hard drive. 7. Right-click the file and use **Open with** to open it in a text editor like [Notepad++](https://notepad-plus-plus.org/). (The built-in Windows Notepad tends to show separate lines bunched together, which can make it harder.) 8. In the text file, you'll see several lines, and the Shoutcast audio stream, which starts with **http://**. For example, [http://178.33.232.230:8000](http://178.33.232.230:8000/) or [http://50.7.53.3:80/tuner24-01](http://50.7.53.3/tuner24-01) (These were working at the time this article was published.) 9. Copy and paste that URL into the Sansar Stream URL field.
Source: https://docs.sansar.com/create/audio-and-video/streaming-web-audio --- # Audio Emitter ## The Audio Emitter An Audio Emitter is an object that can be placed in a scene and plays a sound. You can drag a sound into a scene and attach it to an audio emitter that is _spatialized_, meaning the sound originates from the location of the emitter. To add an audio emitter to a scene: 1. While editing a scene, look at the Inventory panel at the bottom of the interface. 2. Set the filters to **System > Audio > Newest** | ![Inventory Audio Emitter](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------------------------------- | | Filter for System objects of the type Audio. | 3. Drag the Audio Emitter icon from the inventory to your scene. 4. Click the audio emitter and click the **Properties** button to see the following sound settings: * **Position** - An audio emitter can be positioned just like any other object, so you can control where a sound is coming from. You can also attach a [sound](/create/world-editor/object-components.md) or [audio stream](/create/audio-and-video/using-media-streams.md) to the object and the sound moves where the object moves. * **Rotation** - This rotates the soundfield orientation for stereo and [ambisonic](/create/audio-and-video/ambisonic-sounds.md) sounds, which is useful if you want to match an emitter with corresponding visuals around it. It does not affect mono sounds. * **Sound Source** - Choose between two sources for your sound: * **Inventory** - Choose this if you want to use a sound from your inventory. If chosen, a **Sound** dropdown appears under Sound Source. * **Stream** - Choose this if you want to stream music from live radio stations such as Shoutcast, Icecast, and other services using MP3 and more compatible formats. For more information, see [Web audio streams](/create/audio-and-video/streaming-web-audio.md). If chosen, you may choose a web audio stream or media stream from the dropdown. See [using and previewing media streams](/create/audio-and-video/using-media-streams.md) for more information on setting the audio and media streams. * **Sound** - Only available if the Sound Source chosen is **Inventory**. Choose a sound you have uploaded to your Inventory. The dropdown lists all audio files that are currently in your inventory. If [**Audio Preview**](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md) is on, the sound plays when you select it. * **Stream** - Only available if the Sound Source chosen is **Stream**. Choose a web audio stream or media stream from the dropdown. See [using and previewing media streams](/create/audio-and-video/using-media-streams.md) for more information on setting the audio and media streams. If [**Audio Preview**](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md) is on, the current Stream URL plays. If it's silent and Loudness is at a reasonable level, it might mean that the stream URL is down or invalid. **Note**\*\*:\*\* If the Sound Source is set to **Stream**, one of the options you may choose as the Background Stream is **Voice Broadcast**, which broadcasts the voice chat of designated avatars from the audio emitter. At this time, avatars may only be designated for broadcasting by using a script that uses the [ScenePrivate class of the Sansar Script API](/scripting/api/sansar.simulation/sceneprivate.md). * **Loudness** - Use the slider, or enter a value to set the relative volume level of the sound. Set your loudness based on either Level or dB values by toggling the dropdown. A new emitter has a reasonable default Loudness. * **Level values** - For audio newcomers. Use the slider, or enter a value to set the relative volume level of the sound using values between 0 to 100. Loudness becomes softer the closer the value is to 0, and becomes louder the closer the value is to 100. * **dB values** - For experienced audio users used to working with decibel gain. Use the slider, or enter a value to set the relative volume level of the sound in decibels. 0 dB is the base gain of the sound _after_ -3 dB peak auto-normalization has been applied during upload. This means sounds that you upload into Sansar may be relatively louder than before. * **Emitter Shape** - Choose between a _point emitter_ or a _volumetric emitter_ (also known as an _audio volume_) if you want a sound to fill a bigger or smaller area. Choose from the following: * **Point** - A point emitter is appropriate for smaller, focused sounds that originate from a specific coordinate. * **Cuboid** - A volumetric emitter, shown as a green box. **Cuboid Size** controls how far the sound goes before falling off. Enter XYZ values to change the sound shape. A typical use of a cuboid is filling a larger space with ambient sound, whether that is a room in a building or an outdoors environment. For example, a field of crickets at night. * **Sphere** - A volumetric emitter, shown as a green ball. Similar to the cuboid type, you can specify a **Sphere Radius** that determines how much area the sound fills before falling off. A sphere is useful to fill curved spaces where a cuboid may feel unnatural. | ![Properties Audio Emitter](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------------------------- | | Sound properties for a Point emitter with Inventory selected as the sound source. | **Note:** You may not hear much apparent difference at higher loudness level when using sounds that are inherently very loud (such as a distorted guitar or an airhorn), especially when other loud sounds are playing nearby. Sansar's audio engine attenuates the overall audio output to prevent hearing damage. Especially when working with multiple sound sources, it's best to err on the quieter side since emitter loudnesses add up, which is why the default Loudness is set at a conservative value. See the explanation below. It is possible to overlap emitters for layered sounds, and we encourage doing so for more detailed soundscapes. For example, if you're building a forest next to a beach, you can use different volumetric emitters for these zones that slightly overlap, so you hear a gradual transition from birdsong in the forest to waves lapping on the beach. To take this even further, you might even have staggered emitters with different wave loops of different lengths playing, reducing repetitiveness and increasing the variety you can hear while walking down the sandy shores. We recommend enabling [Audio Preview](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md) to hear sounds when in the layout editor, and enable [Compute Reverb](/create/audio-and-video/high-quality-spatial-audio.md#compute-reverb) to enhance the immersiveness of your spatial audio. **Note:** Sansar has HDR (High Dynamic Range) audio with a window of 36 dB — that's the range from the quietest to the loudest sounds you can hear. Loud sounds automatically "[duck](https://en.wikipedia.org/wiki/Ducking)" quieter sounds, enabling loud sounds to be heard more clearly. However, if too many loud sounds are playing at once, it sounds muddy and unpleasant because they are all fighting for attention. Another reason why we have implemented it this way is to prevent hearing damage from sustained loud sounds, or even transient "spikes" that may be startling and painful to your ears. We recommend that you lower audio levels of sounds that you want less emphasis on, instead of only raising the levels of sounds you want to stand out. This is known as "subtractive mixing", and results in a clearer soundscape. We also recommend testing voice chat in your scene. Unless the intention of your scene is to discourage voice chat (like how it's hard to hear others in a realistic nightclub), you should be able to clearly speak with others at a normal level without feeling you have to shout — think about your visitors! To calibrate your scene's general volume levels, visit our [360 Cinema Dome](https://www.sansar.com/worlds/sansar-studios/360-cinema-dome), which transitions from fairly prominent music inside the dome, to a more subtle soundscape on the outer walkway. Keep walking around the circle and pay attention to different sounds. There's gentle background ambience, but also "spot focus" sounds that are more prominent in the foreground. This should give you a better idea of how dynamic range sounds in action.
Source: https://docs.sansar.com/create/audio-and-video/audio-emitter --- # Sansar Audio FAQ > This article answers a variety of Frequently Asked Questions (FAQs) about working with Sansar audio. ## How do I get the most out of Sansar audio in my experience? Here are some quick tips: * Your scene should sound balanced, not unusually loud or soft. To calibrate your relative audio levels: * Visit various experiences by other creators, including our Sansar Studios experiences. * Test using voice chat with others, and make sure you can hear each other clearly. * The default loudness settings for audio emitters and the scene's Background Sound (found in [Scene Settings](/create/world-editor/scene-settings.md)) are intended to be reasonable starting points, and depending on the original sound content, are useful for subtler sounds meant to play in the background. You can increase their loudness as needed for foreground sounds meant to get attention, although we recommend you exercise caution against making sudden sounds _too_ loud, since it may startle visitors and make it difficult to voice chat. * Set objects to different [audio materials](/create/audio-and-video/using-audio-materials.md) so that footstep sounds and reverb are treated appropriately, and if you've got the visuals done and are iterating audio, be sure to enable [**Compute Scene Reverb**](/create/audio-and-video/high-quality-spatial-audio.md) (natural echo) in your scene. Otherwise, you won't hear the full effect of audio materials. * Think of your scene as having "audio zones" that transition smoothly from one to another. Be mindful of the audio mix sounding too cluttered, or music/tonal "[key clashes](http://www.harmonic-mixing.com/howto.aspx)" making visitors feel uneasy (unless that's your intent!). Here are some good articles on the topic that address both the technical and psychological impacts of thoughtful "audio zoning": * [**Dense Clarity — Clear Density**](https://transom.org/2005/walter-murch/#part-2) - Key considerations from Walter Murch. * [**Creating the Soundtracks to Visitor Experiences**](https://entertainmentdesigner.com/featured/sound-theming-creating-soundtracks-visitor-experiences/) - How music (and other sound) can affect mood. * [**How Mr. Q Manufactured Emotion**](https://web.archive.org/web/20100102004355/http://dustincurtis.com/how-mr-q-manufactured-emotion.html) - More lessons from Disney. * Walk through your experience in VR mode or ask a friend to visit your experience in VR. Turn your head around, pay attention to whether sounds match where they are coming from. Remember, especially in VR mode, audio can add a lot of immersion and value. Even subtle audio (such as "almost not there" room tone) can contribute to "[presence](https://en.wikipedia.org/wiki/Presence\_\(sound\_recording\))" and the feeling of "being there". ## What sound formats are supported in Sansar? For a full list of compatible file formats, please see [Supported file types](/create/import/supported-file-types.md). **Note:** Non-standard files in the formats on the list may not work, such as those that are using an additional compression format, or other unorthodox modifications. We recommend the following specs, which are common in the audio production and game industries: * **Format:** Uncompressed WAV, AIF, or FLAC * **Channels:** 1 (mono), 2 (stereo/binaural), or 4 (ambisonic). * **Sample Rate:** 48 or 44.1 kHz. If you're having difficulties uploading a sound file, try an [audio converter](https://en.wikipedia.org/wiki/List\_of\_audio\_conversion\_software) to convert it into the above specs. ## How big a .wav sound can I upload into Sansar? We haven't placed a strict cap on the size of .wav files in Sansar. If you're on a slower/unreliable Internet connection, an otherwise valid sound may show an "Upload failed" error. We've seen this when uploading longer ambiences or songs that are several minutes in length. In the meantime, retrying may eventually work. Or as a workaround: 1. Encode the .wav into an .ogg or .mp3, so it has a smaller file size. 2. Try re-uploading. This is not officially supported and may result in lesser sound quality, but trust your ears. Longer sounds need more memory for playback. This may be an issue if you visit an experience with many long sounds and are on a computer that doesn't meet our [recommended system specs](https://www.sansar.com/download). We are continually tuning Sansar's resource usage, so over time you should see reliability improve. You can do the easy [Sourceforge Internet Speed Test](https://sourceforge.net/speedtest/) to show our Sansar team your connection results. ## Why do some sounds get softer when others are playing? Sansar has an auto-mixing system that we're continuing to refine, so you can focus on delivering a great sonic experience without worrying about too many manual adjustments. This includes prioritizing some sounds so you can hear them better without the whole mix cluttering up, also known as [ducking](https://en.wikipedia.org/wiki/Ducking). Voice chat and scene-wide **Background** **Sound** are _not_ affected by the auto-mixer. For more information, see the "IMPORTANT:" note at the bottom of [The Audio Emitter](/create/audio-and-video/audio-emitter.md) article. ## When should I use the Scene Settings > Sound Settings > Background Sound? The **Background Sound** dropdown lets you choose one sound to loop indefinitely in your experience. Make sure this sound is a seamless loop, otherwise a hiccup or rough gap will be noticeably distracting each time it plays. This sound is _non_-spatialized — unlike in-scene emitters — and is fixed to the camera position, meaning it's always heard at a constant volume, and doesn't change relative to your context. Make sure it doesn't drown out other sounds. **Background Sound** is effectively a _non_-[diegetic](https://filmsound.org/terminology/diegetic.htm) sound that does _not_ originate from within the scene. For example, it would be odd to build a train station and use a steam engine as **Background Sound**, only to feel an uncomfortable disconnect as you walk far away from the train in the scene while the steam engine keeps playing loudly. We generally recommend limiting its use to those scenarios. In many cases, it is better to use an audio volume, as explained in [The Audio Emitter](/create/audio-and-video/audio-emitter.md). ## Does rotating an audio emitter affect which direction the sound comes from? With mono (1-channel) sounds, no. With stereo (2-channel) and [ambisonic sounds](/create/audio-and-video/ambisonic-sounds.md), the _orientation_ is affected. For example, say you have dragged a stereo sound from inventory into a scene so it appears as an emitter and the sound contains speech on the left channel and music on the right channel, clearly separated (also known as "hard panned"). If you rotate this emitter 180 degrees then publish your scene, then the left/right channels will flip relative to the listener. Experiment and hear for yourself!\ ## What's the falloff distance in Sansar sound and can it be changed? The falloff distance is modeled to simulate how sound naturally travels in the physical world. It cannot be changed, but audio volumes cover a number of situations in which sound needs to be sectioned into specific spaces. ## How do I make a sound cover a bigger area in a scene? We recommend that you change an audio emitter from a _point emitter_ to a _volumetric emitter_ (a spheroid or cuboid _audio volume_), then set its dimensions accordingly. This is explained in [The Audio Emitter](/create/audio-and-video/audio-emitter.md). Source: https://docs.sansar.com/create/audio-and-video/sansar-audio-faq --- # Using Media Streams ## Media Surfaces In order to make use of a [media surface](/create/audio-and-video/creating-media-surface.md), you must set a Media Stream URL. The Media Surface Settings section of the [Scene Settings panel](/create/world-editor/scene-settings.md) allows you to set a media URL and set the location and volume of audio playback in the scene for that media URL.

Media Surface Settings in the Scene Settings panel.

*** You can adjust the following settings: * **Media Stream Name** - Enter a name for the media stream. This is helpful for identifying the stream when setting up [audio emitters](/create/audio-and-video/audio-emitter.md) for positional audio. * **Media Stream URL -** Enter the URL of a web page you would like to play in your scene. Note that the media only plays once and then stops unless otherwise specified by the URL. Read on below for more information on how to properly format a YouTube or a Twitch URL for media surfaces. * **Source Width** — Set the media width in pixels (for example, 1920 for a 1920 × 1080 video). * **Source Height** — Set the media height in pixels (for example, 1080 for a 1920 × 1080 video). **Note:** In order to hear audio for a media stream, you must also set up an [audio emitter](/create/audio-and-video/audio-emitter.md) to play the audio portion of the stream. Formatting a YouTube embed URL for media surfaces YouTube (including live content) is officially supported for video playback. For the best playback experience, you need to format your **Media Stream URL** using specific flags: * **`https://www.youtube.com/embed/[VIDEO_ID]?autoplay=1&loop=1&controls=0&allowfullscreen=1&playlist=[VIDEO_ID]`**, where \[VIDEO\_ID] is the unique ID for the video. **Here are step-by-step instructions on how to construct the YouTube URL:** 1. Make sure to use the [embed](https://support.google.com/youtube/answer/171780?hl=en) link (only the part in quotes after "src=" in the Embed field). 2. Take note of the video ID, which is the text after the last forward slash in the embed link. For example: | **YouTube Link** | **Video ID** | | ----------------------------------------- | ------------- | | https://www.youtube.com/embed/oa1s4pka2pA | _oa1s4pka2pA_ | 3. Add (with no space in between):\ **`?autoplay=1&loop=1&controls=0&allowfullscreen=1&playlist=`** after the embed link. 4. Then, add the video ID after that string. For example, the media URL for the Sansar trailer (with the video ID "`oa1s4pka2pA`") would be: `https://www.youtube.com/embed/oa1s4pka2pA?autoplay=1&loop=1&controls=0&allowfullscreen=1&playlist=oa1s4pka2pA` ## Formatting a Twitch URL for media surfaces Twitch is officially supported for video playback in Sansar. For Twitch's current player requirements, see [Twitch embedding documentation](https://dev.twitch.tv/docs/embed/video-and-clips/). ## Audio Streams You may use [audio emitters](/create/audio-and-video/audio-emitter.md) to play up to four different audio streams in an experience. To set the audio streams for a scene: 1. While editing the scene, open the Scene Settings panel by choosing **Tools > Scene Settings**. 2. Under **Audio Streams** in the Scene Settings panel, enter info for up to four streams: * **Name** - Choose a name for the audio stream. This is a useful identifier when setting up [audio emitters](/create/audio-and-video/audio-emitter.md) to play the stream. * **Stream URL** - Set a URL for streaming audio content. 3. Place an [audio emitter](/create/audio-and-video/audio-emitter.md) in the scene, set its **Sound Source** to **Stream** in the Properties panel, and choose one of the audio streams from the **Stream** dropdown list.

Web audio streams in the Scene Settings panel.

*** ## Previewing your media streams You can preview your audio and media content by toggling **Audio/Video preview** in the **Options** menu while editing a scene. For more information on previewing media and audio in your scene, see [Previewing audio and video in a scene](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md).

Use Audio/Video preview to play your scene's media and sounds while editing the scene.

*** Known issues (March 20, 2018) Media surfaces can occasionally fail to play back media. The workaround for this temporary issue is to force the stream to reload, as follows: 1. Enable **Options > Audio/Video preview**. 2. Verify that the media surface isn’t playing and remains white. 3. Disable **Audio/Video preview**. 4. Open **Tools > Scene Settings**. 5. Scroll down to **Background Sound** in the Properties panel. 6. Set **Sound Source** to **Stream**. 7. Choose an Audio stream (not the Media stream). 8. Save the scene. 9. Open **My Experiences** from the App Launcher and reload the scene by clicking **Edit this scene**. 10. Open **Tools > Scene Settings**. 11. Scroll down to **Background Sound** in the Properties panel and set it to the Media stream. 12. Save the Scene. 13. Enable **Audio/Video preview**. 14. Verify that the media surface is playing as intended. You may need to repeat these steps multiple times before the media stream plays successfully.
Source: https://docs.sansar.com/create/audio-and-video/using-media-streams --- # Ambisonic Sounds ## Ambisonic sounds **Note:** You can hear our ambisonic demo by checking out the experience, [Ambisonic Audio Demo!](https://www.sansar.com/worlds/torley-jy5mj/ambisonic-audio-demo), in Sansar. Make sure to wear headphones and turn around as the sound plays. Sansar supports ambisonic surround sounds in [**AmbiX (ACN-SN3D)**](https://iem.kug.ac.at/fileadmin/media/iem/projects/2011/ambisonics11_nachbar_zotter_sontacchi_deleflie.pdf) format, which is quickly growing in popularity and supported in other VR and 360-degree environments like [Google's Jump and YouTube](https://support.google.com/jump/answer/6399746?hl=en). Ambisonics have been around for decades, and there has been revitalized interest due to their usefulness in virtual reality. A supported ambisonic file contains four channels of audio which sum to a spherical whole, and are spatialized accordingly in a scene. There are many variations out there; you may see reference to various "formats" and "orders". For the sake of simplicity, we use what's sometimes referred to as "first-order, B-format" AmbiX. **Note:** The [ACN](https://en.wikipedia.org/wiki/Ambisonic\_data\_exchange\_formats#ACN) channel order is different than some other B-format signals like [FuMa](https://en.wikipedia.org/wiki/Ambisonic\_data\_exchange\_formats#Furse-Malham). If you're trying to upload a (likely older) ambisonic file into Sansar and it results in an error, it's in the wrong format with a [different channel order](https://www.blueripplesound.com/b-format). You'll need a [converter](https://www.noisemakers.fr/ambi-converter/) to make those Sansar-ready. You can easily upload an ambisonic .wav file into Sansar, and use it to populate a scene with 360-degree surround sound: 1. Rename the file extension from "**.wav**" to "**.ambix**" for it to be recognized. 2. Follow the same [Importing Audio](/create/audio-and-video/working-with-audio.md) steps used for regular .wav files. ![Upload ambisonic file](/media/screenshot-pending.svg) **Tip:** if you need to batch-rename many files, get a utility like [Renamer](https://www.den4b.com/products/renamer) to save time. ### Getting the most out of ambisonics Ambisonics are decoded in Sansar so they can be enjoyed binaurally, with a quality pair of headphones like the built-in ones on the Oculus Rift. As you turn your head around — and this is especially noticeable in VR mode — you'll hear the ambisonic soundfield also rotate relative to your viewing/camera position. You don't need to manually position elements, and it can provide a convincing 3D illusion and supplement existing mono/stereo sound emitters in your scene. Like mono/stereo sounds, ambisonics can be used as in-scene emitters with falloff, or as **Scene Settings** > **SOUND SETTINGS** > **Ambient Sound**. Note that since ambient sound plays continuously at the same volume no matter what your camera position is and can't be rotated, it may sound unnatural as you walk around and isn't the intended use of a sound that belongs spatially _in_ the scene. And also like stereo sounds, rotating an ambisonic emitter reorients its soundfield. **Known issue:** Ambisonic rotation is currently broken. A fix will be in an upcoming release. Another advantage of ambisonics is that synchronous sight and sound can provide an enhanced sense of immersion. For example, if you've scanned a real-world environment using a 360 camera like a [Matterport Pro 3D](https://buy.matterport.com/), and you want the actual on-location sound to match. You'd set up ambisonic-supported microphones at the same location to record the "sonic fingerprint" of that place, then upload both the visual meshes and ambisonic soundfield into Sansar. Aligned correctly, it could feel a lot like being there! Like any tool, ambisonics is not a one-size-fits-all for sound needs. Knowing _when_ to use it is key: * More channels means more complexity, and since the file is "baked" or "flattened" as-is, it can be quite difficult — if not entirely impractical — to remove unwanted soundsources. For example, if you recorded a babbling brook and birdsong in the wild — but a loud train suddenly passes by in the distance — even with advanced noise manipulation tools, it could be incredibly difficult to "clean up" the train noise. It'd probably be better to make another recording (and monitor it carefully). * For the same reasons, if you want flexibility with positioning specific sounds to match in-scene objects as you iterate creating an experience, mono/stereo sounds may be a more appropriate choice. It's easier to move objects to correspond to cues in an ambisonic soundfield than vice-versa.\ ### Ambisonic resources We recommend reading [Creative Field Recording's comprehensive guide](https://www.creativefieldrecording.com/2017/03/30/ambisonic-field-recording-resources) to learn more about the intricacies of ambisonics, insights from veteran sound designers, and how to make your own recordings. If you feel adventurous, you can get started by buying a [Zoom H2n](https://www.zoom-na.com/products/field-video-recording/field-recording/zoom-h2n-handy-recorder) for about US$150 new. Feel free to share and sell your field recordings on the [Sansar Store](https://www.sansar.com/store)! If you'd rather not author your own ambisonics, you can download ambisonic files for testing and use in your scenes from these sources. Be sure to read any applicable licensing terms, and remember to rename their suffixes to **.ambix** before uploading: * [Oculus Ambisonics Starter Pack](https://developer.oculus.com/downloads/package/oculus-ambisonics-starter-pack/1.0/) - Also contains corresponding images for some sounds, giving insight into what the source locations look like. * [Ambisonic Toolkit Example Sound Files](https://www.ambisonictoolkit.net/download/recordings/) - Use the files in the "B-format" folder. There are also various high-quality sound stores that sell ambisonic sounds. Before buying, make sure they're in the correct format and loop seamlessly (if needed). For example: * [A Sound Effect's Ambisonics](https://www.asoundeffect.com/sound-category/misc-sounds/ambisonics/) * [ProSoundEffects' Ambisonics](https://shop.prosoundeffects.com/collections/ambisonics) As with visual VR, there's a lot of experimentation happening in this area, so expect the selection and quality to keep growing. Happy ambisonic explorations! Source: https://docs.sansar.com/create/audio-and-video/ambisonic-sounds --- # High Quality Spatial Audio ## High-quality spatial audio The Sansar audio engine is designed to take full advantage of spatial cues, and an important part of this is to enable you to accurately get information about sound playing around you with your eyes closed. ### Compute Reverb **Compute Reverb**, also commonly referred to as _bake reverb_, is a feature in the Scene Settings that calculates all the audio reflections in your experience — how sound bounces between object surfaces. It simulates the [reverberation](https://en.wikipedia.org/wiki/Reverberation) that happens in the physical world; think of how "wet" and echoey your voice sounds in a long brick tunnel, as opposed to how "dry" it sounds inside of a car. Each space has different physical characteristics and, as a result, you can tell a lot about where you're located, even with your eyes closed. Sounds in Sansar are realistically spatialized using a natural reverb that automatically makes the audio mix more cohesive. Even if you don't know a lot about the technical aspects of acoustic treatments and just want to place a few audio emitters around your scene, they should sound pretty good as a cohesive space. Distinct footstep sounds for most [audio materials](/create/audio-and-video/using-audio-materials.md) can always be heard, but baking reverb is required in order to hear materials' absorbtion, transmission, and scattering properties. In other words, if baked reverb is off, there is _no_ reverb. To bake reverb: 1. Click [**Scene Settings**](/create/world-editor/scene-settings.md). 2. In the Selection window, scroll to the bottom. 3. Click **Compute Reverb** to toggle it to **On**. | ![Scene settings, sound settings](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------------ | | The **Compute Reverb** control is in the Scene Settings Properties panel. | 4. In the global controls toolbar in the upper left, click [**Build**](/create/worlds/saving-and-building-scene.md#build-your-scene). A progress indicator appears as reverb is calculated. ### Occlusion _Occlusion_, in audio terms, is the tendency of objects in a scene to dampen or muffle sound. _Obstruction_ is a partial blockage, such as if you were to try talking to someone with some boxes between you—a common occurrence in open environments. Occlusion can be useful in creating clean and controllable soundscapes. For example, in a party setting you might walk to another room to escape the loud noise and have a quiet conversation. Occlusion can also help separate the sounds of the outdoors from indoor sounds, such as a fireplace. Occlusion is automatically included and enabled when you turn on **Compute Reverb** as described above. ### Visualizing occlusion To use audio occlusion effectively, it's helpful to see where the physical collision "walls" are in your scene, which may include boundaries that aren't normally visible. For example, you might have a skinny-looking tree that has a much broader physics shape, or a window you can see through that has a physics shape that's a solid wall— which blocks sound from propagating through it. By enabling **Physics Shapes** together with **Audio Volumes**, you'll have a better idea of how sound can travel around your scene. To do this: 1. Toggle **Visibility** menu > **Physics Shapes**. Applicable objects are shown in gray. Shapes with other colors are either dynamic or not collidable, and do not affect occlusion. 2. Also toggle **Visibility** menu > **Audio Volumes**, which are shown in green. | ![Visibility options](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------------- | | **Visibility > Physics Shapes** and **Visibility > Audio Volumes**. | Now you can see where your audio emitters (green) are placed relative to your physics shapes (gray). This makes it a lot easier to tell if an audio emitter (especially a _point_ emitter, which emanates from a precise coordinate) is positioned inside a physics shape that blocks it. If you have an issue with overly large physics shapes blocking sound unintentionally, you need to edit your content accordingly outside of Sansar, then [re-upload](/create/import/importing-items.md) it with a more precise collision mesh. **Tips and best practices** * For your final published experience, unless you have a specific intent in mind, we highly recommend turning **Compute Reverb** on to enrich your experience's audio quality for other users. * However, reverb bake time can add several minutes when [building your experience](/create/worlds/saving-and-building-scene.md#build-your-scene), so if time is crucial, you may want to leave it off when iterating on the visual aspects of your scene. * The reverb bake time depends on several factors, mainly your computer's speed and your experience's density of geometry. Experiences with many complex objects have a slower compute reverb time because of all the additional surface bounce calculations that are needed. If you optimize your content, fewer triangles could mean faster reverb raytracing. But, if a scene has very dense meshes — like lots of small triangles— or a lot of meshes, raytracing cost goes up and bake time increases. * [Physical objects that can move](/create/world-editor/object-motion-types.md) are ignored. Remember that we use static objects— shown in gray when you toggle physics shapes as described above— to calculate reverb and occlusion. These are the calculations that define which baked reverb [impulse response](https://en.wikipedia.org/wiki/Convolution\_reverb) you're hearing from your avatar's (or camera) position. If you've set walls and floors to be collidable and avatars are able to navigate sensibly through the space, it should sound great. If you're using [audio materials](/create/audio-and-video/using-audio-materials.md) and audio emitters, compare your scene with **Compute Reverb** **On** and **Off**, and listen to the difference it can make for you. Source: https://docs.sansar.com/create/audio-and-video/high-quality-spatial-audio --- # Audio Resource - Room Tones ## Room tones Our team at Sansar Studios is delighted to empower your creativity with the following [collection of "room tone" sounds on the Sansar Store](https://www.sansar.com/store/search?q=room+tones\&creator=sansar-studios). These are very subtle, seamlessly looping ambiences for use in your Sansar scenes. In the physical world, even a "quiet" room you step into is full of subtle sounds. Air molecules bouncing around, electricity in the walls, and even your own body's circulation affects how a place sounds to you. Sometimes, this relative (but not actual) silence is called [presence](https://en.wikipedia.org/wiki/Presence\_\(sound\_recording\)). Room tones can also help voice chat feel more natural, since if there are no other sounds playing, the total silence when nobody is speaking (called [dead air](https://en.wikipedia.org/wiki/Dead\_air)) can feel awkward. Room tones fill in the perception gaps and [contribute to an emotional and worldbuilding believability](https://designingsound.org/2012/11/room-tone-emotional-tone-the-importance-of-hearing-ambience/) of being in the same space. Our room tones are categorized by "Indoor" and "Outdoor" types, and are descriptively named to give you an idea of the source material and how you could potentially could use them. After you download a room tone to your inventory from the Store, you can drag it into a scene like any other audio emitter. Learn how in [Uploading a sound](/create/audio-and-video/audio-emitter.md). We recommend you place a room tone within a scene as a sound shape (volumetric emitter) which fills an appropriate area, since the room tones are [diegetic](https://filmsound.org/terminology/diegetic.htm) sounds meant to originate from within the Sansar virtual world. (As opposed to **Tools >** **Scene Settings > Background Sound**, which is intended for sounds that are playing "outside" of a scene at a constant volume.) The room tones have been edited to a somewhat louder level than their source recordings, which makes it easier for you to hear them — and how each has a unique [timbre](https://en.wikipedia.org/wiki/Timbre) or "tonal color" — without having to crank your volume all the way up. **Important:** Be careful while you're testing and protect your hearing. If you make a room tone very quiet and turn up your computer's local volume to hear them, remember to turn the volume back down when you're done, so subsequent noises don't startle you and hurt your ears. With [Audio Preview](/create/audio-and-video/previewing-audio-and-video-in-a-scene.md) on, you typically want to lower a room tone emitter's volume to your taste, to where it approaches the edge of your perceptible hearing. Since the intent of these room tones is more to be felt than heard, they can be used as foundational layers with more upfront sounds. Keep in mind that enabling [Compute Scene Reverb](/create/audio-and-video/high-quality-spatial-audio.md) and using [audio materials](/create/audio-and-video/using-audio-materials.md) affects room tones, just like any other in-scene sound. This can result in richer soundscapes that are even more believable. While the effect will be more subtle given the quiet nature of the room tones, it's still present. Related, since most of the room tones have a noticeable degree of inherent natural reverberation, baking reverb on a scene will in effect stack reverbs. This can be a desirable effect, but too much reverb can sound muddy, particularly with stronger audio materials like "Ceramic" and "Glass". These room tones were sourced from stereo .wav files. If you're wondering why they aren't [ambisonic](/create/audio-and-video/ambisonic-sounds.md), it's because ambisonic content tends to be noticeable when there are sounds with a greater dynamic range and directional content, whereas room tones are quite constant. This is different than, say, a recording of a bustling crowd, with vehicle traffic that ebbs and flows around you. As a general guideline, ambisonics could provide benefits in specific situations tailor-made for your scene. Furthermore, if you use multiple room tones in a scene along with other sounds, the cumulative soundscape could end up having a similar surround sound effect, anyway, since placing an ambisonic sound is basically a convenient way of achieving surround sound with one emitter, rather than several. Should you feel inspired to create your own room tones, we encourage your sonic adventures. Overall, feel free to let your creativity run wild, and if you find ways to use them we didn't think of, we'd love to know. Have fun with the room tones and show us what you've done with them! Source: https://docs.sansar.com/create/audio-and-video/audio-resource-room-tones --- # Previewing Audio and Video in a Scene ## Previewing audio and video in a scene Audio/Video Preview lets you view video on [media surfaces](/create/audio-and-video/using-media-streams.md) and hear sounds live while editing a scene. It's a great time saver for playing sounds in a scene before publishing, as well as balancing sound emitter positions and volumes relative to each other. Here is how to turn on Audio/Video Preview in Desktop mode: 1. In the top menu toolbar, click **Options**. 2. In the Options menu, select **Audio/Video Preview** to toggle it. At any time, select **Audio/Video Preview** again to turn it off. | ![Audio video preview](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------ | | Toggle **Audio/Video Preview** on the **Options** menu. | ### Audio/Video Preview affects: * The Background Sound in the Scene Settings, which is non-spatialized and plays at a constant level regardless of camera position. * _All_ sound emitters within the scene itself, which are spatialized and get louder as you move your camera closer. If you drag a sound from your inventory into a scene, the newly-placed emitter automatically starts looping the sound. * [Media surfaces](/create/audio-and-video/using-media-streams.md), which play their designated media. **Note:** All of these media types are previewed at once when you toggle Audio/Video preview and cannot be previewed individually. Audio/Video Preview does not include [Compute Scene Reverb](/create/audio-and-video/high-quality-spatial-audio.md), which needs to be calculated after you click **Build**. It's still very useful to fine-tune your desired soundscape before it is treated with reverb and occlusion, which can make an already great-sounding scene even more cohesive. While Audio/Video Preview is on, you can continue to move emitters as you normally would, and hear how sound changes based on your position. Audio/Video Preview also works with VR mode. If you put on a VR headset with headphones and move sound emitters, you'll hear audio from your first-person perspective — this can be a very effective and fluid way to directly edit the scene. ### Adjusting rotation with Audio/Video Preview on If a an emitter contains a stereo/binaural or [ambisonic sound](/create/audio-and-video/ambisonic-sounds.md), you can rotate it to change the soundfield's orientation: 1. Click an audio emitter in your scene. 2. Drag the blue rotation handle. On a point emitter, you see its green "speaker cone" rotate to match. ![Sound point emitter showing blue rotation](/media/screenshot-pending.svg) This is a convenient way to align sounds to match visuals. For example, if you have an ambisonic sound recorded at a location in the physical world where there is fire crackling in one direction and seashore waves lapping in the opposite direction, you can rotate it to align with the virtual seaside campfire you may be creating, and adjust the layout as you continue building your scene. Adjusting volume with Audio/Video Preview on In addition to hearing sound emitter position and rotation changes in real time, you can also hear volume level changes: 1. Click an audio emitter. 2. Click **Properties**. 3. In the emitter’s Properties panel, adjust the **Loudness** slider as desired. You may adjust the loudness using **Level** or **dB** values. Notice how the volume changes as you drag it. | ![Loudness](/media/screenshot-pending.svg) | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Note:** 40 Level is the default for an Audio Emitter, comparable in the real world to moderate-level sounds, like a running river or light traffic. However, the perceived volume depends on a number of things including the actual sound file's [dynamic range](https://en.wikipedia.org/wiki/Loudness\_war) and frequency content. | ### Audio Mixing Tips If you are new to working with audio and balancing levels, we generally recommend that you mix _subtractively_: if the soundscape feels cluttered and a lot is sonically happening, reduce certain emitter volumes rather than raising the ones that should be louder. When there are a lot of sounds playing, it is more effective to have some audio be felt as a "presence" — comparable to how subtle shade adds depth to visual objects — instead of overwhelming and fatiguing ears with noise. This also has the additional benefit of making it easier for visitors who use voice chat in your scene, since they are less likely to have to shout if the sounds are well-balanced.
Source: https://docs.sansar.com/create/audio-and-video/previewing-audio-and-video-in-a-scene --- # Using Audio Materials > Audio materials let you set objects to a specific material type. This is advantageous when you want to alter the way sounds play in a scene. ## Uses for audio materials ## Reverberation and occlusion You can take advantage of audio materials in order to set the way sounds bounce off objects and through objects in a scene. In Sansar, you can set sound waves to bounce off objects in a scene, which can create interesting reflective sound behavior. This is referred to as _reverberation_. For example, singing in the shower produces a more echoey sound compared to singing in other rooms. This is mostly because bathrooms have tile, metal, and other reflective surfaces that have different properties compared to a living room with reflection-dampening rugs. To enable this, you must turn [**Compute reverb**](/create/audio-and-video/high-quality-spatial-audio.md) on. When compute reverb is on, _occlusion_ will also be enabled in the scene, which affects the way the sound passes through objects. For example, sounds that is generated on one side of a wall will sound muffled or dampened as it passes through to the other side. You can alter the way sound is produced in a scene by following these steps: 1. While editing a scene, turn on [**Compute reverb**](/create/audio-and-video/high-quality-spatial-audio.md) in the scene settings panel. To know more about how to turn this on, see steps [here](/create/audio-and-video/high-quality-spatial-audio.md). 2. Click on an object that you want to apply the audio material on. 3. Open the object's properties panel. Read more on how to edit an object's properties panel [here](/create/world-editor/scene-object-panel.md). 4. Look for **Audio material** on the audio settings section of the properties panel. 5. Click the dropdown beside **Audio material** and choose a material. 6. To preview how the sound bounces off objects, [build your scene](/create/worlds/saving-and-building-scene.md#build-your-scene). Try out the various audio materials in your scene with reverb on to see how reverberation and occlusion affect sounds as they bounce. ## Footstep sounds Audio materials also affect footstep sounds when assigned to walkable objects or terrain. For a quick comparison of the audio materials available in Sansar, visit [Creator Academy: The Hall of Materials](https://www.sansar.com/worlds/sansar-studios/creator-academy-the-hall-of-materials). In the experience, notice the pads at the end of the hall to hear the audio material type as your avatar walks over the pads. You can alter the way footsteps sound as avatars walk over the object surface or terrain: 1. While editing a scene, click on a terrain or an object that you want to apply the audio material on. 2. Open the object's properties panel. Read more on how to edit an object's properties panel [here](/create/world-editor/scene-object-panel.md). 3. Look for **Audio material** on the audio settings section of the properties panel. 4. Click the dropdown beside **Audio material** and choose a material. 5. To hear how the sound bounces off objects, [build your scene](/create/worlds/saving-and-building-scene.md#build-your-scene). **Note:** Compute reverb does not need to be enabled for footstep sounds. However, when it is on, reverberation and occlusion also applies to footstep sounds. | ![Audio materials](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------- | | Find the **Audio materials** dropdown menu in the object or terrain's properties panel. | ## List of audio materials In Sansar, there are various preset material types that model their real-world, physical counterparts. Here is a list of the audio materials available in Sansar: * **(Generic)** - Default: neutral-sounding footsteps. Similarly subtle reverb. Medium-strength occlusion effect, like hearing something through typical home walls. Sorted to top of list. * **Brick** - Crisp footsteps. Long reverb. Strong occlusion — all in all, just another brick in the wall. * **Bushes** - Crunchy, varied footsteps with a lot of overlap. Useful for simulating walking through twigs and other organic matter. Weak occlusion that softens the sound a little. * **Carpet** - Very subtle footsteps unless you're running. Very absorbent and strong occlusion, which makes carpet a good dampening material with barely any reverb. * **Ceramic** - Highly crisp footsteps. Can also be used for marble tile and similar substances. Strong reverb. Occlusion softens low frequencies more than high ones. * **Concrete** - Crisp footsteps. Useful for interior industrial spaces like warehouses and factories. Strong occlusion, like a very thick concrete wall would be. * **Dirt** - Crisp organic footsteps. Highly absorbent. Occlusion is fairly strong. * **Glass** - High-pitched, clinky, fragile footsteps. Fairly strong reverb. Occlusion dampens low and high frequencies more than midrange. * **Grass** - Crunchy footsteps with some overlap. Pretty quiet. Use in combination with "Bushes" for naturally-varied terrain. Barely occludes at all. * **Gravel** - Crunchy footsteps with occasional overlap. Relatively louder than "Dirt" and "Sand", like how real gravel would be. Occludes less than "Dirt". * **Metal** - Clangy, metallic footsteps. As the name indicates, generally useful for metal platforms, stairs, and similar surfaces. Strong reverb. Medium occlusion with midrange frequencies more noticeable. * **Mud** - Squishy footsteps. The footsteps sound more splattery while running. Also useful for ground transitions between Dirt/Gravel/Sand and Water. Occlusion is similar to the Water material. * **Plaster** - Somewhat muted footsteps. You could use this as a milder alternative to "Brick". Long reverb. Fairly weak occlusion, like fragile plaster surfaces. * **Rock** - Crisp footsteps with some subtle grit, simulating walking on larger rocks with smaller stones interspersed. Relatively strong reverb and occlusion, suitable for caves and tunnels. * **Sand** - Scattered organic footsteps. A quieter and finer texture than "Dirt" or "Gravel". Occludes fairly strong, like "Dirt". * **Silent - Blocking** - No footstep sounds. No reverb at all. Occlusion totally silences sound from the other side of a collidable, making it useful for segregating sound in small spaces. * **Silent - Nonblocking** - No footsteps. this is totally acoustically transparent and passes sound through without alterations. Useful for invisible walls you want only blocking navigation, not sound. * **Snow** - Crunchy, varied footsteps with a lot of overlap. Running gives the footsteps more impact. Naturally complements tundra terrain. Moderately weak occlusion, but still noticeable with higher frequencies. * **Water** - Loud, splashy footsteps, wading through water. Occlusion removes high frequencies and dulls the low-end, making things sound muffled. * **Water - Shallow** - Similar to the regular water audio material, but with shorter, milder liquid splashes during footsteps. Apply this to puddles and standing water. * **Wood** - Crisp footsteps. Noticeable reverb. Moderate occlusion, except for dampened high-frequencies. * **Wood - Creaky** - Has a lot more "personality" than the general Wood material, with lots of wear and tear. Keep running and you'll hear very loud squeaks — suitable for haunted houses and rickety bridges! Moderate occlusion, except for dampened high-frequencies. * **Wood - Plank** - Related to Wood, but with a lower pitch. Like walking on a boat dock, or just use it to add variety to parquet surfaces adjacent to regular Wood. Moderate occlusion, except for dampened high-frequencies. Some types share the same footstep [foley](https://en.wikipedia.org/wiki/Foley\_\(filmmaking\)) yet have different reverb properties, while others have their own unique footstep sounds. For example, even though gravel, dirt, and sand are all made of small bits of earth in the physical world, they have distinct sonic identities. ## Tips and best practices * When using audio materials, you don't need to be literal about matching an a material type to a walkable surface. You can mix and match material types with any object or walkable surface— regardless of the material name, trust what sounds right. For example, you might have a dull metallic surface that feels more convincing with "Concrete" than "Metal". * As with other Sansar audio features where spatial audio can be a key contributor to immersion, we recommend you test your own experience with a good pair of headphones, and, if possible, in VR mode. * Room size matters with reverb. Setting a really big room (with collidable walls on all sides) to a highly reverberant audio material will sound a lot more “echoey” than a small room with the same audio material. * Audio materials only fully work with static physics shapes, which may be associated with a mesh object or exist by themselves. To toggle physics shapes, go to **Visibility** > **Physics shapes**. The static shapes appear in gray. Dynamic shapes that appear in yellow will work with footstep sounds, but are ignored by reverb and occlusion. Related, see "[Making an object dynamic](/create/world-editor/object-motion-types.md)". * You may find it easier to assign audio materials to objects by momentarily hiding **Visibility** > **Meshes** and focusing on the actual collidable areas. Remember, audio materials won't work if they're applied to an object without a physics shape, since those are effectively "phantom" objects that your avatar or other objects pass through. * Audio occlusion only applies to the nearest collidable to your camera (your "listening point"), because it can be computationally expensive. For example, if you're in 1st or 3rd person view and there are several "walls" in between you and an audio emitter, only the audio material of the closest wall to your avatar has an effect. Even if it's set to be a weaker audio material than the walls behind it — say for example, a grass hedge in front of brick walls — the nearest wall always takes precedence. While fairly uncommon, this can result in a strange sensation of "hearing through walls" at closer distances. We recommend you thoroughly test your experience, and generally design for the nearest collidables in key navigable areas to also be the strongest audio materials.
Source: https://docs.sansar.com/create/audio-and-video/using-audio-materials --- # Marvelous Designer Integration ## Marvelous Designer integration [Marvelous Designer](https://www.marvelousdesigner.com/) is a 3D virtual clothing creation tool that allows you to design clothing by creating patterns, such as those used in sewing. Clothing made in Marvelous Designer can be manipulated using adjust clothing and transformation modes in Sansar's avatar editor, allowing you to customize the way your avatar wears each piece of clothing. For example, you could add a long-sleeved shirt to your avatar in the avatar editor, and then use adjust clothing to roll up the sleeves, smooth out bunches and wrinkles, or pop the collar. Marvelous Designer clothing can be identified in the Sansar Store by the **Made with Marvelous Designer** banner that appears on relevant listings. While editing your avatar in the avatar editor, Marvelous Designer clothing is identified with an "M" logo on the clothing's thumbnail image.

Clothing marked with Marvelous Designer's "M" logo in the Lookbook clothing inventory.

*** ### Additional resources * See [Fitting Marvelous Designer clothing to your avatar](/avatars/dressing/fitting-designer-clothing-to-your-avatar.md) for information about how to adjust the fit of Marvelous Designer clothing. * See [Marvelous Designer creator resources](/avatars/resources/avatar-reference-files.md) for default avatar templates and information. * See [Marvelous import and export](/create/marvelous-designer/import-export.md) for information about how to setup for export and import MD clothing to Sansar.

Two images of the same avatar wearing the same Marvelous Designer clothes before and after adjustment in the avatar editor using adjust mode. Note the sleeves, pant legs, and collar.

*** **Notes:** * At this time, you can only adjust or manipulate marvelous designer clothing in the editor. This means that you can use adjust or transformation modes to adjust the fit of your clothing, but the final result will be "baked" into your avatar and the cloth will not continue to simulate while visiting a scene. Source: https://docs.sansar.com/create/marvelous-designer/integration --- # Marvelous Designer Creator Resources ## Marvelous Designer creator resources Using a Sansar avatar model in Marvelous Designer For the best results when designing clothing for Sansar avatars, use one of the provided avatar templates. This ensures that the clothing you create will be fitted to the male or female default avatar in Sansar. In Marvelous Designer: In some versions of MD the sansar avatar is included (MD 9 and above). if it is not you can import the default reference files.

1. Choose **File > Import > FBX**. 2. Choose the male or female avatar template provided in [Avatar reference files](/avatars/resources/avatar-reference-files.md#avatar-reference-files). 3. In the Open Avatar panel that appears, make sure to select **cm** as the scale. If you leave it at the default mm setting, the avatar appears too small. 4. Click **Ok** to load the avatar. 5. Close the Avatar Editor panel that appears. 6. You may now begin designing clothing for Sansar avatars. Avatar model files Sansar's avatar model files can be found in the article: [Avatar reference files](/avatars/resources/avatar-reference-files.md#avatar-reference-files). Exporting from Marvelous Designer For a full setup guide please see [Marvelous Import and Export](/create/marvelous-designer/import-export.md) When you are done creating and fitting your clothing, you can export it in a Sansar-compatible format: 1. Choose **File > Export > Sansar (SAMD)**. 2. Choose a location to save your file, choose a file name, and click **Save**. 3. Your clothing has been exported! You may now [Import it to Sansar](/create/marvelous-designer/import-export.md#importing-md-items-to-sansar) to either wear or sell.

Export Sansar clothing from Marvelous Designer by choosing File > Export > Sansar (SAMD).

Source: https://docs.sansar.com/create/marvelous-designer/creator-resources --- # Marvelous Import and Export ## Exporting from Marvelous Designer 9 Once you have your clothing item made this guide will help you to get your file ready for exporting from MD to then import into sansar and for texturing externally in programs like substance painter. **NOTES:** - Sansar only allows 1 material slot for MD based items so all of your materials (fabrics) will be combined into one set of Texture maps when exported so make sure you have no overlapping parts you need to texture separately. - Fabrics slots will still retain any individual settings the fabric itself had so even though they will be combined into a single map the individual cloth settings will remain. See [MD Limitations](/create/marvelous-designer/limitations.md) for more info. - If you edit your pattern in any way you will need to repeat the UV alignment steps. *** ## Step 1: Arrange your patterns. You need to arrange your patterns as best you can into a square shape, as MD's 2d window also effects the size of the actual mesh just arrange them the best you can without resizing, you are ok to move and rotate and also make sure nothing is overlapping and has a bit of room 'Padding' around each part.

*** ## Step 2: Setting up the UV alignment. Open the 'UV Editor' window from the top right menu

In the UV Editor window, Right click, then 'Set UV from pattern alignment' Your map may be in a different position than shown as it is based on its positioning in the 2D window, but will be fixed by the next step.

Now Right click again, and select, 'Fit UV to unified (0-1)'

In the next box that pops up: Set to; relative uv coordinate (0-1) make sure the number is 0.01. and this should fix the positioning.

## Step 3: Create a save point! After completing these steps make sure to create a save at this point in case you need to return as exporting can sometimes cause a crash in MD. If you edit the patterns in any way these previous steps will also need to be redone. You are now ready to export your files a .SAMD for import into sansar and a .FBX for use in texturing that can also be uploaded to edit mode to use as a display item (it is recommended to optimize this mesh if using for edit mode). ## Step 4: Exporting your .SAMD file MD will automatically pack all fabrics into one material slot for the .SAMD On the top left Click File > Export > .SAMD and select your desired location.

Now Set to; Use UV Map on UV Editor, Then Click OK

You have now created the .SAMD file you will use to upload into sansar. If you have done your texturing in MD it may work but is usually not a good match in sansar and it is recommended to create your textures separately. ## Optional: Exporting a UV map for 2D texturing If you are texturing manually with 2D maps you can export a UV layout to make it easier to line up your texture in a image editing program. In the 'UV Layout' window at the top left click the 'UV Snapshot button'.

Choose your Path, Your desired texture image size (2048 is fine most of the time) and make sure your UV area is set to (default) 0 - 1. ## Step 5: Exporting a .FBX from MD for texturing **NOTES:** - When Exporting a .FBX for texturing if you have more than one fabric (material) you may need to combine them into a single slot once exported, this is easier to do externally in blender rather than changing your MD projects file. - If you just require the garment for texturing you need to temporarily delete the Avatar from the scene otherwise it will be exported also. later versions of MD have this as a option on export. *** In the Simulation window **Right Click** the avatar and select 'Delete all Avatars'

With just the garment in the scene at the top left, go to File > Export > FBX and choose your desired location.

Selecting the following settings - **Single Object** - combines the mesh into a single object. - **Thin** - sansar only accepts thin. - **Unweld** - doesn't combine seams vertex'and gives better shading. - **Unified UV coordinates** - exports the UV in 0 - 1 range. - **Fill Texture Seams** - set to about 4mm this is texture padding. - **Unified Textures** - combines any separated texture uv's into one (doesn't combine materials) - **Auto Scale** - matches the scale you patterned with.

## Step 6: Removing extra material slots If you had more than one Fabric type (material) you will need to remove them from your FBX in order for it to match sansars single material texture slot. This only needs to be done for your FBX you are using to texture and has no effect on the properties of the imported file. as the .SAMD export does this for you. if you only used one Fabric (material) in MD you can skip this step and use your .FBX right away.

Once exported from MD you can import your .FBX into Blender (or other 3D software)

Now select the garment in 'Object mode' (highlights in bright orange), opening the material properties panel on the right and delete all but **one** material slot.

*** ## Optional: FBX cleanup **NOTE:** It is considered good practice to name your mesh and the remaining material slot while here and also apply any scale and rotations that have been picked up along the way by having your object selected and pressing CTRL+A and then apply all transforms. Best done if you intend to import the mesh into edit mode as a in world demo model.

## Step 7: Export single material FBX. Now with your garment selected you can Re-Export a new .FBX for use in 3D texturing programs like substance painter with a single material slot matching sansars .SAMD material setup. By going to File > Export > FBX then choosing your desired path and the following settings.

Your .FBX is now ready to use for texturing, and matches the .SAMD exports material and UV layout. **NOTES:** - It may be a good idea to optimize the garments mesh as it is considered higher poly than needed for a display but not recommended if you are using it to texture as you want the best match to your .SAMD - This FBX is not used for import to the avatar clothing slots and would require rigging in order to be used on a avatar. ## Importing MD items to Sansar Coming soon... Temp info: Import the .SAMD into the clothing slot of the chosen gender in lookbook. Source: https://docs.sansar.com/create/marvelous-designer/import-export --- # MD Limitations ## Marvelous Designer limitations Some Functions in MD for clothing do not transfer to sansar, so even if you use them they will not work once imported. ## Unavailable Functions Thickness Trims Topstitch - Considered too High Poly Buckles Cords and Cord ends Rings Shoulder pads High Poly - Sansar will auto decimate MD items below 15k tris. High Density verts - Sansar will only allow a edge length of 15 or above and will Auto crush anything below. MD's texture quality will be different in sansar due to compression. MD is unable to create emissive texture maps. MD is unable to create Alpha textures that work in sansar. Rigging information - Sansar cannot read any rigging information from MD it will auto weight once in game. Sansar has auto weighting issues with long sleeves Sansar has auto weighting issues with wide pants / long capes Sansar had auto weighting issues with fabric that is close to other parts like inner thighs, arm pits, and sometimes feet ## known working Buttons & button holes - only one size of button should be used - they are also high poly and will use a lot of your allowance up consider faking them. Zippers - can be zipped and unzipped in sansar. Offset - distance from the avatars skin. Physical properties of fabrics - most if not all properties work elastic seam taping Pins - will cary over and can be removed by users. Steam - known to cause texture issues use sparingly. pressure layers - cannot be edited in game and can create problems with other items solidify bond/skive Source: https://docs.sansar.com/create/marvelous-designer/limitations --- # Scripting > Add behavior to your worlds with C# scripts: guides, example scripts and the Script API reference. - [Sansar Script API](/scripting/api-overview) - [Restricted APIs](/scripting/restricted-apis) - [Allowed .NET APIs](/scripting/allowed-dotnet-apis) - [Script API Updates](/scripting/script-api-updates) - [External Script Repositories](/scripting/external-script-repositories) ## Scripting guides - [Intro to Scripting in Sansar](/scripting/guides/intro-to-scripting-in-sansar) - [Working With Scripts](/scripting/guides/working-with-scripts) - [Adding Scripts to an Object](/scripting/guides/adding-scripts-to-an-object) - [Setting Script Parameters](/scripting/guides/setting-script-parameters) - [Using the Script Console](/scripting/guides/using-the-script-console) - [Working With Trigger Volume](/scripting/guides/working-with-trigger-volume) - [Referencing Scene Components](/scripting/guides/referencing-scene-components) - [Configuring Teleport Scripts](/scripting/guides/configuring-teleport-scripts) - [Simple Script User Guide](/scripting/guides/simple-script-user-guide) See also: - [Importing custom scripts](/create/import/importing-custom-scripts) ## Example scripts - [Example Scripts in Sansar](/scripting/examples/about) - [Cannonball](/scripting/examples/cannonball) - [Follow The Path](/scripting/examples/follow-the-path) - [Random Movement](/scripting/examples/random-movement) - [Reflective Detector](/scripting/examples/reflective-detector) - [Simple Script](/scripting/examples/simple-script) - [Sound Randomizer](/scripting/examples/sound-randomizer) - [Stats Example](/scripting/examples/stats-example) - [Teleport Hotkeys](/scripting/examples/teleport-hotkeys) - [Visitor Tracker](/scripting/examples/visitor-tracker) - [Mover Examples](/scripting/examples/mover-examples) ## See also - [Script API reference](/scripting/api) - [Patch notes](/patch-notes) Source: https://docs.sansar.com/scripting --- # Sansar Script API > Sansar uses C# scripts to provide dynamic behaviors and interactions. Sansar uses a limited subset of the mono .net api. Click [here](/scripting/allowed-dotnet-apis.md) for a list of C# libraries usable by Sansar scripts. ## Documentation for the Sansar script API. *** Creating a Sansar script: 1. Choose a base class for your script depending on where the script will live and what APIs it needs access to. There are three core APIs: **Object**, **Scene**, and **Agent**. Each of these is split into two interfaces: a **Public** interface that is generally available and a **Private** interface that is a more complete superset of the Public interface. The base class chosen will determine which APIs are available to the script. * [SceneObjectScript](/scripting/api/sansar.simulation/sceneobjectscript) runs on scene content and exposes **ObjectPrivate** and **ScenePrivate**. * [ObjectScript](/scripting/api/sansar.simulation/objectscript) runs on scene content or objects created by scripts and exposes **ObjectPrivate** and **ScenePublic**. Use these supported base classes. **AgentScript** cannot currently be attached to agents. **SimpleScript** is deprecated; use SceneObjectScript or ObjectScript. 2. Create a new class that extends the chosen base class. **C# Example** ```csharp public class MyScript : SceneObjectScript ``` 3. Create public fields of supported types for any parameters that should be set in the object properties when editing the scene. **C# Example** ```csharp public bool TrackAgentHits = true; public bool TrackObjectHits = true; ``` 4. Override `Init()` to subscribe to events and handle them, or initialize coroutines that wait for events. **C# Example** ```csharp using Sansar.Simulation; public class MyScript : SceneObjectScript { public override void Init() { ScenePrivate.User.Subscribe(User.AddUser, (UserData data) => { var agent = ScenePrivate.FindAgent(data.User); if (agent != null) ScenePrivate.Chat.MessageAllUsers($"Welcome {agent.AgentInfo.Name}!"); }); } } ``` 5. Upload the script in Sansar via the "Upload" button in inventory while editing a scene. * Errors and Warnings will show in the upload window. * Some APIs are restricted, and scripts that use them get a warning. See [Restricted APIs](/scripting/restricted-apis). * The allowed C# libraries are limited. 6. Once successfully compiled the script will show up in inventory. Drag it from there onto an object in the scene. * Only successfully compiled scripts will be added to inventory. 7. Edit the properties on the object to set any parameters from the public fields set in step 3 above. 8. Save and publish the scene.
Source: https://docs.sansar.com/scripting/api-overview --- # Restricted APIs ## Restricted APIs Restricted Scripting APIs can change or be removed, and scripts that use them receive a compiler warning. Under the [Community Standards](https://www.sansar.com/legal/community-standards), you may not use scripts that Sansar identifies as Restricted Scripting APIs. You should not sell or trade scripts that use these APIs. The following APIs are restricted: | **API** | **Details** | | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | [Sansar.Script.Testing.Assertions](/scripting/api/sansar.script.testing/assertions) | All the methods in this class are restricted. They are intended to be used for debugging purposes and removed before the scripts are shared. |
Source: https://docs.sansar.com/scripting/restricted-apis --- # Script API Updates ## Script API updates Latest update ### _Update: September 10, 2019_ Script updates * `AgentPrivate.IgnoreCollisionWith(RigidBodyComponent rigidBodyComponent, bool ignoreBody)` * Specifies whether a particular user ignores collisions with a particular body: `true` ignores the body and `false` removes it from the ignore list. Additionally, some interactions like sitting, camera collision, and teleporting coming from that user will also ignore the body. * `AgentPrivate.IsCollisionIgnoredWith(RigidBodyComponent)` * Returns whether a specified RigidBodyComponent has been set to be ignored by the Agent. * `AgentPrivate.SetSpeedFactor(float)` * An agent can now have a multiplier applied to its movement speed from script. This will also affect locomotion animations to prevent foot sliding. * `AgentPrivate.GetSpeedFactor()` * Returns the applied speed multiplication factor. Will return 1.0f by default. Documentation **Updated articles** * [AgentPrivate](/scripting/api/sansar.simulation/agentprivate.md) * [CharacterTracker](/scripting/api/sansar.simulation/charactertracker.md) * [Client](/scripting/api/sansar.simulation/client.md) * [Objective](/scripting/api/sansar.simulation/objective.md) * [Quest](/scripting/api/sansar.simulation/quest.md) * [ScriptId](/scripting/api/sansar.script/scriptid.md) * [TutorialHint](/scripting/api/sansar.simulation/tutorialhint.md) * [UI](/scripting/api/sansar.simulation/ui.md) Previous updates _Update: September 3, 2019_ Script updates Quest API Updates * New quest states have exposed to the script api: * QuestState.ObjectivesComplete * QuestState.SelectRewards * Added ObjectiveDefinition.InitialState to get the state an objective will have when the quest is started. * Objectives stay in the state ObjectiveState.None when they are offered, and go into their initial state when the quest offer is accepted General Script Updates * Maximum parameters increased from 20 to 50. (List<> max size remains 20) * Http Request/Response max body size increased from 16k to 64k * Http request throttle rate increased from 10/second to 20/second * Added `ObjectUp`, `ObjectDown`, `ObjectForward`, `ObjectBack`,`ObjectLeft` and `ObjectRight` to `Vector`. * The old `Up`, `Down`, `Left`, `Right`, `Forward`, and `Back` were not properly aligned with Sansar objects and are now deprecated. * Fixed an elusive bug that could cause weird behavior when using lots of the same script in a scene. * ScenePrivate.CreateCluster will now wait for scripted clusters to start all scripts before the callback event is sent. Script Library Updates * Special tag `{object}` can be used in Library Script `Group` fields to create groups that are unique to the object the script is on. This can be used to prevent cross communication when duplicating scripted objects. * Debugger * `Debug Enabled` renamed to Debug `Events`, outputs detailed Library script event message information to the script debug console (ctrl-d) * `Debug Memory` option to output memory usage to script debug console any time it changes by +/-10% * `-> Memory Report` to output memory usage to script console when an event is received from another Library script * `-> Subscription Report` outputs Library event subscriptions by object to script console, for R36 and later library scripts only. Subscriptions by other scripts are not counted. * Light and Light On/Off * New parameter `Lights` to set multiple lights in the scene to be controlled by the same script. * If no Lights are added to the `Lights` parameter the script behaves as before, using the first scripted light on the same object the script is on. If any lights are set it will not automatically use the first light on the object. * Hint Text * New parameter `VR Text` can be set to an alternate string to show different hints to users in VR. If left empty, VR users will see the same text as desktop users. * Text substitutions added for {Player.Name} {Object.Name} and {Data.Source}. Details on using these are in the Hint Text parameter tooltip. * HotKey * New Parameter `ExtraCommands` to set up to 20 additional hotkeys with a single script. Usage in tooltip. * Added support for key combos. CSVs of multiple hotkeys in any command property work as key combos. Example: `Modifier`, `PrimaryAction` will only trigger by holding both `Shift+F` * Interaction * \-> Reset fixed so the next event sent is the first event in the field * Previous bug would cause the second event to be sent. * New parameter -> Next will advance to the next event without sending the events for it. Used to keep buttons in sync if needed. * New Parameters `Volume 1` through `Volume 3` allows setting up to 3 other Interactions (for a total of 4) from a single script. * Position Reset * New parameter `Volumes` to set up to 20 objects to reset position. If no volumes are added the script will work on the object the script is on. If any objects are added then the script will **not** reset the object the script is on automatically. Documentation **New articles** * [CharacterTracker](/scripting/api/sansar.simulation/charactertracker.md) * [CharacterTrackerData](/scripting/api/sansar.simulation/charactertrackerdata.md) * [QuestCharacter](/scripting/api/sansar.simulation/questcharacter.md) **Updated articles** * [Vector](/scripting/api/sansar/vector.md) * [Client](/scripting/api/sansar.simulation/client.md) * [ObjectiveDefinition](/scripting/api/sansar.simulation/objectivedefinition.md) * [Quest](/scripting/api/sansar.simulation/quest.md) * [QuestState](/scripting/api/sansar.simulation/queststate.md) * [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate.md) * [ScenePublic](/scripting/api/sansar.simulation/scenepublic.md) * [Sansar.Simulation Namespace](/scripting/api/sansar.simulation.md) ### _Update: July 30, 2019_ ### Script updates * New ability for scripts to have references to other components, whether the components are in the same object or in another object or location in the scene. For more information, see [Referencing scene components with scripts](/scripting/guides/referencing-scene-components.md). * Renamed a few scripts in the Script Library. * Sansar Script Libraries and examples updated to use C# 7.2 language features * Vector and Quaternion operations now use in parameters where possible. Scripts may need to remove ref passing arguments when recompiling. * old: `v.cross(ref x);` * new: `v.cross(x);` #### _Update: July 22, 2019_ ### Script updates * Script API for authoring user-generated quests: * Quest definitions authored in the quest creator tool can be accessed by scripts using the [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition.md) class. When this is added as a public property in a script, the quest definition it refers to can be selected from a drop-down list in the editor. The [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition.md) holds information about the quest that is shared between all users, for example: * `QuestDefinition.Title` * `QuestDefinition.Description` * `QuestDefinition.ObjectiveDefinitions` * Information about an individual user’s progress in a quest is handled by the [`Quest`](/scripting/api/sansar.simulation/quest.md) class. A [`Quest`](/scripting/api/sansar.simulation/quest.md) instance for a user is obtained from a [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition.md) with the async methods: * `QuestDefinition.GetQuest(SessionId)` or * `QuestDefintion.GetQuest(AgentPrivate)` * Quest instances are used to offer quests to users, using: * `Quest.Offer()` * Quest instances can query and set the state of the quest for the user they are associated with: * `Quest.GetState()` * `Quest.SetState(QuestState)` * The [QuestState](/scripting/api/sansar.simulation/queststate.md) enum has the following values: * `None` - the user has not been offered the quest * `Offered` - the user has been offered the quest but hasn’t yet accepted it * `Active` - the user is on the quest * `Completed` - the user has completed the quest * Quest instances can subscribe to Quest state changes with * `Quest.Subscribe(QuestState state, Action callback)` - The callback will execute whenever the quest instance enters the specified state * Script API for authoring objectives for quests: * Quests are generally completed by completing all of their objectives. Quest objectives are handled in a very similar way to quests. Each objective has an [`ObjectiveDefinition`](/scripting/api/sansar.simulation/objectivedefinition.md) class that can be assigned as a script property and selected with a drop down list in the editor. Each [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition.md) also contains an array of its `ObjectiveDefinitions`. Also, each [`Quest`](/scripting/api/sansar.simulation/quest.md) instance contains an array of its [`Objective`](/scripting/api/sansar.simulation/objective.md) instances * The `Objective` class represents an individual user’s progress in an objective. Just like Quest instances, an [`Objective`](/scripting/api/sansar.simulation/objective.md) instance for a specific user is obtained from an `ObjectiveDefinition` with the async methods: * `ObjectiveDefinition.GetObjective(SessionId)` or * `ObjectiveDefintion.GetObjective(AgentPrivate)` * [`Objective`](/scripting/api/sansar.simulation/objective.md) instances can get and set the state of the objective for the user they are associated with: * `Objective.SetState(ObjectiveState)` * `Objective.GetState()` * The [`ObjectiveState`](/scripting/api/sansar.simulation/objectivestate.md) enum has the following values: * `None` - the objective state is not set, the user is not on the quest * `Locked` - the objective is locked for this user and cannot be completed * `Active` - the user is on the quest and the objective can be completed * `Completed` - the objective has been completed for this user * Objective instances can subscribe to objective state changes with * `Objective.Subscribe(ObjectiveState state, Action callback)`. The callback will execute whenever the objective enters the specified state. * Quest Script Library * Uses the quest api to provide drag-and-drop “SimpleScript” style scripts for common use cases: * QuestGiver * Offer a quest to users in response to simple script events * Sends simple script events when quest state changes * Can be set to automatically offer the quest when a user enters the scene * QuestGiverInteraction * Offers a quest to users when they interact with the object * The interaction is automatically enabled when the quest can be offered and disabled when it is accepted. * Sends simple script events when quest state changes * QuestGiverTriggerVolume * Offers a quest to users when they enter a trigger volume * QuestObject * Controls the state of a quest objective with simple script events * Sends simple script events when objective state changes * Can be set to automatically complete the objective when the user enters the scene. * QuestObjectInteraction * Completes a quest objective when a user interacts with the object * The interaction is automatically enabled when the objective is active, and disabled when it is not. * The object visibility can also be linked to the objective active state. * Sends simple script events when objective state changes * QuestObjectTriggerVolume * Completes a quest objective when a user enters a trigger volume * Sends simple script events when objective state changes ### Documentation updates #### New * [Creating your Own Quest](/create/worlds/creating-quests.md) * [Objective](/scripting/api/sansar.simulation/objective.md) * [ObjectiveData](/scripting/api/sansar.simulation/objectivedata.md) * [ObjectiveDefinition.GetObjectiveData](/scripting/api/sansar.simulation/objectivedefinition.md) * [ObjectiveDefinition](/scripting/api/sansar.simulation/objectivedefinition.md) * [ObjectiveState](/scripting/api/sansar.simulation/objectivestate.md) * [Quest](/scripting/api/sansar.simulation/quest.md) * [QuestData](/scripting/api/sansar.simulation/questdata.md) * [QuestDefinition.GetQuestData](/scripting/api/sansar.simulation/questdefinition.md) * [QuestDefinition](/scripting/api/sansar.simulation/questdefinition.md) * [QuestState](/scripting/api/sansar.simulation/queststate.md) #### Updated * [AgentPrivate](/scripting/api/sansar.simulation/agentprivate.md) * [Sansar.Simulation namespace](/scripting/api/sansar.simulation.md) #### _Update: July 4, 2019_ ### Script updates * New script API for per user gravity factor, which allows scripts to define the gravity factor for individual users. #### _Update: June 26, 2019_ ### Script updates * Upgraded Mono runtime * New script compiler supports most C# language features: [C# 7.0](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7) , [C# 7.1](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7-1), [C# 7.2](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7-2), [C# 7.3](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7-3). * Added System.MathF namespace for float math (some overlap with Sansar.Mathf). * MeshComponent and visibility api - Creators can now author meshes to show different mesh states to different users through scripts. For example, this will allow two different users to see different states of a door in an experience, wherein one user may see the door open and another may see the door - closed. * If you wish to author a mesh that can have its visibility adjusted at runtime using scripts, then you must turn on the new _scriptable_ property on meshes in the editor. All mesh component “set” functions will throw an exception if they are called on a mesh component that is not _scriptable_. * `Sansar.Simulation.MeshComponent` * New component to allow script control of mesh visibility. * `GetIsVisible()`returns true if the mesh is currently visible. * `SetIsVisible(bool isVisible)` sets the visibility state of a mesh. * `SetIsVisible(AgentPrivate, bool)` * `SetIsVisible(SessionId, bool)` * Mesh visibility can be updated temporarily on a per-user basis. Any of the following will override and reset the user specific settings: * The user leaving the scene. * The user logging out of Sansar. * Any calls on that mesh to `SetIsVisible(bool)` * New example script, _MeshVisibilityExample.cs_, in the installer folder: **Program Files** > **Sansar** > **Client** > **Script API** > **Examples** * Hint text - When set, it will display text on the user’s screen. * New string property: _Client.UI.HintText -_ When set it will display the text on the user’s screen. The text is limited to 80 characters in length. * Scripts may be copied and pasted in the Object Structure panel. ### API Documentation updates #### New * [Reflective+ReflectiveBase](/scripting/api/sansar.script/reflective.reflectivebase.md) * [MeshComponent](/scripting/api/sansar.simulation/meshcomponent.md) #### Updated * [Sansar.Script namespace](/scripting/api/sansar.script.md) * [Sansar.Simulation namespace](/scripting/api/sansar.simulation.md) * [MemoryData](/scripting/api/sansar.script/memorydata.md) * [AgentInfo](/scripting/api/sansar.simulation/agentinfo.md) * [AnimationComponent](/scripting/api/sansar.simulation/animationcomponent.md) * [AudioComponent](/scripting/api/sansar.simulation/audiocomponent.md) * [ComponentType](/scripting/api/sansar.simulation/componenttype.md) * [InteractionData](/scripting/api/sansar.simulation/interactiondata.md) * [LightComponent](/scripting/api/sansar.simulation/lightcomponent.md) * [Mover](/scripting/api/sansar.simulation/mover.md) * [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent.md) * [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate.md) * [UI](/scripting/api/sansar.simulation/ui.md) #### _Update: May 30, 2019_ ### Script updates * New functions in Client.UI to show an on-screen progress bar: * AddProgressBar() adds a progress bar to the user's screen * GetProgressBars() returns a list of the progress bars that are being shown (currently only one progress bar can be shown at a time). * These fuctions return UIProgressBar objects which control the progress bar: * UIProgressBar.Start(string label, float duration Color color) starts the bar with the provided label, duraction and color. * UIProgressBar.Cancel() removes the progress bar. * UIProgressBar.Start can take a completion event of the form * Action. The completion event’s ‘Success’ field will be true if the progress bar sucessfully completed, and false if it was canceled. * The ‘Progress bar’ Scene Library script can be used to quickly add progress bars to experiences. * The ‘Mover’ Library script now uses the Movement API, and can be used with any object with the ‘MoveableFromScript’ flag set in the editor. The new version of the script does not support the pivot point offset- if you need this functionality the old version of the script is still available in the script library as ‘KeyframedMotion’ #### _Update: April 30, 2019_ ### Script updates * New Object Movement API * ObjectPrivate now has a `Mover` member responsible for moving the object from script. * A **Movable From Script** flag now appears on all Scene Objects in the editor. When checked, the `Mover` for that ObjectPrivate will be non-null. * `ObjectPrivate.IsMovable` should be used to determine if an Object can be moved. The object of a player agent and objects that contain a Rigid Body with Motion Type set to _Static_ or _Dynamic_ cannot be moved. * `Mover` has the following API. All `Mover` commands are enqueued automatically and executed in sequence on the Object: * `Mover.AddTranslate()` overloaded to support moving directly to a position or moving to a position over time. When `WaitFor` is used with this function, `WaitFor` will return once the command has executed and completed. * `Mover.AddRotate()` overloaded to support rotating directly to an orientation or rotating to an orientation over time. When `WaitFor` is used with this function, `WaitFor` will return once the command has executed and completed. * `Mover.AddMove()` overloaded to support translating and rotating an object or translating and rotating an object over time. When `WaitFor` is used with this function, `WaitFor` will return once the command has executed and completed. * `Mover.AddPause()` supports enqueuing a waiting time for the object before it executes its next movement command. When `WaitFor` is used with this function, `WaitFor` will return once the command has executed and completed. * `Mover.StopAndClear()` clears all enqueued movement commands and stops the `Mover` at its current position and orientation. * Additionally `Mover` has the following properties: * `Mover.IsMoving` returns true if a movement command is currently being executed (including when a Pause is being executed). * `Mover.MoveCount` returns the number of movement commands on the `Mover` including the currently active command and any Pauses. * See MoverExample1, 2 & 3 for sample scripts to help you get started! * Scripts can now rez objects with scene scripts on them. This means dynamically created objects now work with both `ObjectScript` and `SceneObjectScript` types. * More specifically, `SceneObjectScript` scripts will now work on objects created through `ScenePrivate.CreateCluster`. * `ScenePublic` now also includes the `FindObject(ObjectId)` interface previously only available on `ScenePrivate`. * New `ObjectPrivate.FindScripts()` function to find all scripts on an object that match the `Interface T`, regardless of class name. * New overloads for `Wait` and `Timer.Create` that take a `double seconds` instead of a Timespan. * `Wait(double seconds)` * `Timer.Create(double seconds, double repeatSeconds, Action)` * New functions to trigger Tutorial hint UI: * `Client.ShowTutorialHint(TutorialHint hint)` to show the tutorial hint specified in the TutorialHint enum * `Client.ClearTutorialHint()` * `Client.EnableAutomaticTutorialHints(bool enabled)` to disable or enable the automatic (non-scripted) tutorial hints * `RigidBodyComponent.ReleaseHeldObject` can be used with `WaitFor`, and can be given a completion callback that is called when the object has been released. #### _Update: March 28, 2019_ ### Script updates * **List<> support in script parameters** - Allows passing multiple values to a script as a single parameter. This means that creators can now assign multiple values such as a sound, object, a position point to one parameter. This eliminates the old behavior that forces the creator to utilize a parameter per value. * Lists support 0 to 20 entries by default. The minimum can be raised and the maximum lowered with the `[MinEntries()]` and `[MaxEntries()]` attributes if desired. * `[Entries()]` attribute can be used to set default values for multiple entries:\ \[Entries(1,2,3,4,5)] or \[Entries(0,0,0)] * `[AddEntry()]` attribute can be used to add a single default value entry and can be used multiple times on the same parameter. * **Interaction behavior on a per user basis** - Creators can now set interactions to update and change behavior on a per-user basis. This enables creators to disable content once a user interacts with it. For example, a glowing chest in a treasure hunt could stop glowing once the user interacts with it. * `Interaction.SetEnabled(AgentPrivate, bool)` * `Interaction.SetPrompt(AgentPrivate, string)` * This is a temporary change. Any of the following will override and reset the user specific settings: * Any calls on that Interaction to `SetEnabled(bool)` or `SetPrompt(bool)` * The user leaving the scene * The user logging out of sansar * **SceneInfo.MaxUsers** - The maximum users allowed in the scene. This value is currently hard set and cannot be changed. * **SceneInfo.InstanceRole** - Usually set to "unset", will return "broadcaster" or "clone" in scenes configured for avatar broadcasting. * **Bug Fixes** * Teleports sent as soon as a user logs in will now work. #### _Update: February 28, 2019_ ### Script updates * **Overriding audio streams** - The audio stream channel URL can now be overridden using the following APIs, `ScenePrivate.OverrideAudioStream(url)` and `AgentPrivate.OverrideAudioStream(url)`. * As part of this change, we are deprecating Audio Streams 2/3/4 and they have been removed from Scene Settings. AudioChannel1 has been updated to “AudioChannel”. * **Setting up a scene to broadcast voices** - We’ve deprecated the old VoiceBroadcast API and have replaced it with the Megaphone API. * To enable/disable megaphone on a user as part of the scene setup, use `ScenePrivate.SetMegaphone(personaId, bool)`. * **Teleporting within the same experience** - The new API `AgentPrivate.Client.TeleportTo(position, forward)` teleports the avatar within the current scene to a specified position, facing the specified forward direction. * Because avatars always remain upright, the up component of the forward direction will be ignored. * **Force drop** - The `RigidBodyComponent.ReleaseHeldObject` method forces any agent holding the rigidbody to immediately drop it. * **Sit points update** - `SitObjectInfo` data has been updated to include the position, forward direction, exit position and exit forward direction for sit points. * **Script Library source reorganization** - The Script Libraries in Sansar’s install folder have been reorganized. These scripts can be found in Program Files > Sansar > Client > ScriptApi > Examples > ScriptLibrary by default. * **Bug Fixes** * This release fixes several script crashes relating to memory bloat and coroutines that were introduced in R29.1. * Setting playback range on non-looping animations while they are playing works as expected. #### _Update: February 6, 2019_ * **Sit Event API** * Scripts can perform actions when an avatar starts or stops sitting on a rigidbody using the api: `RigidBodyComponent.SubscribeToSitObject`. * This method returns information about the agent performing this action and sit position relative to the objects origin. * **Haptic Pulse API** * Using the `AgentPrivate.Client.VibrationPulse` api lets a script fire a haptic vibration. It pulses the vibration motor for a control point at a given intensity (0 to 1) for a given duration in ms (0 to 1000). As an example, you can use this method to trigger haptic vibrations on the touch controllers when a gun is fired. * **Media Action API** * Some Twitch streams are marked as mature and require the user to click on a "Start Watching" button before viewing the stream in Sansar. Using the API: `AgentPrivate.PerformMediaAction(MediaAction.TwitchMaturityClick)`, you can make the screen interactable and then call the above function on an agent once they’re taken an action to accept mature streams. * **Simple Script updates** * Simple scripts is now called **Scene Script Library** and it contains all scripts that only work in content built into the scene. * We've added a new **Object Script Library**, which contains all scripts that will work on objects that have been created by other scripts * The two libraries are compatible with each other and can send messages to each other. * This release includes several improvements to efficiency in script event routing and in the Script Libraries themselves. * **New Scripts in the Script Libraries:** * StoreListing: Show a Sansar Store listing to a user * AudioStream: For starting or stopping audio streams * TimeCountdown: For triggering events at specific times in a countdown * Timer has been renamed to TimedEvents * The Teleport scripts have been removed. The Teleport script in Scene Script Library now has options to Teleport on collision. * **Reflective updates** * New advanced Reflective features to give more control over how Reflective interfaces are found and registered. * `ScenePublic.FindReflective` added to find reflective interfaces that have been registered specifically for use on the `ScenePublic` API. By default scripts are not registered to this API with `Reflective.Register()` or \[RegisterReflective], it is opt-in. * Scripts and Reflective classes can determine what contexts they are registered in by overriding ReflectiveContexts. Overriding `ReflectiveContexts` will automatically register the class when it is created (or the script when it is started), making the \[RegisteredReflective] attribute redundant.\ protected override Context `ReflectiveContexts => Context.ObjectPrivate`; * `Reflective.Contexts` enum with available contexts: `ObjectPrivate`, `ScenePrivate`, `ScenePublic`. * Existing scripts, and all scripts that do not override ReflectiveContexts, will register only with ScenePrivate and ObjectPrivate with Reflective.Register and \[RegisterReflective] * ObjectScript type scripts can only register with ObjectPrivate * SceneObjectScript type scripts can register with all contexts * Note: Only scripts can be found in the ObjectPrivate context, through the `FindScript` and `FindScripts` APIs. Non-script Reflective classes can not yet be found through ObjectPrivate even if their context is set. * The name registered Reflectives are found with can be overriden as well by overriding ReflectiveName. `protected override string ReflectiveName => "Simple.Debug";` #### _Update: December 12, 2018_ * Simple Scripts are now a single inventory item - but all the scripts are still there! Add the Simple Script Library to an object and use the second drop down menu to select which simple script to use. * Script Projects: You can now bundle multiple scripts, or include multiple files, into a single script upload using a .json project file. The bundled scripts will show as a single inventory item and when applied to an object a second drop down will let you choose which script from the bundle to apply. * Use \[EditorVisible(false)] on a class in a script project to hide that class from the drop down shown when choosing a script, mainly useful for base classes. Abstract classes are hidden automatically. * The .json file should be a json object containing a "source" entry with an array of file names:\ {\ "source": \[\ "File1.cs",\ "File2.cs",\ ]\ } * The paths may be absolute or relative to the json file.\ The \[DisplayName] attribute can be used on script classes to change how they show in the script selector. * The \[DefaultScript] attribute can be used to control the script which is applied when first adding the project to an object. * Drag and Drop behavior change: When dragging a script from inventory onto an object it will now ADD the script to the object and will no longer replace the existing script if there is one.Script properties and script projects can now have tooltips. Use the \[Tooltip("Helpful text")] attribute to give your script properties tool tips. All Simple Script properties have tooltips now! * Use \[assembly: Tooltip("Script project description")] to add a script project tooltip. * Cast Ray APIs phase two: [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate) adds **CastCapsule**, an oriented **CastBox**, and **GetBoxClosestPoints**, **GetCapsuleClosestPoints**, and **GetSphereClosestPoints** for shape queries. * Relaxed throttles on CreateCluster, SendChat, MessageAllUsers, OverrideMediaSource and HttpClient.Request * AgentInfo.Handle to get a user's handle. * Added RightVector and UpVector to ObjectPrivate and ObjectPublic * Grab points now have an option to be "sticky" where they will not be released when the grab button is released. * In desktop mode mouse clicking on a grabbable object will pick it up. Regular grabbable objects will be dropped or thrown when the mouse button is pressed a second time or the F button is pressed. Sticky objects can be dropped or thrown by pressing F. In both cases holding the button longer on drop/throw will increase the distance it is thrown. * On Oculus Touch the Grip trigger can be used to pick up objects. Regular grabbable objects will release when the Grip trigger is released. Sticky objects can be dropped or thrown by pressing the Grip trigger a second time. * On Vive wands the trigger will pick up objects. Regular grabbable objects will release when releasing the trigger. Sticky objects can be dropped or thrown by pressing the Grip button. * New "Trigger" command for SubscribeToCommand. This command is sent on mouse click and VR triggers. * "PrimaryAction" (Grip), "SecondaryAction" (A/X), "Confirm" (B) and "Cancel" (Y) have been mapped to oculus touch controllers. * "PrimaryAction" (Grip) and "SecondaryAction" (Center Click) have been mapped to Vive wands * CommandData from SubscribeToCommand now contains Targeting data. Targeting data is sent for all commands. If the command is from the keyboard or mouse then targeting data is what the mouse is targeting. If the command is from VR then targeting data is from the device or hand used. * TargetingPosition: The point in world space that was targeted. * TargetingOrigin: The origin of the action. In desktop this is the camera position; in VR it is the center of the hand used. * TargetingNormal: The surface normal of the object at the point that was targeted. * TargetingComponent: The component id of the object part that was targeted. * SimulationFrame: The simulation frame the action was done, according to the client. * ControlPoint: The device used for the command. For VR compare to HeldObjectInfo.ControlPoint to determine if the hand holding something was the same hand the object is held in. * MouseLookMode: True if the user was in mouselook mode when the command happened. Mouselook mode ties the camera to the mouse cursor. Some game types are trivial outside of MouseLook Mode in desktop and this flag can be used to ignore inputs from that mode. * CameraControlMode can be FlyCam, FirstPerson or ThirdPerson and can be used to further restrict game play by ignoring or warning if the command is received in an undesired mode. Creators should also consider the recently added options to disable flycam and restrict teleports in their game experiences. #### _Update: November 7, 2018_ * **Simple Scripts update:** * **SimpleGrabRelease** - Send simple events when the object is picked up or dropped. * **CastRay API** ([ScenePrivate](/scripting/api/sansar.simulation/sceneprivate)) * **ScenePrivate.CastRay** casts a line segment; **ScenePrivate.CastSphere** and **ScenePrivate.CastBox** cast shapes between two positions and return collision results. The default maximum is one hit. * **AgentPrivate.Client.TeleportToUri(string uri)** - Teleports to a scene URI. * **RigidBodyComponent.GetInverseInertia/SetInverseInertia(Vector)** - This API allows script to control the inertia of the object on different axes. For example an object can be set to only spin around the z-axis by giving it a vector with zero’s in the x and y components. #### _Update: October 9, 2018_ * **Simple Scripts** * All SimpleScripts now have a Group property to control which scripts communicate with each other. Setting a Group is optional, if left blank the script will behave as before. If a Group is set, then that simple script will only send events to and receive events from other scripts in the same Group by default. There are a couple of advanced features added as well: * To send a message to a different Group append `@othergroup` to the event - for example to send an `on` message to the `radio` group a SimpleInteraction script could send `on@radio`. * To send a message to ungrouped simple scripts specifically, even if a Group is set on this script, append @ to the end of the event like: `on@` * Advanced Optional Sequencing for events to emit or receive events in order, using >> as a separator. This is an entirely optional and complex feature that will likely require some experimentation. * For simple scripts that send events the >> separator can be used to send different events on subsequent actions. For example a SimpleInteraction that sets "On 1st Click ->" to `one>>two>>three` will send `one` the first time it is clicked, `two` the second, `three` the third and `one` the fourth etc. If sequencing is used with SimpleScripts that have other sequencing options like SimpleInteraction's 1st/2nd/3rd/4th click it is recommended to use one or the other and not both styles. The behavior of setting 1st click to `one>>two>>three` is identical to setting 1st click to `one`, 2nd click to `two` and 3rd click to `three`. * For simple scripts the receive events they will only respond to the current event in the sequence. If the sequence is `one>>two>>three` then until a one event is received the two and three events will do nothing. When `one` is received the action will happen and then the script will wait for `two` and ignore `one` and `three`. * **Rigidbody grab/Release callbacks API** * Scripts can perform actions when a rigidbody is grabbed or release by an avatar, using the API `RigidBodyComponent.SubscribeToHeldObject`. This method returns information about who has grabbed/released the object, and what hand they are grabbing it with. * Scripts have access to the RigidBodies that an avatar is currently holding, using the API `AgentPrivate.GetHeldRigidBodies`. * Scripts can control at runtime whether or not an object can be grabbed by avatars, using the API `RigidBodyComponent.SetCanGrab`. #### _Update: September 10, 2018_ * Json serialization API * Sansar.Utility.JsonSerializer can be used to Serialize and Deserialze Json strings to/from C# objects. * Sansar.Utility.JsonSerializerOptions can control the serialization process (more options to come!) * Sansar.Utility.JsonSerializationData is available in a generic and non-generic form and contains both the C# object and the json string on a successful serialize or deserialize. * Sansar HTTP request headers added to outgoing http requests: * x-sansar-experienceid * x-sansar-experiencehandle * x-sansar-instanceid * x-sansar-experienceowner * x-sansar-experienceuri * x-sansar-grid * x-sansar-scriptid * x-request-id * Bug fixes: * Fixed a script sometimes failing to load when the first visitor joins a world. * Fixed some script error messages not appearing during world startup. #### _Update: Aug 16, 2018_ * Increased Parameter Limit: * SceneObjectScripts can now have up to 20 parameters * `ObjectPrivate.AddInteraction`: * Add an Interaction to an object dynamically. Used to add Interactions to rezzed objects or when it isn't desired that the Interaction prompt be a script parameter. * New Simple Scripts: * _SimpleDispenser_ to rez objects * _SimpleMedia_ to change the streaming media * _SimpleObjectReset_ to reset an object's position * _SimpleCollision_ has been revamped to better handle TriggerVolumes * Improved syntax for \[DefaultValue] on vectors, quaternions and colors. * They no longer need to be specially formatted strings, simply list 2 to 4 values: \[DefaultValue(1.2, 3.4, 5.6)] * New base script class: ObjectScript. * In anticipation of rezzable scripts (not yet enabled), this base class only has access to ScenePublic and a maximum of 10 parameters. SceneObjectScript scripts will not run on rezzed content; ObjectScript scripts can run on scene content or rezzable content. * SimpleScript base class deprecated. * Not to be confused with the new Simple scripts. Scripts that use this base class will still compile with a warning. Support for new compiles will be disabled in a future release. #### _Update: July 18, 2018_ * HTTP API * `HttpClient` property added to the `ScenePrivate` class. * `HttpClient.Request` can be used to make request to external web services. Only text content types are currently supported. Request/response size limits also apply. * `HttpRequestOptions` can be used for more control, including specifying the method, query parameters and headers. * Take note that the personal data may be shared with external services. This data includes: * Avatar name * A user's unique avatar identifier * When an avatar visits the experience * When an avatar leaves the experience * Where in the experience 3D space the avatar exists whilst in the experience * Public chat of avatars whilst in the experience * Multiple Animations on Objects support * Fbx files containing multiple animation clips can be imported. * Added `AnimationComponent.GetAnimations()` and `AnimationComponent.GetAnimation(string animationName)` to access these animations * Calling `Animation.Play()` will then transition to that animation, with a transition time specified by the new parameter `AnimationParameters.BlendDuration`. * Simple Scripts * New structure to _ScriptExamples.csproj_ * 12 new scripts that work together without modification by sending named events: * [_SimpleInteractions_](/scripting/guides/simple-script-user-guide.md) * [_SimpleCollisions_](/scripting/guides/simple-script-user-guide.md) * [_SimpleLight_](/scripting/guides/simple-script-user-guide.md) * [_SimpleHotkey_](/scripting/guides/simple-script-user-guide.md) * [_SimpleAnimation_](/scripting/guides/simple-script-user-guide.md) * [_SimpleTimer_](/scripting/guides/simple-script-user-guide.md) * [_SimpleTeleport_](/scripting/guides/simple-script-user-guide.md) * [_SimpleDebugger_](/scripting/guides/simple-script-user-guide.md) * [_SimpleSound_](/scripting/guides/simple-script-user-guide.md) * [_SimplePrompt_](/scripting/guides/simple-script-user-guide.md) * [_SimpleMover_](/scripting/guides/simple-script-user-guide.md) * [_SimpleVisitors_](/scripting/guides/simple-script-user-guide.md) * These files are available in your Sansar inventory by default, in the **Purchased** category and in the Sansar install folder, See [Simple Scripts user guide](/scripting/guides/simple-script-user-guide.md) for more information. * Error Handling and Throttled APIs update: * Methods with callbacks that used to return a useless UInt64 now have a void return type. * If an API takes an `Action` handler, and a handler is provided, then any exceptions thrown by that API will be passed to the handler. `OperationCompleteEvent.Success` will be false, .Message will be the name of the exception and a new .Exception field will hold the thrown exception. * Passing any potentially throttled API to a WaitFor will now return immediately with a ThrottleException in the OperationCompleteEvent instead of throwing the exception. * All throttled APIs now take an `Action` handler. The default handler will log exceptions and return instead of throwing. #### _Update: June 1, 2018_ * **Interaction API** - Adding a script with a public or \[EditorVisible] Interaction property will make the object clickable and allow a prompt to be shown on hover. The Interaction can be enabled and disabled, and the prompt can be updated by the script. * `Interaction.SetEnabled(bool enabled)` - To enable or disable the `Interaction` * `bool Interaction.GetEnabled()` - Returns true if the `Interaction` is currently enabled. * `Interaction.SetPrompt(string prompt)` - Sets the prompt text for the `Interaction`. * `string Interaction.GetPrompt()` - Gets the current prompt text for the `Interaction`. * See the example script [InteractionExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionExample.cs). * **Advanced Script Feature: Coroutine handling** - `StartCoroutine` now returns an `ICoroutine` interface that can be used to control coroutines and communicate between coroutines. * `ICoroutine.Abort()` - Force the coroutine to stop running. * `bool ICoroutine.IsAlive { get; }` - Returns true if the coroutine has not finished. * `bool ICoroutine.IsWaiting { get; }` - Returns true if the coroutine is waiting on time or an event. * `ICoroutine.Signal()` - Send a signal to the coroutine that will wake it up if it is in `WaitForSignal();` * `void ICoroutine.ResetSignals()`- Clear signals sent to the coroutine . * `string ICoroutine.Name { get; set; }` - Get or set the name of the coroutine. Defaults to the name of the method or delegate passed to StartCoroutine. * `ScriptBase.WaitFor(ICoroutine other)` - Wait for coroutine other to finish before resuming this coroutine. * `int ScriptBase.WaitForSignal()` - Wait for at least 1 signal to be received, through ICoroutine.Signal(). Returns the number of signals received while waiting. * `ICoroutine ScriptBase.CurrentCoroutine` - The coroutine that is currently running. * `IReadOnlyList ScriptBase.GetAllCoroutines()`- All coroutines for this script. * See the example script [InteractionExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionExample.cs). * **Advanced Script Feature: Lock** - For use with library style scripts that respond to calls from other scripts through Reflective. The Lock allows a script to declare a "critical section" that can only be accessed by 1 coroutine at a time. * `using(Lock(lockObj)) { /* critical section */ }` * See the example script [CoroutineLockExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineLockExample.cs). * Bug Fixes: * Object Animations * `Animation.Reset()` now resets to the end frame of the animation if it is playing backwards. * Changing animation ranges now maintains the paused animation frame if the paused frame is within the new range. * We fixed the bug where sequential animation commands would override previous commands so you no longer need to wait for `Animation.Reset()` to finish before playing the next animation, for example. * `RigidBodyComponent.SetMotionType` now throws an exception when attempting to set the motion type of an object beyond its maximum permissive motion type. * Fixed `ScenePrivate.OverrideMediaSource()` being ignored for late joiners. * `OverrideMediaSource()` fails to set the media URL back to the built-default URL . * New known issues: * ScenePrivate.SceneInfo.ExperienceName which was returning an empty string will now return "unset". In a future release this will be updated to return the full experience name as shown in the atlas. #### _Updated: May 7, 2018_ * Animation control on objects * Animated objects now have two new properties in the editor: * `BeginOnLoad` - set this to false to prevent an animation from automatically playing * `PlaybackMode` - configure the animation to play once, loop or ping-pong back and forth from start to finish. * The AnimationComponent for an object now exposes a new `DefaultAnimation` member of the type `Sansar.Simulation.Animation`. * `Sansar.Simulation.Animation` * This is the interface to access data on the animation as well as for controlling object animation playback from script. It has methods to `Play`, `Pause`, `Reset` and `JumpToFrame` on the animation. * `Sansar.Simulation.AnimationParameters` can be used to configure animation playback for a limited window of frames, or to adjust the playback speed or playback mode. This can be applied with `Get/SetParameters` or by using the alternate `Play/Reset` methods. * `GetFrameCount` returns the object’s total number of frames of animation. * Note that Sansar imports animations at 30fps and will resample your animation if it was authored at a different frame rate. * `Sansar.Simulation.AnimationParameters` * `RangeStartFrame`, `RangeEndFrame` * Start and end frame numbers * `ClampToRange` * Set this to true to clamp animation playback to the specified start and end frames * `PlaybackMode` * `Loop` - The animation plays from the start frame to the end frame and then repeats from the start frame again. * `PingPong` - The animation plays from the start frame to the end frame and then backwards from the end frame to the start frame and then repeats that process. * `PlayOnce` - The animation plays one time from the start frame to the end frame then pauses at the end. * `PlaybackSpeed` * Set this to a number greater than 1.0 to speed up animation playback. Set this to a number less than 0.0 to reverse the animation. * New API to override the media url in a scene: * `AgentPrivate.OverrideMediaSource(url, [width, height])` * Will override the media url for the particular user only. * `ScenePrivate.OverrideMediaSource(url, [width, height])` * Will override the media url for all users. * Example script: MediaOverrideExample.cs * Sansar.Color now supported as a script property at edit time, e.g., * `public Sansar.Color myColor`; * This will present a color picker and RGB values in the editor. * Added visibility on container properties for local position and rotation in the property editor. This is helpful for understanding why some objects come with a non-identity `ObjectPrivate.InitialRotation` and also gives increased control for fine tuning placement in the scene. * Objects that have their container transforms driven by animation do not show or allow this same local position and rotation manipulation. * Wait and WaitFor work outside of coroutines. They do not work in script constructors but should work everywhere else. * Fixed number pad Enter key to work with the Client.SubscribeToCommand API. * Script Debug Log: increased maximum rate by 4x to 256 logs per 30 seconds. * Whitelisted several more C# exceptions so catching specific exceptions should work. #### _Updated: April 9, 2018_ The most significant updates to the script API in R20 are the addition of the new `Sansar.Simulation.LightComponent` and the new properties on `Sansar.Simulation.RigidBodyComponent`. Almost all physics properties that can be adjusted in Havok are now exposed through script APIs. The import process now allows the specification of a motion type which creates an inventory cluster resource with a baked in motion type. This is a powerful feature when combined with the `ScenePrivate.CreateCluster` script API as it allows runtime creation of user-created dynamic objects. In addition, objects that are imported as dynamic can be changed to and from other motion types at runtime allowing dynamic objects to become keyframed, and vice versa. See `SetMotionType()` below for more details. Here are the new script features: * Lights * If you wish to author a light that can have its properties adjusted at runtime from script, then you must turn on the new “scriptable” property on lights in the editor. All light component “set” functions will throw an exception if they are called on a light component that is not “scriptable”. * `Sansar.Color` * New, similar to `Sansar.Vector` but with RGBA components * Expected range of each component is 0.0 to 1.0. The Alpha component is 1.0 by default. * `Sansar.Simulation.LightType` enumeration for the type of light * `Directional`, `Point`, `Spot` * `Sansar.Simulation.LightComponent` * New component to allow script control of lights * IMPORTANT: All properties are read-only unless the “scriptable” property is enabled on the light in the editor.\ ▪ `IsScriptable` is a read-only property that allows a script to check to see if a light can have its properties adjusted at runtime. * NOTE: Directional lights can not be script controlled at this time. * `LightType` is a read-only property that indicates if a given light is a directional, point or spotlight. All properties can be adjusted on all light types but only certain properties apply to each type. * Color and Intensity * These two properties are intertwined. The Sansar renderer does not differentiate between a bright gray light and a dim white light so they are coupled in the API to reflect this. * `SetColorAndIntensity(Sansar.Color, float)` * This API allows you to set the color of the light and its brightness. The color is mapped into sRGB space and then the specified intensity is applied to it. * `GetNormalizedColor()` * This returns the color of the light based on one of its components having a value of 1.0. * `GetRelativeIntensity()` * This gets the intensity of the light based on the normalized color from above. * `GetRange(), SetRange(float)` * API to get and set the range for point lights and spotlights. * The following APIs only apply to spotlights: * `GetAngle(), SetAngle(float)` * To get or set the cone angle of the spotlight. Larger numbers indicate a wider, less focused light. * `GetAngularFalloff(), SetAngularFalloff(float)` * Angular falloff is the sharpness of the edge of the projected light. Small values will indicate a very clear edge while large values will fade the light smoothly towards the edge of its cone. * `GetNearClip(), SetNearClip(float)` * This value indicates the distance between the position of the light and where its light projection actually begins. This is useful for positioning a light within a recessed light socket, for example, without having the shadow of the light bulb or socket projecting into the scene. * `GetShadowPriority(), SetShadowPriority(int)` * The renderer supports many shadow casting lights in the same scene but in the event that too many shadow casting lights are competing for resources, the ones with the larger shadow priority will be applied first. * `GetCastsShadows(), SetCastsShadows(bool)` * This is an alternate API for shadow priority that matches the property in the editor. It uses a value of 0 or 1 behind the scenes for the shadow priority. * Rigid bodies * `GetMotionType(), SetMotionType(RigidBodyMotionType)` * The import process now allows the specification of a motion type so dynamic and keyframed objects can be saved to user inventory. * IMPORTANT: The imported motion type also specifies the maximum permissive motion type of an object. Objects imported as dynamic can be changed to any motion type in script. Objects imported as keyframed can be changed to static and back to keyframed, but can never be changed to dynamic. Objects imported as static can not have their motion type adjusted from script. * `GetBounce(), SetBounce(float)` * The range is from 0 to 1, with smaller numbers being less bounciness and 1.0 being a perfectly elastic collision. * `GetCenterOfMass(), SetCenterOfMass(Sansar.Vector)` * The vector points to the center of mass of the object in local space. * `GetDynamicFriction(), SetDynamicFriction(float)` * Dynamic friction from 0 to 1 is the friction applied to the object when it is moving across the surface of another object. The simulated friction between two objects is the minimum of the two touching surfaces. * `GetGravityFactor(), SetGravityFactor(float)` * Range from 0 to 1 that scales the effect of gravity on this object. * `GetLinearDamping(), SetLinearDamping(float)` * Similar to air resistance, with the default value of 0 indicating no resistance. * `GetStaticFriction(), SetStaticFriction(float)` * Static friction from 0 to 1 is the friction that affects an object at rest on another object. The simulated friction between two objects is the minimum of the two touching surfaces. * `SceneInfo.ApiVersionString` and ApiVersion return the current script API version. * Under the hood changes to script initialization times * Bug fixes. #### _Updated: March 1, 2018_ Detailed summary * New ScenePrivate.GetGravity and SetGravity * The scene properties now include gravity acceleration which can be set in G’s or m/s^2. These new Script API’s allow adjusting this gravity acceleration at runtime in m/s^2. * `ScenePrivate.SetGravity(1.622f); // Set to moon gravity` * `float g = ScenePrivate.GetGravity(); // Get scene gravity` * In addition, there are related constants for scene gravity: * `ScenePrivate.DefaultGravity; // Default gravity m/s^2` * `ScenePrivate.GravityMinimum; // Lowest gravity (zero)` * `ScenePrivate.GravityMaximum; // Highest gravity (5G)` * A few new Vector operations were added for convenience, namely: * `float * Vector` is now a supported operation * Previously only Vector \* float was possible * `Vector / float` is now a supported operation * Objects now have a new keyframed motion type which has corresponding script support: * Added enumeration `RigidBodyMotionType` which includes: * `MotionTypeDynamic` * `MotionTypeKeyframed` * `MotionTypeStatic` * The `RigidBodyComponent` has a new API to query for this motion type: * `RigidBodyMotionType t = rb.GetMotionType();` * Additionally, the previous IsDyanmic() API has been deprecated. * `FindScript` improvements: * `ObjectPrivate.FindScript()` now supports Reflective if an interface is used for and a script on the object matches that interface. * New API `ObjectPrivate.FindScripts(string name)` to find scripts on an object by their class name. * Scripts must be Registered with the Reflective system to be found by either of these APIs. #### _Update: February 1, 2018_ Detailed summary * New Unsubscribe pattern for all event subscriptions * All Subscribe methods now return an object that implements IEventSubscription with an Unsubscribe() method and an Active property. * Timers have been updated to use this as well, named Timers are deprecated. * New "SimpleScript" base class to offer a quicker start for simple script writing * This class offers methods to be overriden for common subscriptions and takes care of the subscriptions for you. * All events are run in a co-routine to support Wait and WaitFor. * Attributes can be used to change the behavior of the subscriptions or to register new events. * See [SimpleScriptExample.cs](/scripting/examples/simple-script.md) for a more complete example * New Audio API calls for playing a stream. * Enum “StreamChannel” corresponds to streams set up in Scene Settings. * MediaChannel * AudioChannel1, AudioChannel2, AudioChannel3, AudioChannel4 * Agent: * PlayStream(StreamChannel streamChannel) * PlayStreamAtPosition(StreamChannel streamChannel, float loudness) * PlayStreamOnComponent(StreamChannel streamChannel, AudioComponent\* audioComponent, float loudness) * Scene: * PlayStream(StreamChannel streamChannel) * PlayStreamAtPosition(StreamChannel streamChannel, float loudness) * Component: * PlayStreamOnComponent(StreamChannel streamChannel, float loudness) * New Run argument in WaitFor will run code after the subscribe but before the wait to close some race conditions when using coroutines and cross script events. **Example** ```csharp // It is possible for a script to respond to the "Message" event before the WaitFor, in which case the response could be lost. PostScriptEvent("Message"); WaitFor(SubscribeToScriptEvent, "Response"); // Instead this is guaranteed to do PostScriptEvent after being set up to receive the response. WaitFor(SubscribeToScriptEvent, "Response", () => { PostScriptEvent("Message") }); ``` * New limits on number of pending events on a script to prevent memory blowout * Use PendingEventCount to get number of pending events. * Events queued when there are already 256 pending events will be discarded * Coroutine operations (start/wait) always apply to active script to work better in cross script cases. * Removed "AllChannels" option for chat subscriptions. Scripts that were set to listen on all channels will now listen on the default 0 channel. * Fixed script stub dlls to not crash and created examples.csproj file for the example scripts, which is set up to use the stub dlls. * Fixed broken hyperlinks on script API help index. * More consistent behavior of user join/leave events in scripts. * Some optimizations to script memory tracking performance.
Source: https://docs.sansar.com/scripting/script-api-updates --- # External Script Repositories There is a few external repository's of information please check these out until this info is reorganised into this documentation. ## Github repositorys * [Sansar main scripting repository ](https://github.com/Wookey-Technologies/sansar-script) * [EVos getting started scripting guide](https://github.com/darwinrecreant/sansar-scripting-guide) Source: https://docs.sansar.com/scripting/external-script-repositories --- # Intro to Scripting in Sansar > Overview of Sansar scripting ## Introduction to scripting in Sansar Scripts allow us to make interactive and reactive content in Sansar. They are written in C# but are designed to be used and reused without scripting knowledge or even seeing the code. Once uploaded or purchased through the Sansar Store, scripts can be added to objects while editing a scene. They can then be configured through properties specified by the script creator. The script interface to Sansar is referred to as the Script API. It is constantly evolving as new features are added for interacting with objects, users, and other scripts. Scripts run on the scene server, where they have access to _server authoritative_ information such as the physics system, the users in the scene, and other scripts. Through the server’s connection to the users it is also possible, with some latency, to do some limited, client-focused interactions. ## Getting set up After you install Sansar, there is a Client\ScriptApi folder inside your Sansar install directory (C:\Program Files\Sansar\ by default). This contains the technical API documentation as well as some example scripts. If you have VisualStudio, you can copy the entire ScriptApi/ directory to a more convenient place and open ScriptApi/Examples/ScriptExamples.csproj. This project is set up to understand the Sansar API and includes all the examples. You can also find the most recent API documentation online here: [Sansar Script API](/scripting/api-overview.md). ## Writing your first script The easiest way to get started with a script is to use the [`SceneObjectScript`](/scripting/api/sansar.simulation/sceneobjectscript.md) base class, like this: ```csharp public class MyScript : Sansar.Simulation.SceneObjectScript { } ``` This script doesn't do anything- but it will compile! You can upload it by following the directions in the article [Importing items to Sansar](/create/import/importing-items.md) and then [attach it to an object](/scripting/guides/adding-scripts-to-an-object.md). It doesn’t do anything yet, so let’s make it say something. For this case, we are going to write to the script log, once, on initialization. ```csharp public class MyScript : Sansar.Simulation.SceneObjectScript { public override void Init() { Log.Write("Hello World!"); } } ``` Now when we upload this script, then add it to an object and build then visit the scene, we can find this message in the [script log (Ctrl+D)](/scripting/guides/using-the-script-console.md). Lastly, for our very simple starter script we are going to make things a little neater. There are a couple of script interfaces we are almost always going to use, so adding a few ‘using’ lines at the top lets us use them without writing out the full name every time. We're adding more than strictly needed for this example but this will make it easier to extend the example for more complex code. ```csharp using System; using Sansar; using Sansar.Script; using Sansar.Simulation; public class MyScript : Sansar.Simulation.SceneObjectScript { public override void Init() { Log.Write("Hello World!"); } } ``` Check out [Example script: Simple Script](/scripting/examples/simple-script.md) for another look at what you can do using [SimpleScript](/scripting/api/sansar.simulation/simplescript.md). **Note:** Sansar supports C# script files up to 1MB in size. ## Brief tour of the API The full scripting API docs can be found in the Sansar install directory in Client/ScriptApi/index.html, or in the [Script API Documentation](/scripting/api.md) section of this Knowledge Base. This is a brief overview of how the API is laid out: * [Sansar](/scripting/api/sansar.md) * This root namespace has only a few base math types and some related math libraries: Vector and Quaternion. * [Sansar.Script](/scripting/api/sansar.script.md) * Most interfaces for scripts or the “script system” itself are in the Sansar.Script namespace. This includes things like timers, ID types, memory use, logging and various attributes. * [Sansar.Simulation](/scripting/api/sansar.simulation.md) * These interfaces are for interacting with the simulated world or the users in it. Some things in here are: * Object interfaces for creating new objects or physics interactions of objects. * User interfaces for information about users in the scene as well as sending them chat or sounds or simple UI dialogs; or teleporting them. * Scene interfaces for information about the scene as well as playing sounds scene-wide. * [Sansar.Testing](/scripting/api/sansar.script.testing.md) has a few unit-test related APIs. * [Sansar.Utility](/scripting/api/sansar.utility.md) contains the GenericEnumerable class used to create enumerables for other APIs. ## An object oriented API Sansar’s script API is _very_ object oriented. This means that nearly all APIs are accessed through a specific instance of an interface. A script gets access to those API instances through the base class it extends- in our example, that is [SimpleScript](/scripting/api/sansar.simulation/simplescript.md). Previously we just casually used `Log.Write(“Hello World!”);` so let’s take a little bit of a closer look at it. `SimpleScript` has a member property `Log` of type [`Sansar.Script.Log`](/scripting/api/sansar.script/log.md). This log returns the instance of the logging API for the scene. The script then calls the Write method specifically on that instance of `Sansar.Script.Log`. Different scripts could actually get a _different_ instance of Sansar.Script.Log - and when multiple script _owners_ in a scene become possible they will! For now, however, all scripts in a scene are owned by the scene owner and thus all share the same Log. Three of the largest APIs have multiple instances based on how much _access_ they give; some can do more things than others. Those APIs that end in _Public_ ([`ScenePublic`](/scripting/api/sansar.simulation/scenepublic.md), [`AgentPublic`](/scripting/api/sansar.simulation/agentpublic.md), and [`ObjectPublic`](/scripting/api/sansar.simulation/objectpublic.md)) are the least powerful as they are intended to be used “by anyone”. Those that end in _Private_ ([`ScenePrivate`](/scripting/api/sansar.simulation.md), [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate.md), and [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate.md)) are more powerful as they offer access to more private internals. Scripts that are on objects built into the scene get access to `ScenePrivate` while visiting scripts would only get access to `ScenePublic`. `SimpleScript` contains the other API access points for the script; directly itself or inherited from its base class ScriptBase. Those members and some notable APIs are: * [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate.md): Access to the Scene APIs and a way to find many other APIs. * FindAgent to get AgentPrivate APIs to the visitors of the scene. * FindObject to get ObjectPrivate APIs to other objects in the scene. * Chat to subscribe to chat messages and send chat messages to users and other scripts. * User to subscribe to events when users enter or exit the scene. * CreateCluster to add new objects to the scene. * [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate.md): Access to APIs for the object the script is attached to: * Position, Rotatation and related physics simulation information. * GetComponent: Objects are primarily a collection of parts called components. They may contain one or more of [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent.md), [AnimationComponent](/scripting/api/sansar.simulation/animationcomponent.md), and [AudioComponent](/scripting/api/sansar.simulation/audiocomponent.md) which can be accessed with GetComponent. * [Log](/scripting/api/sansar.script/log.md): For writing to the script debug console (Ctrl+D). * [Memory](/scripting/api/sansar.script/memory.md): For information on how much memory is available to scripts, how much is used, and subscribing to events related to memory use levels. ## Events A script that says Hello World in the logs isn’t exactly useful or interactive. To make a script interactive, we need it to respond to something happening: an _event_. An event can be many things, including a collision, someone entering the scene or leaving it, a chat message, a keyboard press, a message from another script, and more. SimpleScript has some methods you can override to handle common events. It is also possible to set up your own subscription explicitly through a Subscribe method. Here we will be using SimpleScripts overrides, which do all the setup work for us. Let's update the hello world script to instead greet users as they arrive in the scene. We don't need the SimpleInit any more, so we will replace it with an override of OnAddUser(AgentPrivate agent): ```csharp using System; using Sansar; using Sansar.Script; using Sansar.Simulation; public class MyScript : SimpleScript { protected override void OnAddUser(AgentPrivate agent) { Log.Write("Hello!"); } } ``` Now whenever a new visitor arrives in the scene, the method `OnAddUser` runs and writes "Hello!" to the logs. For our greeter we want to send a chat message to the user that just logged in, welcoming them to our scene. An _agent_ is a server-side representation of a logged in user, and it has a reference to a Client API we can use to sent them a chat message. ```csharp using System; using Sansar; using Sansar.Script; using Sansar.Simulation; public class MyScript : SimpleScript { protected override void OnAddUser(AgentPrivate agent) { // Send the chat message to their client agent.Client.SendChat("Welcome to my scene!"); } } ``` Once we add this script to an object in the scene, all visitors arriving in the scene are greeted by a message in their chat window welcoming them. ## Editable properties While our greeter is at least a little interactive, it isn’t very easy to customize or reuse. If we want to say a different message, we would need to modify the source code and re-upload the script. Sansar scripts show their public fields in the object properties for any object the script is on. We can use this to show a Message field that lets us change the message without recompiling or re-uploading the script. ```csharp using System; using Sansar; using Sansar.Script; using Sansar.Simulation; public class MyScript : SimpleScript { public string Message; protected override void OnAddUser(AgentPrivate agent) { // Send the chat message to their client agent.Client.SendChat(Message); } } ``` Now after adding this script to an object in the scene and opening that object’s properties window, we will see this: | ![Script no attributes](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------------------- | | Note the **Message** attribute and blank text field. | If we put this script on the Sansar Store, anyone could adjust the message as they needed, and we could use the same script in different scenes with different messages without recompiling. We can make it even better with a couple of _attributes_. Attributes in C# are ways of attaching extra information to pieces of code. In this case we will use the `[DisplayName("")]` and `[DefaultValue("")]` attributes to give us a more meaningful name and an example message which will help make it clearer how to use the script. To apply these to our Message field we simply place them above the field. ```csharp using System; using Sansar; using Sansar.Script; using Sansar.Simulation; public class MyScript : SimpleScript { [DisplayName("Greeter Message")] [DefaultValue("Welcome to my scene!")] public string Message; protected override void OnAddUser(AgentPrivate agent) { // Send the chat message to their client agent.Client.SendChat(Message); } } ``` Now looking at the properties for an object with this script will show this, which is more user friendly: | ![Script with attributes](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------------ | | **Message** has become **Greeter Message**, and the text field is populated with a default message. | SimpleScript event overrides SimpleScript offers several overrides to handle common event types. * OnAddUser(AgentPrivate agent) : When a user joins the scene. * OnRemoveUser(AgentInfo agentInfo): When a user leaves the scene. * OnTimer(): Automatically called 10 times a second. * OnCollision(CollisionData data): Called when the object the script is on collides with another object. * OnChat(ChatData data): Called whenever there is chat on channel 0. * OnScriptEvent(ScriptId sender, Object data): Called when scripts send script events to this script. Since the default values on these overrides may not always be the best, SimpleScript also includes some Attributes to adjust them: change the rate of OnTimer, set what types of objects cause OnCollision, which channel to listen to for OnChat and more. It is also possible to use these attributes to create _extra_ event handlers, by applying them to other methods that match the function list of the overrides. Lastly there are a couple of helper methods and properties in SimpleScript worth pointing out: * RigidBodyComponent: This property will be the [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent.md) of the object the script is on. * GetSubscription(string methodName): Gets an [IEventSubscription](/scripting/api/sansar.script/ieventsubscription.md) for the named method, if it is subscribed to events either as an override or with an attribute. This IEventSubscription can be used to cancel the events. Source: https://docs.sansar.com/scripting/guides/intro-to-scripting-in-sansar --- # Working With Scripts ## Working with scripts Scripts add interactive behaviors to objects in an experience. In Sansar, you can create, upload and add your own scripts in C#. Script API documentation For more information on creating scripts for Sansar, read our [API Documentation](/scripting/api-overview.md). Alternatively, you may also find the API Documentation within the Sansar program folder. You can find the documentation on your system using the following file path: **Program Files** > **Sansar** > **Client** > **Script API > Documentation**. To stay updated on the latest Script API changes, see [Script API updates](/scripting/script-api-updates.md). ### Uploading scripts If you are interested in uploading scripts written in C# (.cs) to your inventory from your computer, see [Uploading items in Sansar](/create/import/importing-items.md) for a step-by-step guide on the upload process. Note that you will receive a warning if your script makes use of one of the [Restricted APIs](/scripting/restricted-apis.md). Adding a script to an object You can add scripts to objects in order to make them perform actions or interact with avatars and the environment. Currently, there are two ways to add a script to an object in a scene. For more information on these two ways, see [Adding scripts to an object](/scripting/guides/adding-scripts-to-an-object.md). **Note:** As of October 31, 2017, objects do _not_ need to be set to IsDynamic in order to trigger collision events. Additionally, animated objects may trigger collision events if their animation causes them to collide with another object or avatar. Setting the script's parameters Some scripts allow you to enter parameters to modify the way the script works. Each script is unique, so the name and function of parameters for each script may be different based on how it was defined by the script writer. For more information on setting a script's parameters, see [Setting script parameters](/scripting/guides/setting-script-parameters.md). ### Standard scripts and example scripts We have provided several example scripts in the Sansar client's install folder for you to use. You can find the example scripts by following the file path: **Program Files** > **Sansar** > **Client** > **Script API** > **Examples**. You can also find some documentation (and some download links) for some of these example scripts at [Example Scripts in Sansar](/scripting/examples/about.md). ### Integrate the Sansar Script APIs into Visual Studio To help you get started with scripting in Sansar, we have provided a project file, _ScriptExamples.csproj_, in the install folder which imports all of Sansar's APIs and example scripts into Visual Studio. It is located located in the Sansar install folder: **Program Files** > **Sansar** > **Client** > **Script API** > **Examples**. Simply open the folder in Visual Studio 2015 and the project will import the APIs and example scripts.
Source: https://docs.sansar.com/scripting/guides/working-with-scripts --- # Adding Scripts to an Object ## Adding scripts to an object You can add scripts to objects in order to make them perform actions or interact with avatars and the environment. When scripts are added to an object, they become part of the object as that object's component. Currently, there are two ways to add a script component to an object: ## Drag and Drop the script from your Inventory To add scripts using the drag and drop method from your [Inventory](/create/world-editor/scene-item-inventory.md): 1. In Edit Mode, choose an object you want to apply the script to. It can be an existing object in the scene or a new object from your Inventory. If you wish to add the script to a new object, drag that object into the scene. 2. Select the script from your Inventory and drag the script to the object. 3. Now that the script has been applied to the object, open the properties panel for the object. Select the object and click the **Properties** button to open the properties panel. | **Properties** button | | -------------------------------------------------------------------------------------------------------------------- | | Click the **Properties** button on the object menu. | 4. At the bottom of the object's Properties panel is a Script Settings section. From there, you can edit the script's parameters. | ![Apply a script](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------- | | Drag and drop a script onto an object in the scene. | ## Adding the script from the Scene Objects panel To add scripts via the Scene Objects panel, see adding scripts in [Object Editing](/create/world-editor/object-components.md). For more information on scripts, see [Working with scripts](/scripting/guides/adding-scripts-to-an-object.md).
Source: https://docs.sansar.com/scripting/guides/adding-scripts-to-an-object --- # Setting Script Parameters ## Setting script parameters Some scripts allow you to enter parameters to modify the way the script works. For example, the default script [Teleport (Local)](/scripting/guides/configuring-teleport-scripts.md) requires you to provide X, Y, and Z coordinates as parameters in order to define its teleport destination. Each script is unique, so the name and function of parameters for each script may be different based on how it was defined by the script writer. Once you've [added a script to an object](/scripting/guides/adding-scripts-to-an-object.md), you can begin to set your script parameters: 1. To modify a script's parameters, you must first access the object's or the script's properties panel. In the properties panel, look for the Script Settings section. 2. Under the Script Settings section, click the Script dropdown menu to select the script that you want to use. | ![Script settings](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------- | | Click the dropdown menu to select from a list of scripts that you have in your inventory. | **Note:** If you originally dragged and dropped a script to the object, the dropdown menu field will already have that script selected. 3. Once a script has been selected, the properties window shows a list of parameters you can modify. Each script is different and may exhibit different parameters that you may set. If you want to try your hand on some scripts, we highly recommend that you try our [example scripts](/scripting/examples/about.md). Each one is unique and allows you to to set different parameters depending on the script's function.
Source: https://docs.sansar.com/scripting/guides/setting-script-parameters --- # Using the Script Console ## Using the Script Console The script console allow developers to view script [log messages](/scripting/api/sansar.script/log.md) in the Sansar client without having to use a helper logging script or commands. | ![Script console](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------ | |


The Script Console.

| ### Accessing the Script Console The script console is only accessible while visiting experiences that you have created. While visiting your created experience, press **CTRL+D** to toggle the console on and off. **Note:** * Only the experience owner can see the log messages. Other visitors do not see the log messages in the console. * The script console starts fetching data once a user enters an experience. * The log messages are recorded in real time and the data from previous sessions reset when leaving and re-entering experiences. * The Script Console can gather data across instances for that particular experience, but resets when changing instances. ### Using the Script Console **Information on the Script Console** The Script Console pulls [log messages](/scripting/api/sansar.script/log.md) and reports the messages in color according to [LogLevel](/scripting/api/sansar.script/loglevel.md): * **Info** - Basic informational messages, which are show in white. * **Error** - Error messages, which are shown in red. * **Warning** - Warning messages, which are show in yellow The Script Console currently shows the following information: * **Timestamp** - The local time at which the first occurrence of the message happens. * **Occurrence** - The number of times in a row the message/tag combo appears. * **Tag\*\*\*\*s** - Any user defined tags * **Message** - Any user defined messages ### Navigating the Script Console On the upper left side of the Script Console panel, there are three main tabs to filter through log messages: * The **Output** tab - Shows all LogLevel messages: basic informational, error, and warning message. The **Output** tab shows the following data: \_\ \_ * The **Error\*\*\*\*s** tab - Shows only error messages. The **Errors** tab shows the following data: \_\ \_ * The **Warnings** tab - Shows only warning messages. The **Warnings** tab shows the following data: On the right side of the Script Console panel, there are a few additional options that you can trigger: * The **Clear** button - Clears messages from the active tab of the Script Console. * The **Scroll Lock** checkbox **-** Toggles scrolling to the latest message logged in the Script Console **On** or **Off**.
Source: https://docs.sansar.com/scripting/guides/using-the-script-console --- # Working With Trigger Volume ## Working with trigger volumes A _trigger volume_ is an invisible, non-collidable area that generates a [Trigger event](/scripting/api/sansar.simulation/collisioneventtype.md) whenever an object or avatar enters or exits the area. This can be useful for opening automatic doors, counting visitors, and many other applications. ### Using trigger volumes Here are some steps to set up a trigger volume. For the purpose of this guide, we will be using the example script [_triggerannounce.cs_](/scripting/guides/working-with-trigger-volume.md#triggerannounce-example-script), which announces when something enters or exits the trigger volume. ### Adding a trigger volume to a scene * Create a new experience as described in [Quick start: Creating experiences in Sansar](/create/worlds/build-your-first-world.md). For simplicity, choose the Base Template scene as the experience's starting template. * Remember that trigger volumes are invisible. You may want to consider using visible objects to identify the trigger location or not, depending on your desired outcome. In this example, place two or more visible objects in such a way that you can easily navigate between them. We have used the free [Sansar Example Crate 1.0](https://www.sansar.com/store/listings/6360a992-4d64-4f40-b54f-dca178bb862d/sansar-example-crate-10) from the [Sansar Store](https://www.sansar.com/store). This step is to make sure we can find the trigger volume while visiting the scene. * From the System Objects tab of your Inventory, drag a new Trigger Volume into the scene. In this example, position it between the visible objects you have placed, such that a visitor must pass through the trigger volume in order to walk between the visible objects.

The trigger volume is between the two visible objects in such a way that visitors must pass through the trigger volume when walking between the two crates.

*** * Choose a script that makes use of the [Trigger event](/scripting/api/sansar.simulation/collisioneventtype.md). For the purposes of this example, upload the [_triggerannounce.cs_](/scripting/guides/working-with-trigger-volume.md#triggerannounce-example-script) script. * Drag the script onto the trigger volume, or [add a script component](/create/world-editor/object-components.md) on the trigger volume container. * **Save**, then **Build** your scene. * When the scene has finished building, click the **Visit Now** button that appears to visit your scene. ### Testing the trigger volume When visiting the scene, walk into the trigger volume to trigger the attached script. Remember that trigger volumes are invisible to visitors, so you should walk towards the visible object markers, if there is one. In the exercise above, the example script, [_triggerannounce.cs_](/scripting/guides/working-with-trigger-volume.md#triggerannounce-example-script), is added to the trigger volume in between two (visible) objects. Walk into the area indicated by the visible objects you placed earlier to trigger the script. When you enter or exit the trigger volume, example script causes the trigger volume to log your entry or exit in chat. **Note**\*\*:\*\* In order to view chat messages from any script, you must have the [Chat app](/explore/social/chat-panel.md) open.

When entering the invisible trigger volume, triggerannounce.cs announces your entry in the Chat app.

*** ### Trigger volume main properties To access the trigger volume's properties, find the trigger volume's name in the Scene Objects panel, right-click it, and choose **Properties** to open its Properties panel.

The Properties panel for a trigger volume.

*** **The trigger volume properties include:** **Position** - The location of the trigger volume's center. **Rotation** - The trigger volume's orientation in the scene. **Scale** - Increases or decreases the size of the entire trigger volume; defaults to 1.0. **Movable From Script** - Set to **On** to allow scripts to move, rotate, and scale the trigger volume. **Collides With** - Determines what kinds of objects can activate the trigger volume. For the best performance, **Avatars and Dynamic Bodies** is selected by default, but you can allow additional object types by selecting **Everything** from the dropdown. For additional information about the types of movable objects, including dynamic objects, see [Object motion types](/create/world-editor/object-motion-types.md). **Extents / Radius** - May show one or the other based on the VolumeType selected. Changing the VolumeType defines the shape of the trigger volume. See [changing the volume type](/scripting/guides/working-with-trigger-volume.md) below for information on **Extents** and **Radius** and how to change the VolumeType between a **Box** or a **Sphere**. ### Changing the Volume Type You can change a trigger volumes shape by accessing the volume component within the trigger volume's container. To access this: 1. Find the trigger volume's name in the Scene Objects panel and click on the blue arrow beside the name to drop down the trigger volume's list of components. 2. Find the _Volume_ component and right-click it to open a sub-menu of actions. 3. Then, choose **Properties** from the sub-menu to open the volume Properties panel. The properties in the volume-specific properties panel include: **VolumeType** - The volume properties panel allows you to set the shape of the trigger volume to either a **Box** or **Sphere** by using the drop down. **Box** is the default volume type. Keep in mind that this can only be set in the Volume properties panel. **Note:** Mesh is currently a selectable VolumeType on the drop down list. However, it is currently not supported with trigger volumes. Depending on whether you've chosen to use **Box** or **Sphere** as the **VolumeType**, you will see the following show up on the volume properties panel and the trigger volume's main properties panel: **Extents** - For the **Box** VolumeType only; defines the proportions of the trigger volume in the X, Y, and Z coordinates. **Radius** - For the **Sphere** VolumeType; defines the radius of a spherical trigger volume. **Note:** While **HasCollision** appears on the volume properties panel, it is currently not supported with trigger volumes.

Selecting the VolumeType from the properties of the trigger volume's Volume component.

*** ### TriggerAnnounce Example Script ```cs using Sansar.Simulation; /// /// TriggerAnnounce announces on chat when someone (or some thing) enters the volume the script is attached to. /// public class TriggerAnnounce : SceneObjectScript { public override void Init() { RigidBodyComponent rigidBody; // Collision events are related to the RigidBody component so we must find it. // See if this object has a RigidBodyComponent and grab the first one. if (ObjectPrivate.TryGetFirstComponent(out rigidBody) && rigidBody.IsTriggerVolume()) { // Subscribe to TriggerVolume collisions on our rigid body: our callback (OnCollide) will get called // whenever a character or character vr hand or dynamic object collides with our trigger volume rigidBody.Subscribe(CollisionEventType.Trigger, OnCollide); } else { // This will write to the script console Log.Write("Couldn't find rigid body, or rigid body is not a trigger volume!"); } } // "Collision" events are really RigidBody events, and they get RigidBodyData. private void OnCollide(CollisionData data) { // Ignore hands: if (data.HitControlPoint != ControlPointType.Invalid) return; if (data.Phase == CollisionEventPhase.TriggerEnter) { ScenePrivate.Chat.MessageAllUsers($"Object {data.HitComponentId.ObjectId} has entered my volume!"); } else { // HitObject might be null if the object or avatar is no longer in the scene, here we are just reporting the object id. ScenePrivate.Chat.MessageAllUsers($"Object {data.HitComponentId.ObjectId} has left my volume!"); } } } ``` Source: https://docs.sansar.com/scripting/guides/working-with-trigger-volume --- # Referencing Scene Components ## Referencing scene components with scripts [Scripts](/scripting/api-overview.md) can contain direct references to _Light_, _Audio_, _RigidBody_ or _Animation_ components in the same scene. Among other capabilities, these component references allow you to accomplish tasks such as saving a collection of connected objects for sale in the [Sansar Store](/store/selling/manage-listings.md). In this article, we'll use the terms _source_ and _target_. The _source_ is a [script parameter](/scripting/guides/setting-script-parameters.md) that contains the _target_ as its value. ### Creating a reference You can create a reference by copying a target component from the Object Structure panel (or from another component reference) and pasting it into a script's corresponding parameter field in the Properties panel. The component script's parameter text cannot be edited directly. Right-click the parameter field and select **Paste** to set it to the last-copied component, if the copied component's type matches the parameter's type (Light, Audio, RigidBody, or Animation). Right-click the field and select **Clear** to set the value to an empty object. You may also paste a target into an element of a parameter array if the script is designed to accept an array of targets. ### Duplication When a set of interacting items is duplicated, all the interactions get duplicated accordingly: * If a component reference source and target are both included in a duplicated set, then the duplicate of the source points to the duplicate of the target. * If the target is outside the duplicated set, then the source points to the original target. ### Collections (grouped objects) If you save a collection to your inventory contains both the source and target for a reference, then that reference is retained in the inventory collection. All intact references will be restored when the item is dragged into a scene. This allow you to sell a collection of interacting objects on the Sansar Store, or make several independent instances of the collection. ### Broken references An script parameter can link to another scene element that has been deleted. When this happens, the parameter is displayed as **(not found)** in the Properties panel. When you build your scene, you will receive a warning about any broken references that were detected during the build process. There is currently no warning when a targeted item is deleted. However the Undo function may recover the reference if it is still available. When creating a collection, if the selected items contain broken links or if target components are not part of the selection, you will be warned and given a chance to cancel the creation of the collection. If you choose to disregard the warning, the broken links will be erased from the items in the collection.
Source: https://docs.sansar.com/scripting/guides/referencing-scene-components --- # Configuring Teleport Scripts ## Teleport local Teleports any user that collides with the scripted object to a set of given coordinates within the same experience. To change the destination coordinates: 1. Select the scripted object. 2. Click the **Properties** button on the scripted object to open the Properties panel. 3. Under Script Settings, enter values for **Destination X**, **Destination Y**, and **Destination Z**. 4. De-select the object in order to save the destination values. | ![Teleport to a local destination](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------ | | Enter values for Teleport Destination X, Y, and Z. | ## Teleport remote Teleports any user that collides with the scripted object to another experience. To change the destination experience: 1. Select the scripted object. 2. Click the **Properties** button on the scripted object to open the Properties panel. 3. Under Script Settings, enter values for **Dest. Scene** and **Dest. Scene Owner**. 4. De-select the object in order to save the destination values. You can find an experience's Destination Scene name and Scene Owner by copying and analyzing the destination experience's URL. * If the destination is listed in the [Atlas](/explore/codex.md), you can obtain its URL by clicking the experience's portrait to see more information, then clicking the **Copy URL** button to copy the experience's URL to your computer's clipboard. * If the destination experience is one of your projects that is _not_ listed in the Atlas, you can access its URL in [My Projects](/create/worlds/my-worlds-panel.md) by clicking **More Options** and then choosing **Copy URL** to copy the experience's URL to your computer's clipboard. Once you have the destination experience's URL, you can figure out the scene name and owner's Avatar ID. The owner's Avatar ID appears in the URL after "https://www.sansar.com/worlds/", and the destination scene name appears after the Avatar ID. For example, if an experience's URL is: "https://www.sansar.com/worlds/sansar-studios/social-hub", the owner's Avatar ID is "sansar-studios", and the destination scene name is "social-hub". | ![Teleport to a remote destination](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------- | | Enter a Destination Scene name and the scene owner's Avatar ID. | How to add a script to one of your objects For information about adding a script to an object, see [Uploading and Adding Scripts](/scripting/guides/adding-scripts-to-an-object.md).
Source: https://docs.sansar.com/scripting/guides/configuring-teleport-scripts --- # Simple Script User Guide > Simple Scripts user guide ## Simple Scripts overview _Simple Scripts_ are a set of plug-and-play scripts that come with Sansar. They are designed to be easily configured without modifying their code, and they work with each other to create interesting and useful effects when triggered. ## Triggers and responders There are two essential types of Simple Scripts: _triggers_ and _responders_. Triggers send one or more _named messages_ to all other Simple Scripts when a particular action, such as a touch or a chat command, happens. The property names for triggers end with `->`. For example, if we were to put SimpleInteraction on an object and set the value for `On 1st Click ->` to "`clicked`", then any time that object is clicked it will send the named message "`clicked`" to all other simple scripts. Responders listen for one or more named messages from all other Simple Scripts and perform an action when the message is received. The property names for responders start with ->. For example, if we were to put a SimpleLight on an object and set teh value for "-> Mode A" to "clicked", then the light will switch to the color and intensity of Mode A whenever a Simple Script sends the message "clicked". By putting both of these example objects into the same scene, we can then change the light of the responder object to Mode A by clicking the object with the trigger. Any responder or trigger field can take a list of comma-separated named messages, to either respond to multiple different named messages or to send multiple different named messages. ## Where to get Simple Scripts Simple Scripts are in your Sansar inventory by default, in the **Purchased** category. If you need to re-upload any Simple Scripts, or if you are interested in their code, you can find them in your Sansar installation folder, under `/Client/ScriptApi/Examples/SimpleScripts`. At this time, there are 14 Simple Scripts. For details on the parameters for each, take a look at [Example Scripts](/scripting.md#examples)
Source: https://docs.sansar.com/scripting/guides/simple-script-user-guide --- # Example Scripts in Sansar ## Example Scripts in Sansar In Sansar, scripts allow you to add dynamic and interactive behaviors to objects. Here are a few example scripts that you can experiment with in Sansar. | Example Script | Script Details | | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | | [Simple Script](/scripting/examples/simple-script.md) (_SimpleScriptExample.cs_) | This script shows how you can use the new "Simple Script" base class. | | [Visitor Tracker](/scripting/examples/visitor-tracker.md) (_VisitorTrackerExample.cs_) | This script tracks the number of visitors that visited your experience over the course of a session. | | [Follow The Path](/scripting/examples/follow-the-path.md) (_FollowThePath.cs_) | This script moves a dynamic object along a route of points, in a loop. | | [Random Movement ](/scripting/examples/random-movement.md)(_RandomMovement.cs_) | This script randomly moves a dynamic object around its starting position. | | [Teleport Hotkeys](/scripting/examples/teleport-hotkeys.md) (_TeleportHotkeys.cs_) | This script allows you to set hotkeys that will teleport users to another experience when pressed. | | [Stats Example](/scripting/examples/stats-example.md) (_StatsExample.cs_) | This script provides useful statistics about the current experience. | | [Sound Randomizer ](/scripting/examples/sound-randomizer.md)(_SoundRandomizer.cs_) | This script plays randomly from a list of sounds at randomized intervals. | | [Cannonball](/scripting/examples/cannonball.md) (_CannonGameExample.cs_) | This script throws a cannonball from the avatar. | | [Reflective Detector](/scripting/examples/reflective-detector.md) (_ReflectiveDetectorExample.cs_) & [Reflective Tracker](/scripting/examples/reflective-detector.md) (_ReflectiveTrackerExample.cs_) | These two scripts detects and tracks how many times the users hit the detectors in objects in a scene. | **Note:** These files are also available in the client folder: Program Files > Sansar > Client > Script API > Examples Source: https://docs.sansar.com/scripting/examples/about --- # Cannonball > Example Script: Cannonball The example script, Cannonball \_(CannonGameExample.\__cs),_ throws a cannonball from the avatar. You can get the script file from the download link at the end of the page or in the client directory: Program Files > Sansar > Client > Script API > Examples. Instructions Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting/guides/working-with-scripts.md) to upload the script and add it to an object. 3. Open the object's Properties panel and go to the Script Settings section. 4. With the _CannonGameExample_ script selected on the dropdown menu, the parameters listed in the Script Settings shows it's associate public parameters. Fill out the parameter fields based on the script's parameters as defined in this article under Script Parameters. 5. Once you have finished setting the parameters for your object, your script is ready! [Save and build your scene](/create/worlds/saving-and-building-scene.md). 6. If you want to verify that the script is running correctly, [visit the scene](/create/worlds/visiting-your-own-experience.md) and trigger the script by using the trigger buttons listed in this article under Script Controls. Script parameters | Parameter Field | Description | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | InitialSpeed | Sets the speed at which the cannonball is thrown. The higher the value, the faster the object moves. If _InitialSpeed_ is lower than 1.0 or greater than 200.0, then the speed defaults to 10.0. | | Delay |

Sets a delay on throwing the cannonball. The number entered represents the number of seconds between each throw.

Note: If a user repeatedly presses the throw button, the number of throws accumulate and will fire in succession while still considering the delay time.

| | Fire Sound | Assigns a sound to play when the cannon is fired. | | Hit Sound | Assigns a sound to play when the cannon hits a target. | | Loudness | Sets the loudness of the _Fire Sound_ and _Hit Sound_ when played. | | Spawn Point 1 |

Sets teleport points. If Spawn Point values are entered, the targets that are hit randomly teleport to the designated spawn points.

Currently, you must set position points on all four points. By default, the position points <X,Y,Z> is set to <0,0,0>. Leaving <0,0,0> as a position point for any spawn point may teleport the target to <0,0,0>. You may enter the same position point values across all spawn points if you don't want the target to teleport to the <0,0,0> position point.

| | Spawn Point 2 | | | Spawn Point 3 | | | Spawn Point 4 | | Script controls Use the following buttons to trigger the cannonball: | **Controller** | **Button** | | ------------------------ | --------------- | | Keyboard | _**F**_ key | | Oculus touch controllers | _**X**_ button | | Vive wand | N/A | | Xbox controller | _**A**_ button | Source: https://docs.sansar.com/scripting/examples/cannonball --- # Follow The Path > Example Script: Follow The Path The example script, _Follow the Path_ (_FollowThePath.cs_), which moves a dynamic object along a route of waypoints in a loop. Grab it at the download link at the end of the page. Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Open the object's Properties panel and go to the Script Settings section. 4. On the properties panel, set **IsDynamic** to **On**. 5. At the bottom of the object's properties panel is a Script Settings section. Upon looking at the **Script Settings** section for _FollowThePath_, you will see a list of parameters which you can set for the object. Setting values on these parameters can help you set the movement of your object. 6. Once you have finished setting the parameters for your object, your script is ready! Save and build your scene. 7. If you want to verify that the script is running correctly, visit the scene once it has been built. Script parameters | Speed | _Speed_ allows you to set the speed of an object. It is best to set the _Speed_ value between 5 to 25. | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Position 1 |

Position points help define the route of your object along an intended path.

The object's starting position is always at the point at which the object was placed. In total, you may add up to 7 position points for each object by filling the <x,y,z> points with values. However, you may also choose to have fewer position points.

By default, <0,0,0> is set as the <x,y,z> position point for all position points. When <0,0,0> is set, no position point is assigned to that slot.

| | Position 2 | | | Position 3 | | | Position 4 | | | Position 5 | | | Position 6 | | | Position 7 | | | Loop | If _Loop_ is set to **ON**, the objects will move and follow the route of points repeatedly. If _Loop_ is set to **OFF**, the object will warp to the start point after it reaches the end of the defined position points. | | On Collide TP Dest | _On Collide TP Dest_ allows you to set a teleport function. If set, an avatar will be teleported to the defined position point when the object comes into contact with it. | Source: https://docs.sansar.com/scripting/examples/follow-the-path --- # Random Movement > Example Script: Random Movement The example script, _Random Movement_ (_RandomMovement.cs)_, randomly moves a dynamic object around its starting position. Grab it from the download link at the end of this article. Instructions Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Open the object's Properties panel and go to the Script Settings section. 4. On the properties panel, set **IsDynamic** to **On**. 5. At the bottom of the object's properties panel is a Script Settings section. Upon looking at the Script Settings section for the _Random Movement_ script, you will see a list of parameters which you can set for the object. Setting values for these parameters can help you set your object's behavior. 6. Once you have finished setting the parameters for your object, your script is ready! Save and build your scene. 7. If you want to verify that the script is running correctly, visit your scene once it has finished building. Script parameters | ![Random movement script](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------------------ | | The parameters for Random Movement. | | Speed |

Speed allows you to set the speed of an object. The higher the value, the faster the object moves.

However, keep in mind that the speed is affected by the mass of the object. Make sure that the speed of your object is proportional to its mass.

| | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Chaos | _Chaos_ affects how the object changes course when it is hit. The _Chaos_ value should be set between 0.0 and 1.0. The higher it is, the more the object will change course. | | Range | _Range_ determines how far an object will go from their starting position before it goes back to that starting point. _Range_ can be set at any value. | Source: https://docs.sansar.com/scripting/examples/random-movement --- # Reflective Detector > Example Script: Reflective Detector and Tracker The example script, _Reflective Detector_ (_ReflectiveDetectorExample.cs_), allows you to detect when an avatar collides with an object that contains the script. It sends data to the _Reflective Tracker_ (_ReflectiveTrackerExample.cs_), which then tracks the number of hits. You may add as many detectors as you want to objects in your scene. However, the script does not track collisions individually per detector. Instead, all detectors track hits on a scene-wide basis and tracks all collisions towards one tally. Here is a step-by-step guide to using the script: 1. Download the script files from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the scripts to your inventory. 3. Simply drag the scripts to the scene and attach each script to an object. Remember, you may add as many detectors as you wish. 4. There are no parameters for these scripts, so once you finish adding the scripts to your scene, save and build your scene. 5. To test the script, visit the scene once it has been built. **Note:** These files are also available in the client folder: Program Files > Sansar > Client > Script API > Examples Source: https://docs.sansar.com/scripting/examples/reflective-detector --- # Simple Script > Example Script: Simple Script **Simplescript** is a new base class that offers an easy start to simple script writing. The example script, _Simple Script_ (_SimpleScriptExample.cs_), is a more complex script example utilizing this new base class. This script shows how you can use the new script base. The example itself does not have any editable properties when added to a scene in Sansar. However, when added to a scene and attach it to an object, you will be able to get the following : * Users who enter the experience get a welcome message. * Logs when people leave the experience. * Resets its position 5 times a second if the object is dynamic. * Logs when anyone bumps into the object. * Logs when any other script sends it a message. Here is a step-by-step guide to using the script: 1. Download the script files from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the scripts to your inventory. 3. Drag the scripts to the scene and attach each script to an object. Remember, you may add as many detectors as you wish. 4. There are no parameters for these scripts, so once you finish adding the scripts to your scene, save and build your scene. 5. To test the script, visit the scene once it has been built. **Note:** These files are also available in the client folder: Program Files > Sansar > Client > Script API > Examples Source: https://docs.sansar.com/scripting/examples/simple-script --- # Sound Randomizer > Example Script: Sound Randomizer The example script, \_Sound Randomizer (\__SoundRandomizer.cs),_ plays randomly from a list of sounds at randomized intervals. You can get the file from the download link at the end of this article. Instructions Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Open the object's Properties panel and go to the Script Settings section. 4. Look at the Script Settings section on the Properties panel. Make sure that the script dropdown menu is set to the _SoundRandomizer_ example script. If the script is set correctly, a set of editable parameters appears. See below for a short guide on each parameter. 5. Once you have finished setting the parameters for your object, your script is ready! Save and build your scene. 6. If you want to verify that the script is running correctly, visit the scene once it is built. Script parameters | ![Sound randomizer script](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------ | | Parameters for Sound Randomizer. | | | | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | PlayOnAudioComponent | If your object has an [AudioComponent](/scripting/api/sansar.simulation/audiocomponent.md), setting this to "On" causes the sounds to play on the object. The sounds also follow the object if the object moves around. Otherwise, the sounds play directly to your speakers/headphones (like Sansar's UI sounds). | | MinDelayBetweenSounds | The delay between each sound is randomized to fall into this range. If you leave them set to zero, there is no delay between sounds. | | MaxDelayBetweenSounds | | | Sound1 | Assign any of these slots to sounds in your inventory. You do not need to assign all of them. The script plays from the slots that have been assigned. | | Sound2 | | | Sound3 | | | Sound4 | | | Sound5 | | Source: https://docs.sansar.com/scripting/examples/sound-randomizer --- # Stats Example > Example Script: Stats Example The example script, _Stats Example (StatsExample.cs)_, can provide useful statistics about the current experience. Grab the file from the download link at the end of the page. Instructions Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Since this script has no special parameters to set, your script is ready. Save and build your scene. 4. If you want to verify if the script is running correctly, visit the built scene. 5. While visiting the scene, open the Chat app. 6. In the chat field, enter one of the commands listed below in order to get the desired information. | **Command** | **Returned result** | | ----------- | --------------------------------------------------------------------------------- | | /help | Provides information about the other commands. | | /fire | Causes you to fire a cannonball. | | /xpinfo | Provides information about the current experience, including name, IDs, and more. | | /listagents | Lists all agents currently in the scene. | | /mypos | Tells you your current position within the scene. | Source: https://docs.sansar.com/scripting/examples/stats-example --- # Teleport Hotkeys > Example Script: Teleport Hotkeys This example script, _Teleport Hotkeys (TeleportHotkeys.cs)_, allows you to set hotkeys that teleport users to another experience when pressed. Instructions Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Open the object's Properties panel and go to the Script Settings section. 4. Upon looking at the Script Settings section for _TeleportHotkeys_, you will see a list of parameters which you can set for the object. Setting values on these parameters can help you set the teleport hotkey and experience destination. See the section on Script Parameters for a full listing of parameters. 5. Set a TeleportHotkey that will be used to trigger the script. 6. To grab the experience name and Avatar ID of the experience that you want as a teleport location, go to the details page of the the experience that you want to designate. 7. Once you are on the experience details page, click **Copy URL** on the bottom left corner of the details page. This opens a new window which shows the experience's URL, where you can copy the Experience name and the creator's Avatar ID (Persona Handle) as seen below. | ![Teleport target](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------- | | Access the experience URL to access the Avatar ID (aka Persona Handle) and Experience name. | 8. Once you have finished setting the parameters for your object, your script is ready! Save and build your scene. 9. If you want to verify that the script is running correctly, visit the scene once it has been built. Script parameters | Teleport example | | | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | TeleportHotkey | Designate a hotkey that will trigger the teleport script to run and transfer the user to the designated experience. You can choose from the list of keyboard and gamepad buttons below. | | Experiences | Designate the name of the designated experience that you want your users to teleport to when the TeleportHotkey is triggered. | | PersonaHandle | To properly direct your users to the correct experience, you must also grab the creator's Avatar ID (aka Persona Handle) from the Experience's URL. | Parameters for TeleportHotkey | | | | | | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | Keyboard Buttons |
  • Key_W
  • Key_A
  • Key_S
  • Key_D
  • Key_Space
  • Key_F
  • Key_1
|
  • Key_2
  • Key_3
  • Key_4
  • Key_5
  • Key_6
  • Key_7
  • Key_8
|
  • Key_9
  • Key_0
  • Key_F1
  • Key_F2
  • Key_F3
  • Key_F4
  • Key_F5
|
  • Key_F6
  • Key_F7
  • Key_F8
  • Key_F9
  • Key_F10
  • Key_F11
  • Key_F12
| | Gamepad Buttons |
  • Gamepad_DpadUp
  • Gamepad_DpadDown
  • Gamepad_DpadLeft
  • Gamepad_DpadRight
  • Gamepad_SmallLeft // Xbox: Back, PS: Select
  • Gamepad_SmallRight // Xbox: Start, PS: Start
  • Gamepad_LeftThumb
  • Gamepad_RightThumb
  • Gamepad_LeftShoulder
|
  • Gamepad_RightShoulder
  • Gamepad_ButtonLeft // Xbox: X, PS: Square
  • Gamepad_ButtonTop // Xbox: Y, PS: Triangle
  • Gamepad_ButtonRight // Xbox: B, PS: Circle
  • Gamepad_ButtonBottom // Xbox: A, PS: X
  • Gamepad_Extra1
  • Gamepad_Extra2
| | | Source: https://docs.sansar.com/scripting/examples/teleport-hotkeys --- # Visitor Tracker > Example Scripts: Visitor Tracker The example script, _Visitor Tracker_ (_VisitorTrackerExample.cs_)_,_ tracks the number of visitors that visited your experience over the course of a session. Grab the file at the download link at the end of the page. Instructions Here is a step-by-step guide to using the script: 1. Download the script file from the download link at the end of this article. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Open the object's Properties panel and go to the Script Settings section. 4. At the bottom of the object's properties panel is a Script Settings section. Set the parameters according to the Script parameters section of this article. 5. Once you have finished these steps, your script is ready. Save and build your scene. 6. If you want to verify if the script is running correctly, visit the built scene. 7. While visiting the scene, open the Chat app. 8. In the chat field, type the command that you have set. In this example, `/visitors`. This prompts the script to run and a message box opens showing a log of all the visitors who have visited the scene. ![Chat type](/media/screenshot-pending.svg) Script parameters | ![Visitor tracker](/media/screenshot-pending.svg) | | ------------------------------------------------------------------------------------------------------------------ | | The parameters for Visitor Tracker | | Parameter field | Description | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | OwnerName | If you prefer to have the script listen only to your commands, set the **OwnerName** to your display name. Otherwise, leave it blank to let anyone issue the command. | | VisitorListCommand | The word you would like to use as a command. For this example, let's use "/visitors" as a command. | **Notes:** A few notes for the _VisitorTrackerExample.cs_ example script: * The script logs the visitors who came and visited your experience. * This script only runs until an experience session ends. Once it ends, the tracker resets and all data is lost. * An experience session ends when your scene has been empty (no visitors) for some time. Source: https://docs.sansar.com/scripting/examples/visitor-tracker --- # Mover Examples > Example Script: Mover Examples There are three mover example scripts to help learn the mover API. Each of them can be set up for use using the standard scripting import and attach process outlined in the following instructions. Instructions Here is a step-by-step guide to using the scripts: 1. Find the MoverExample script files in the Sansar\Client\ScriptApi\Examples folder in your Sansar installation. 2. Follow the instructions provided in [Working with scripts](/scripting.md#guides) to upload the script and add it to an object. 3. Open the object's Properties panel. 4. On the properties panel, set **Movable From Script** to **On**. 5. If the object has a physics, set **Motion Type** to **Keyframed**. 6. At the bottom of the object's properties panel is a Script Settings section. Upon looking at the Script Settings section for the _Mover Example_ script, you can see a list of parameters which you can set for the object. Setting values for these parameters modifies the script’s behavior. 7. Save, build and run your scene to see the script in action! MoverExample1 This script makes an object move away from an avatar when they click on it. It shows how to make an object interactive and how to use the Mover API to move an object in a direction. It shows the user feedback in a modal dialog if the object is not configured correctly for movement. The properties on this script are: * **Interaction** - This is the mouse-over text you see in-world. * **Distance** - The distance the object moves when clicked. * **Seconds** - The length of time (in seconds) for the movement. The key takeaways from this script are: * How to set up an object to be able to move it from script. * How to check to see if an object can be moved without triggering an exception. * How to translate an object using the Mover API. MoverExample2 This script makes an object spin on its own. It shows how to use the Mover API to spin the object and wait for the operation to complete. The properties on this script are: * **Spin Speed** - Spin speed, in number of turns per second. * **Spin Randomly** - ON for random spins, OFF for 360 degree spins back and forth. The key takeaways from this script are: * How to use the mover API to turn an object. * How to wait for mover API instructions to complete. * Using the different MoveModes together. * How to queue multiple operations for a more complex movement with the mover API. * Become more familiar with radians and quaternions. MoverExample3 This script combines the above examples into a single behavior. It shows how to interrupt previous commands queued to the Mover API and replace them with new movement instructions. It is known as the spinning scared robot script. The idle behavior of the robot is to spin randomly until a player clicks on it, which will cause it to flee away from the player and then go back to idly spinning. The properties on this script are: * **Interaction** - This is the mouse-over text you see in-world. * **Flee Distance** - The distance the object moves when clicked. * **Flee Seconds** - The length of time (in seconds) for the flee movement. * **Spin Speed** - The speed for idle rotation. The key takeaways from this script are: 1. How to combine multiple different movement modes. 2. How to interrupt and stop previously queued mover commands. 3. How to check to see if an object currently has pending queued mover commands. 4. Become more familiar with how to combine current object rotation with new relative rotations. 5. Become more familiar with how to enable and disable interactivity while performing other commands. Source: https://docs.sansar.com/scripting/examples/mover-examples --- # Safety > Block, mute and report people, deal with griefing, and report bugs and security issues. - [Reporting abuse](/safety/reporting-abuse) - [Report a profile or Store listing on sansar.com](/safety/report-on-sansar-com) - [Blocking Avatars](/safety/blocking-avatars) - [Muting Avatars](/safety/muting-avatars) - [Abuse and Griefing](/safety/abuse-and-griefing) - [Security issues](/safety/security-issues) - [Reporting issues and bugs](/safety/reporting-issues-and-bugs) ## See also - [Community Standards ↗](https://www.sansar.com/legal/community-standards) - [Moderation tools for world owners](/create/worlds/moderation-tools-for-world-owners) Source: https://docs.sansar.com/safety --- # Reporting abuse If you find abusive content in Sansar, you can report it to us by using the Report Content app. To report abusive content: 1. Position your camera so that you can clearly see the abusive content. 2. From the app launcher, choose **More options** **> Help & Reporting**. | ![Open Help and Reporting](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------------------- | | **More options > Help & Reporting** | 3. In the Help & Reporting panel, click **Report Abuse** to open the Report Abuse panel. | ![Open Report abuse](/media/screenshot-pending.svg) | | -------------------------------------------------------------------------------------------------------------------------- | | Click **Report Abuse** to open the Report Abuse panel. | 4. Choose a category of offense from the dropdown in the Report Abuse panel. Currently, you may choose from: * **Disclosure of real world information** * **Harassment** * **Hate speech, symbols, or other intolerance** * **Inappropriate content or conduct** * **Promoting violence or harmful behavior** * **Repetitive spam** * **S$ or US$ fraud** 5. Provide a description of the abusive content under **Describe the issue**. Detailed descriptions help provide context that may not be visible in the included screenshot. 6. The included screenshot is automatically generated from your current view. 7. Press **Continue** to report the abusive content to us. | ![Report Abuse panel](/media/screenshot-pending.svg) | | ---------------------------------------------------------------------------------------------------------------------------- | | The Report Abuse panel. | Source: https://docs.sansar.com/safety/reporting-abuse --- # Report a profile or Store listing on sansar.com > Report a person's profile or a Store listing to Sansar from sansar.com. Report a person's profile or a Store listing directly from sansar.com when you see content that breaks Sansar's [Community Standards](https://www.sansar.com/legal/community-standards). ## Report a profile You must be signed in at sansar.com to report a profile. **Report** appears on the **Overview** tab of someone else's profile, not on the **Snapshots** tab. 1. Sign in at [sansar.com](https://www.sansar.com) and open the person's profile on the **Overview** tab. 2. Scroll below the **Worlds** section and select **Report**. 3. Type a description of the problem in the **Describe the issue...** box inside **Report Profile**. 4. Select **Submit Report**. If you change your mind before you submit, select **Cancel** to close the box and clear your text without sending. **Submit Report** stays unavailable until you enter text (spaces alone don't enable it) and while the report is being sent. There are no issue categories on the web form. After you select **Submit Report**, the box closes when your report is sent. The page doesn't show a confirmation message. While the report is sending, **Submit Report** is unavailable; if it becomes available again and the box is still open with your text in it, try again or [contact support](/help/contact-support). ## Report a Store listing Anyone can report a Store listing on sansar.com, whether or not you're signed in. 1. Open the Store listing's page on sansar.com. 2. Scroll to the bottom of the details column, below the description and tags, and select **Report this listing**. If the details appear below the listing's pictures, scroll past the pictures to find them. 3. Check the new email to Sansar support that opens in your email app to make sure it includes the listing's title and ID. 4. Add what's wrong with the listing, then send the email. If an email doesn't open, [contact support](/help/contact-support) directly and include the listing's title and web address. The listing ID is the part of the address right after `/store/listings/`. If a listing infringes your copyright, see Sansar's [Intellectual Property Infringement Notification Policy](https://www.sansar.com/legal/ip-policy). ## Other safety options - For something happening in a world right now, see [Reporting abuse](/safety/reporting-abuse). - To hide or silence someone in Sansar, see [Blocking Avatars](/safety/blocking-avatars) or [Muting Avatars](/safety/muting-avatars). - For anything else, [contact support](/help/contact-support). Source: https://docs.sansar.com/safety/report-on-sansar-com --- # Blocking Avatars ## Blocking avatars If another person is acting belligerent, annoying, or otherwise disruptive, you can choose to _block_ that person, effectively silencing their voice chat and hiding their avatar for you personally. Your avatar and voice are also hidden from the blocked person. Others can still see and hear someone you have blocked unless they have also chosen to block that person. Text chat is unaffected by blocking, but blocked avatars can be identified by the red circle around their profile portrait in the Chat panel and People panel. Blocking persists until you unblock that person through their user profile, which is found in the People panel. **Note:** To temporarily mute _only_ someone's voice chat, see the article [Muting avatars](/safety/muting-avatars.md). ## Blocking from the People panel Take the following steps to block an avatar: 1. Open the People panel by choosing **Socialize > Friends & People** from the main menu. 2. Find the person you would like to block; if they are nearby they appear in the **Nearby** tab of the People panel. Otherwise, you can search for them by name in the **Search** tab or on your **Friends** tab. 3. Click the person's name to open their user profile. 4. In the user profile, click the **Block** button to block the avatar. This immediately removes them from your friends list, mutes their voice chat, and hides their avatar from your view. Their text chat remains visible. A red circle appears around their portrait in the People panel and Chat panel. **Notes:** * Other visitors to the scene can still see and hear avatars that you have blocked. * If you block a existing friend they will be automatically removed from your friends list.

Click Block in someone's user profile in order to silence their voice chat and hide their avatar from your view. If the person is your friend, they are automatically removed from your Friends list.

***

Click Unblock in someone's user profile in order to restore their voice chat and visibility. Friendship must be added again separately

*** ## Unblocking from the People panel To unblock someone you have blocked: 1. Open the People panel by choosing **Socialize > Friends & People** from the main menu. 2. Find the person you would like to unblock; if they are nearby they appear in the **Nearby** tab of the People panel. Otherwise, you can search for them by name in the **Search** tab. 3. Click the person's name to open their user profile. 4. In the user profile, click the **Unblock** button to unblock the avatar. Their avatar becomes visible again, their voice chat is audible again, and the ring around their portrait is returned to a gray color. Friendship must be restored separately. ## Blocking a nearby avatar directly Take the following steps in VR or desktop mode to block an avatar: 1. Look at the avatar and **left-click** or hold one of the **grip buttons** to view their identity and interaction options. 2. Press **Block** to silence that person's voice chat and make their avatar disappear from your view. Because the person's avatar becomes hidden from your view, they cannot be unblocked using this method.

Press Block when looking at an avatar and left-clicking or holding a grip button.

*** Source: https://docs.sansar.com/safety/blocking-avatars --- # Muting Avatars ## Muting avatars If another person is acting belligerent, annoying, or otherwise disruptive in chat, you can choose to temporarily _mute_ that person, effectively silencing their voice chat for you personally. Others can still see and hear someone you have muted (and the muted person can still hear _you_) unless they have also chosen to mute that person. Muted avatars remain visible to everyone. Muting currently persists as long as you stay logged into the Sansar client; once you close Sansar and log back in, you must mute the same people again. **Note:** To more permanently ignore another person, see the article [Blocking avatars](/safety/blocking-avatars.md). _Blocking_ mutes voice chat and hides someone's avatar until you remove the block. ## Using the People panel Take the following steps to mute an avatar: 1. Open the People panel by choosing **Socialize > Friends & People** from the main menu. 2. Find the person you would like to mute; if they are nearby they appear in the **Nearby** tab of the People panel. Otherwise, you can search for them by name in the **Search** tab or on your **Friends** tab. 3. Click the person's name to open their user profile. 4. In the user profile, click the **Microphone icon** on their profile portrait. When the icon turns red, you will no longer receive their voice chat. You can click the **Microphone icon** again to unmute the person and resume hearing their voice chat.

Click the Microphone icon on someone's user profile to silence all voice chat from the selected person.

*** ## Muting an avatar directly Take the following steps in VR or desktop mode to mute an avatar: 1. Look at the avatar and **left-click** or hold one of the **grip buttons** to view their identity and interaction options. 2. Press **Mute** to silence that person's voice chat. You can unmute an avatar directly by clicking the **Unmute** button that replaces the Mute button when you have muted the avatar.

Press Mute when looking at an avatar and left-clicking or holding a grip button to silence all voice chat from that person.

*** Source: https://docs.sansar.com/safety/muting-avatars --- # Abuse and Griefing ## Abuse and griefing In any online environment you may encounter _griefers_, individuals who are intentionally disruptive and try to ruin an experience for others. Sansar provides tools to help mitigate abusive behavior and report it to our team. ## Reporting abuse Report abusive content or behavior whenever you can: - In the client: [Reporting abuse](/safety/reporting-abuse) - On the website: [Report a profile or Store listing on sansar.com](/safety/report-on-sansar-com) - To staff on Discord: [Reporting issues and bugs](/safety/reporting-issues-and-bugs) Sansar reads and evaluates every report to identify griefers and decide whether disciplinary action is needed. Sansar does not notify you whether it takes action. ## Muting voice chat A more immediate solution to certain kinds of abusive behavior is to [mute the offending avatar](/safety/muting-avatars.md). Muting currently silences voice chat, and persists until the next time you log into Sansar. **Note:** Be aware that other people in a scene are still able to hear someone you have muted, and the muted person is still able to hear you. ## Individual Volume Controls Sansar has a volume slider that you can use to adjust the volume of other users microphones individually, this persists until you log out and will need to be readjusted upon logging in again. Note: This only affects the volume for yourself and not others in the room ## Comfort zones To mitigate the feeling of someone invading your personal space, _comfort zones_ are an area around your avatar in which other avatars disappear from your sight. Comfort zones work in both desktop and VR mode. Comfort zones are off by default, but can be toggled and adjusted in [Settings](/explore/settings/general-settings.md). ## Moderating an experience There are a few tools available for experience owners to moderate their own experiences such as kicking, banning, and experience access controls. See [Moderation tools for experience owners](/create/worlds/moderation-tools-for-world-owners) for more information. Source: https://docs.sansar.com/safety/abuse-and-griefing --- # Security issues Issues pertaining to the security of Sansar should be sent to Sansar by the method described below. Please help us keep Sansar secure by ensuring that possible security exploits aren't broadly advertised before a fix is available. ## What constitutes a security issue? If an issue poses any of the following threats to Sansar, its customers, or content, then it is an exploit and should be reported: * Exposes the real life identity of users without consent * Destroys content * Permits unauthorized access to Sansar or Sansar resources * Compromises the Sansar client or server host, subjecting it to remote control * Links to malicious external websites ## How do I report a security issue? To file a security issue: 1. Join the sansar [Discord!](https://discord.gg/sansarofficial) 2. Contact a Admin or another member of Sansar Staff indicated by a '- Sansar' tag 3. Mention you are making a **Security Report and** **What type of problem are you having?** 4. Enter a **Subject** and **Description** of the security issue. Provide as much detail as possible, including your environment (information about your computer, such as your operating system and the model of your graphics card). Include steps to reproduce the security issue. 5. **Please indicate the urgency of this security defect**, please select **Moderate**, **Serious**, or **Critical**. 6. **Attachments**, include any relevant screenshots, logs, or other files. Please report issues as soon as you discover them! ## For other issues: * If you believe your account has been breached, please attempt to change your password immediately via the website and make contact with a member of staff via Discord. * If you are experiencing any other problem, please make a report in a relevant section i.e. support or bugs section. Source: https://docs.sansar.com/safety/security-issues --- # Reporting issues and bugs **Reporting bugs:** If you are experiencing issues in Sansar, you can report the issues you've encountered while using Sansar in our bugs section on[ Discord!](https://discord.gg/sansarofficial). **However, before you report an issue on the forums or submit a case, we highly encourage check these channels prior to submitting a report:** | | | | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Work in Progress | Before anything, please check this Channel to verify that Sansar and its associate services are not experiencing any technical issues or undergoing maintenance that may be causing the issue that you experiencing. | | Announcements |

Since Sansar is still in the Creator Beta stages, some updates may contain known issues upon release. Please check the Announcements section to find out what the expected issues are in the current iteration of the release.

The release notes capture the known issues for the latest release and from previous releases. This is also a great avenue to check whether previously known and/or reported issues have been resolved.

| |

Bugs

Support

|

The Bugs or Support channels in the forum is the best place for users to report issues they encounter while using the Sansar client or website.

Please check this section and see if the issue you are experiencing has already been reported by other users. If the issue is already logged, please feel free to provide additional input in the comments.

We highly encourage you to report bugs and issues here so that the Sansar Support team can field your report. At the same time, your reports are visible to other users who may be experiencing the same issue.

| **Reporting other issues:** | | | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Abuse | If you have issues with another user, or encounter content or an experience that breaks Sansar's rules, report the problem to a staff member on Discord. Look for '- Sansar' after their username. To report abuse in Sansar, see [Reporting abuse](/safety/reporting-abuse). | | Questions and Answers | If you need assistance not covered by the above sections, have general inquiries, or any other needs, ask in this Channel | Source: https://docs.sansar.com/safety/reporting-issues-and-bugs --- # Guidelines > Community Standards, and the content, world publishing, store, event and Discord guidelines, plus the Creative Commons notice. Sansar's binding policies include the legal pages on sansar.com, such as the [Terms of Service](https://www.sansar.com/legal/terms-of-service), [Community Standards](https://www.sansar.com/legal/community-standards), and [Content Guidelines](https://www.sansar.com/legal/content-guidelines). The [Store listing guidelines](/guidelines/store-listing-guidelines) and [Store banner guidelines](/guidelines/store-banner-guidelines) are also part of the Terms of Service. This section covers the rules for participating in the community and for publishing worlds, events, and Store listings. Read the relevant guidelines before you publish. - [Content guidelines](/guidelines/content-guidelines) - [World publishing guidelines](/guidelines/world-publishing-guidelines) - [Store listing guidelines](/guidelines/store-listing-guidelines) - [Store banner guidelines](/guidelines/store-banner-guidelines) - [Event guidelines](/guidelines/event-guidelines) - [Sansar's Discord server rules](/guidelines/discord-server-rules) - [Creative Commons License](/guidelines/creative-commons-license) ## See also - [Community Standards ↗](https://www.sansar.com/legal/community-standards) - [Terms of Service ↗](https://www.sansar.com/legal/terms-of-service) - [Privacy Policy ↗](https://www.sansar.com/legal/privacy) Source: https://docs.sansar.com/guidelines --- # Content guidelines
Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines) apply to anyone who creates, shares, or encounters content in Sansar, including Store sellers and event and world creators. The policy covers legality, rights and authorization, hate and harm, graphic and sexual material, getting around restrictions, and reporting abuse. ## Official policies Read the current policy text on sansar.com: - [Content Guidelines](https://www.sansar.com/legal/content-guidelines) - [Community Standards](https://www.sansar.com/legal/community-standards) - [IP Policy](https://www.sansar.com/legal/ip-policy) - [Terms of Service](https://www.sansar.com/legal/terms-of-service)
## Report abuse To report content or experiences that break the Content Guidelines, use the [Sansar Discord](https://discord.com/invite/sansarofficial). To report abusive content in Sansar, see [Reporting abuse](/safety/reporting-abuse). To report a profile or Store listing on the website, see [Report a profile or Store listing on sansar.com](/safety/report-on-sansar-com). Source: https://docs.sansar.com/guidelines/content-guidelines --- # World publishing guidelines ## World publishing guidelines You must follow these guidelines when publishing worlds. They help you publish worlds clearly so users can find what they are looking for.
All published worlds must follow Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines). Published worlds must not: - Be empty or an unedited template world. - Contain references to Sansar, Sansar Inc., or Sansar-related terminology that may imply a false relationship with, or sponsorship, endorsement, or employment by, Sansar. These requirements apply to all text associated with worlds: - Only alphanumeric and basic punctuation characters, such as commas, periods, slashes, colons, dashes, underscores, and quotation marks, are allowed. Sansar does not support international and other special characters at this time. - Senseless or excessively repetitive use of characters, in Sansar's sole discretion, is prohibited. - Avoid replacing letters with special characters or numbers (for example, replacing "A" with "@" or "I" with "1") so your world is easy to find in search results. - There should be no leading, trailing, or creeping whitespace. - Control characters and line feeds are not allowed. - References and links to external websites or stores are not allowed. ## World name Each world name must: - Be 100 characters or fewer, including spaces. - Be clear and accurate so users can find your world. - Contain specific descriptions instead of general terms (for example, use "The Witch's House" or "Kit's House" instead of "House"). - Contain spaces between words. ## World description Each world description must: - Be 1,023 characters or fewer, including spaces. - Describe the world clearly, honestly, and accurately. Keyword spamming is strictly prohibited. - Not contain leading, trailing, or creeping whitespace; paragraphs are allowed. ## World image ## Image file requirements Each image file must: - Be in PNG format. - Have a 16:9 aspect ratio. - Not exceed 10 MB. - Be between 480 × 270 pixels (minimum) and 1920 × 1080 pixels (maximum). ## Image content guidelines Images must: - Accurately represent the world and not be misleading. - Not include the Sansar logo, user interface, or other controls. - Not imply a false relationship with, or sponsorship, endorsement, or creation by, Sansar. - Not contain links. Images also: - Should make your world stand out. We recommend bright colors, interesting angles, and similar details to make your world attractive. - Should be taken from within the world. - May contain text, but do not make text the focus of your image. - Should not use excessive borders, watermarks, logos, or inset images. Source: https://docs.sansar.com/guidelines/world-publishing-guidelines --- # Store listing guidelines ## Store listing guidelines To help promote an enjoyable experience, you must follow these guidelines when listing items on the Sansar Store (the "Store"). They help you list items effectively so buyers can find what they are looking for. To learn how to list and edit items, see [Selling Items in Sansar Store](/store/selling/manage-listings). For branding banners, see [Store banner guidelines](/guidelines/store-banner-guidelines). ## General item guidelines - All items listed in the Store must follow Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines). - Items must not contain references to Sansar, Sansar Inc., or Sansar-related terminology that may imply a false relationship with, or sponsorship, endorsement, or employment by, Sansar. These requirements apply to all text associated with item listings: - Only alphanumeric and basic punctuation characters, such as commas, periods, slashes, colons, dashes, underscores, and quotation marks, are allowed. Sansar does not support international characters at this time. - Senseless or excessively repetitive use of characters, in Sansar's sole discretion, is prohibited. - Avoid replacing letters with special characters or numbers (for example, replacing "A" with "@" or "I" with "1") so your item is easy to find in search results. - There should be no leading, trailing, or creeping whitespace. - Control characters and line feeds are not allowed. ## Listing guidelines ## Item name **Item Name** is the name buyers see in their inventory. You can edit it in the listing editor. The **Item Name**: - Must be 100 characters or fewer, including spaces. - Must be clear and accurate so buyers can find your item in their inventory. - Must contain alphanumeric characters and cannot consist solely of special characters. - Should avoid long strings of text. Long item names truncate after two rows in inventory. ## Listing title **Listing title** is the name that appears in the Store, on your listings page, and on a buyer's purchase list. The **Listing title** must: - Be 100 characters or fewer, including spaces. - Be clear and accurate so buyers can find your item in the Store. - Contain alphanumeric characters (it cannot consist of special characters only). - Not use underscores or symbols in place of spaces. Use spaces between words as much as possible so people can search for your items. ## Category Only 3D models and audio items have an editable **Category** in the listing editor. For all other item types, Sansar sets the category automatically. If you can change the category, you must select the available category that best identifies your item. Only accessories can be added as wearables at this time. To upload and list accessories, see [Importing Accessories](/avatars/import/importing-accessories). ## Description The **Description** must: - Be 10,000 characters or fewer, including spaces. - Describe the item clearly, honestly, and accurately. - Not contain marketing text or links to websites outside Sansar (whether associated with the item or not), except for links to informational pages such as script documentation or tutorials. - Marketing text and links pointing to items and experiences within Sansar are allowed. - Avoid tactics such as item or keyword spamming that make it hard for buyers to find what they are searching for. ## Tags **Tags** are optional and help people discover your listing. You can add up to five tags. The listing editor separates tags at whitespace (such as spaces) and converts them to lowercase. Tags: - Must be 40 characters or fewer per tag. - May contain alphanumeric characters and hyphens only, and cannot start or end with a hyphen. - Must describe the item clearly, honestly, and accurately. - May contain branded tags. Avoid tactics such as item or keyword spamming unrelated to the item. ## Price The **Price** for each item must: - Be listed in Sansar Dollars (S$) only. - Not exceed a selling price of S$1,000,000. For setting prices and minimum prices for resellable components, see [Selling Items in Sansar Store](/store/selling/manage-listings). For conversion rates, limits, and payout fees, see [Cash out your earnings](/sansar-dollars/withdraw#limits-and-fees). ## Image guidelines ## General image guidelines All images: - Must accurately represent the item. - Must be in PNG format. - Must be up to 10 MB in size. - Must be at least 600 × 600 pixels. You cannot delete the last image of a public listing; hide or unlist the item first. ## Main image requirements The main image for **all types of items**: - Must focus on showcasing the item for sale. As much as possible, avoid featuring extra items or parts that are not included in the item for sale. - Must not contain the Sansar user interface or other controls. - Must not contain added text. - Should use a background where the item clearly stands out. - You may take images in Sansar using the [screenshot app](/explore/share/taking-a-photo). - Images may use a transparent or solid-colored background. The main image for **objects**: - Must show the full item. The main image for **avatar attachments (Wearables)**: - Must show the full item. - May use Sansar avatars to showcase the accessory item. The main image for **avatars (custom avatars)**: - Must clearly showcase the avatar body. The main image for **skyboxes**: - Must feature a substantial representation of the actual skybox texture. - Must not use icons in place of the texture representation. The main image for **scripts**: - Must focus on showcasing the script's capabilities. We strongly recommend taking a screenshot of the script as applied within a scene or experience. - Must not contain text or symbols, except those that help define scripts (for example, C#, Script, or \). - May use script icons. The main image for **audio**: - Should use an image that represents or conveys the audio. - May use audio or sound icons. ## Additional image requirements Additional images are optional. You can upload up to nine additional images to supplement the main image by showing the item in use or highlighting details not visible in the main image. Suggestions by item type: Additional images for **objects** may: - Show different angles of the item. - Show the item in use. - Highlight the scale of the item. Additional images for **avatar attachments (Wearables)** may: - Show different angles of the item. - Show the item from different angles on an avatar. Additional images for **skyboxes** may: - Show the skybox from different angles. - Include screenshots of an experience with the skybox in the background. Additional images for **scripts** may: - Show the available *Script Settings* parameters for the script. Additional images for **audio**: - Ideally, audio should not have any additional images. ## Additional notes **Accessories** To upload and list accessories, see [Avatar attachments (accessories)](/avatars/import/importing-accessories). **Audio** - We strongly recommend including a detailed description of your audio listings with information such as track length and mono, stereo, or ambisonic type. **Avatars** To upload and list custom avatars, see [Importing custom avatars](/avatars/import/importing-avatar-related-items). **Objects** - Set your 3D suite's units to meters or feet, and model your assets to real-life scale. Sansar only allows limited scaling for scenes at this time. - We strongly encourage you to add a collision mesh to your objects so buyers can make them dynamic in their scenes. - If you are uploading architecture-type items, it is best to add an avatar in one of the additional images as a size reference. **Script** - Scripts should not use Restricted APIs. See [Sansar Script APIs](/scripting/api) and [Restricted APIs](/scripting/restricted-apis). ## Prohibited behavior Any of these prohibited behaviors could result in the removal of your item from the Store, account access restrictions up to and including account termination, or both. - **Listing items in the Store:** - All items listed in the Store must follow Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines). - Listed items that contain harmful content or code will not be tolerated. - **Disabled items:** - If your item has been blocked or disabled on the Store, contact the [Sansar Support team](https://discord.com/invite/sansarofficial) for help. - Do not re-list items that the Sansar team has blocked or disabled on the Store until the reported issue is resolved. - **Re-listing items in the Store:** - Do not re-list items as a new listing to get around user complaints, feedback, or ratings. - **Reviewing items:** - Be honest when reviewing items and do not include false information. - Do not use alternate accounts to rate your own items. - Buying positive user reviews for your items is strictly prohibited. Source: https://docs.sansar.com/guidelines/store-listing-guidelines --- # Store banner guidelines ## Store banner guidelines You must follow these guidelines for Store banners. ## General guidelines - Store banners must follow Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines). - Store banners must not contain references to Sansar, Sansar Inc., or Sansar-related terminology that may imply a false relationship with, or sponsorship, endorsement, or employment by, Sansar. ## Image guidelines Store banner images: - Must be in PNG, JPEG, or WebP format. - Can be up to 10 MB in size. - Should be 1180 × 300 pixels for the best fit (the uploader does not enforce dimensions). - May contain branding or username references. - May contain text, borders, watermarks, logos, or inset images. - Must not contain URL text. ## Managing your store banner Open [Manage Listings](https://www.sansar.com/store/dashboard), select the **My Store** tab, and use **Store banner** to upload, replace, or remove your banner. For full steps, see [Upload a store banner](/store/selling/manage-listings#upload-a-store-banner). Your banner saves when the upload finishes. There is no separate save button.
## Where can you find your store banner After you upload your store banner, it displays on your shop page, though it may take a moment to appear. Buyers can open your shop page by selecting your name on a Store listing. Source: https://docs.sansar.com/guidelines/store-banner-guidelines --- # Event guidelines ## Event guidelines You must follow these guidelines when publishing events (each an "**event**") in Sansar. They help you publish events clearly so users can find what they are looking for. If you do not follow these guidelines, your event listing may be removed. ## 1.0 Event content **1.1** All events must follow Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines). Any event that violates the Content Guidelines will be taken down. **1.2** All event attendees, whether hosts or guests, are subject to Sansar's [Community Standards](https://www.sansar.com/legal/community-standards). Any user who violates the Community Standards will be subject to account suspension or termination. **1.3** To request permission to use Sansar trademarks or logos, including Sansar or Sansar Inc., contact Sansar through [Contact Us](https://www.sansar.com/contact-us) before using them. To report trademark or other intellectual property infringement, see Sansar's [IP Policy](https://www.sansar.com/legal/ip-policy). ## 2.0 Event name **2.1** Event names are key to attracting attendees. Event names must be clear and accurate so users can find and understand your event. **2.2** Event names are not unique in Sansar. You may use the same event name as another event creator. **2.3** Event names must be 3 to 100 characters long, including spaces. **2.4** Event names should be reasonable in length and format. **2.4.a** Use spaces between words when possible. Long strings of text with no spaces may be cut off. **2.4.b** Use only one space between words. Do not include leading, trailing, or creeping whitespace. **2.4.c** Avoid replacing letters with special characters or numbers (for example, replacing "A" with "@" or "I" with "1") so people can find your events. **2.4.d** Use alphanumeric and basic punctuation characters only, such as commas, periods, slashes, colons, dashes, underscores, and quotation marks. Sansar does not support international characters at this time. **2.4.e** Excessively repetitive use of characters for decorative or non-essential purposes, as determined in Sansar's sole discretion, is prohibited. For example, do not use event names such as "\~/\~Sansar Top 5 ~~/~~" or "--!!! Sansar Top 5 !!!--". ## 3.0 Event description **3.1** Event descriptions must describe the event clearly, honestly, and accurately so users have a clear understanding of the event. **3.2** You may add keywords to the event description. Keyword spamming is strictly prohibited. **3.3** Event descriptions must be 1,023 characters or fewer, including spaces. **3.4** You may add references and links to other Sansar pages if they are related to the event. **3.5** You may add external references and links outside Sansar-related properties in the event description if they relate to the event's content. Events are subject to removal from the Events Calendar, in Sansar's sole discretion, if they contain links or references to: - Irrelevant websites - Direct downloads - Competing product pages - Content that violates Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines) ## 4.0 Event location **4.1** Each event must have a designated location. Currently, you can choose only from worlds you own, whether published or hidden. At times, the Sansar team and other users may conduct events in another user's world. **4.2** Selected worlds must have a world image. If you want to use a world with no image, add one first in the world's publishing options. World images are subject to separate image guidelines from event images; see [World image](/guidelines/world-publishing-guidelines#world-image) in [World publishing guidelines](/guidelines/world-publishing-guidelines). **4.3** An event's access control is currently tied to the world's access control. To restrict access to an event or ban someone from it, use the world's [Publishing options](/create/worlds/publishing-options-for-experiences). ## 5.0 Event image **5.1** All events must have an image that represents the event. As the event creator, you can choose the world image or upload your own. **5.2** Event images must not contain any prohibited content under Sansar's [Content Guidelines](https://www.sansar.com/legal/content-guidelines). Event images that violate the Content Guidelines will be taken down. **5.3** All event images must meet these file requirements: **5.3.a** Event images must be in PNG format. **5.3.b** Event images must have a 16:9 aspect ratio. **5.3.c** Event images must not exceed 10 MB. **5.3.d** Event images must be between 480 × 270 pixels (minimum) and 1920 × 1080 pixels (maximum). **5.4** Sansar has separate image guidelines for events, worlds, and Store items. If you use a world's image for an event listing, see [World image](/guidelines/world-publishing-guidelines#world-image) in [World publishing guidelines](/guidelines/world-publishing-guidelines). If you upload a new image for the event, it must meet these rules: **5.4.a** Uploaded event images must accurately represent the event and must not be misleading or deceptive. **5.4.b** Uploaded event images do not need to show the world location. Any splash or inset image used should be relevant to the event. **5.4.c** Uploaded event images should avoid a blank background and include visual imagery. **5.4.d** Uploaded event images may contain text, but it must be large and readable in VR. **5.4.e** Uploaded event images may contain logos, borders, and inset images. **5.4.f** Uploaded event images must not include the Sansar logo, user interfaces, or other controls. They also must not include other logos owned by Sansar Inc. or third parties unless you have permission or the right to use or display them. ## 6.0 Event time **6.1** The event must have a defined date, start time, and duration. **Effective: September 10, 2018** Source: https://docs.sansar.com/guidelines/event-guidelines --- # Sansar's Discord server rules These rules apply to the [Sansar Discord server](https://discord.com/invite/sansarofficial), in addition to Sansar's [Community Standards](https://www.sansar.com/legal/community-standards). ## Our additional Discord rules are: 1. Be nice. 2. Respect the topic for each channel. You can find channel topics in the server's #welcome channel. 3. Do not post NSFW or sexually explicit content or language. 4. Do not spam several channels with the same post. For example, if you are promoting an event, post it in *one* relevant channel. 5. If you and one other person are dominating the conversation in a channel, consider moving your conversation to Direct Messages. 6. If someone says something that annoys or offends you, report the message to the Support team **and** contact an @Admin if needed. Do not engage with them or start a flame war. Walk away. 7. Share the love and have fun. If you experience abuse, contact Support on the [Sansar Discord](https://discord.com/invite/sansarofficial) **and** contact an @Admin. ## Suspensions, temporary bans, and permanent bans Access to the Discord server is a privilege, not a right. Language and images that do not offend you may still affect others differently. **Moderators evaluate all posts based on the [Community Standards](https://www.sansar.com/legal/community-standards), [Content Guidelines](https://www.sansar.com/legal/content-guidelines), [Terms of Service](https://www.sansar.com/legal/terms-of-service), and individual channel guidelines. Punishment is at their discretion.** The general escalation path for disciplinary action is: - Warning - 3-day Discord ban - 1-week Discord ban - 2-week Discord ban - 1-month Discord ban - Permanent Discord ban This escalation path is a guideline, and severe violations are dealt with as needed. Disciplinary action for Discord server behavior may extend to in-game accounts where required. Rules are subject to change. ## Appeal a ban To appeal a ban, email [appeals@sansar.com](mailto:appeals@sansar.com). Source: https://docs.sansar.com/guidelines/discord-server-rules --- # Creative Commons License > Reuse Sansar documentation under CC BY 4.0 and credit Sansar, Inc. Unless a page says otherwise, the content on docs.sansar.com is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/deed.en) (CC BY 4.0). You can copy, share, and adapt it for any purpose, including commercial use, as long as you follow the license terms. Code examples can include their own license and copyright notice in their source headers. Those notices apply to that code. ## Give credit When you share this content or a version you changed: - Credit Sansar, Inc. - Keep the copyright notice that comes with it. The standard notice is "© Sansar, Inc." - Link to the page you used, where you reasonably can. - Name the license, CC BY 4.0, and link to it. - If you changed the content, say so. Don't suggest that Sansar endorses you or your use. For example, if you shorten and reword the Contact support page: > Adapted from Sansar, Inc. (https://docs.sansar.com/help/contact-support). © Sansar, Inc. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Changes: shortened and reworded. For the full terms, see the [CC BY 4.0 legal code](https://creativecommons.org/licenses/by/4.0/legalcode.en). ## What the license doesn't cover The license doesn't grant trademark or patent rights, including rights to Sansar's name and logos. The [Terms of Service](https://www.sansar.com/legal/terms-of-service) cover Sansar's marks. To ask for permission to use them, send a request through [Contact Us](https://www.sansar.com/contact-us). Source: https://docs.sansar.com/guidelines/creative-commons-license --- # Help > Troubleshooting and FAQs, the Sansar log and cache, error messages, contacting support, and the Using sansar.com hub. - [General FAQ](/help/general-faq) - [Error Message FAQ](/help/error-message-faq) - [The Sansar Log](/help/sansar-log) - [The Sansar Cache](/help/the-sansar-cache) - [Contact support](/help/contact-support) - [Using sansar.com](/help/using-sansar-com) ## See also - [Reporting issues and bugs](/safety/reporting-issues-and-bugs) Source: https://docs.sansar.com/help --- # General FAQ Some General problems and solutions. Related FAQs: [Error Message FAQ](/help/error-message-faq.md) | [Troubleshooting Import Errors](/create/import/troubleshooting-import-errors.md) ## A specific world keeps failing to load - Your cache may have become corrupted try clearing it by following this guide. [Clear the Cache](/help/the-sansar-cache.md#clearing-the-cache) ## I have lost/forgotten my password - Please use the forgotten password link located here: [Forgot Password](https://www.sansar.com/forgot-password) or by clicking any of the 'forgot password' buttons located at any login page. You will be asked for the email associated with the account. - For steam based accounts, the login is authenticated by steam itself requiring you to be logged into the steam account that is connected to your sansar account. - I no longer have the email, please [Contact Support](/help/contact-support.md) ## I no longer have the email associated with my account and cannot reset my password. If you are logged in on the website you should be able to change the email. If you cannot access this you will need to [Contact Support](/help/contact-support.md) Source: https://docs.sansar.com/help/general-faq --- # Error Message FAQ This page lists common Sansar error messages and troubleshooting steps. Related FAQs: [General FAQ](/help/general-faq.md) | [Troubleshooting Import Errors](/create/import/troubleshooting-import-errors.md) ## Visiting worlds ### Could not visit world due to the error: unable to connect to regionserver Solution: VPN and connection issues, try restarting the client or your router. --- ### Could not visit this world because all instances are full. Solution: Wait and try again later, or join a different instance if one is available. --- ### Could not visit this world because the specified instance is full. Solution: Retry without targeting that specific instance, or wait for space to open in that instance. --- ### Could not visit this world because the specified instance was not found. Solution: Open the world again from its listing and retry. The instance may have already closed or the instance link may no longer be valid. --- ### Sorry, this world instance is full. Please try visiting again. Solution: Wait and try visiting again later. --- ### Visit world failed because the requested world is not in the current grid. Solution: You may be on a outdated client, be sure to login to the most recent one. --- ### Visit world failed because the requested world was not found. Solution: Check that the world link is correct and that the world still exists. If it is your own world, make sure the intended scene is still linked to that world. --- ### Visit event failed because the event was not found. Solution: Open the event again from its event page and retry. The event may have ended or the link may no longer be valid. --- ### Visit world failed because the specified URI could not be parsed. Solution: Use a complete, valid Sansar world or event URL instead of a partial or malformed link. --- ### Visit world failed because the world failed to load. Solution: If this is your own world, make sure the scene is linked to the world and has been built before visiting. Then retry. --- ### Visit world failed for an unknown reason. Solution: VPN or connectivity issues, try without a VPN or connecting to a different location. --- ### Visit world failed because Sansar was in the wrong state. Solution: Try again, ## Edit mode and scene editing ### Edit server is already occupied Solution: Usually after a crash, waiting some time 15 - 30 mins, will resolve on its own, if not support may need to intervene. ---
### There was an error saving the file. Solution: Make sure you have disc space. --- ### Unable to save scene: Please close the material editor before saving your scene. Solution: Close the Material Editor, then save the scene again. --- ### Unable to build scene: Please close the material editor before building your scene. Solution: Close the Material Editor, then build the scene again. --- ### Unable to close scene: Please close the material editor before closing your scene. Solution: Close the Material Editor first, then close the scene. --- ### Unable to extract selection: Please close the material editor before extracting selection. Solution: Close the Material Editor first, then try extracting the selection again. --- ### You can't move an object into one of its children. Solution: Choose a different parent, or move the child object back to the top level before regrouping. ## Store and inventory ### No store listing was found for that item number or URL. Solution: Enter the listing's 36-character item number or use the store listing page URL or Edit Listing page URL for an existing listing. --- ### You cannot change another user's store listing. Solution: Only replace or update listings that you own. If you need to sell your version, create your own listing instead. --- ### You can only update store listings for script items. Solution: Make sure you are using the replace flow on a supported item type. Script listings are updated from the scene editor, while avatar-related items are updated from the avatar editor flow. --- ### An error occurred. The item was not updated in the store. Solution: Verify that the item type is supported for listing updates, the product ID or URL is correct, and avatar-related items include a thumbnail, then retry. ## Avatar and looks ### %s is already in use. Please choose a different name. Solution: Enter a different name that is not already being used. --- ### The avatar failed to load and may be corrupted. Would you like to delete this look? Solution: Try duplicating the look. --- ### To list an item in the store, the item must have an inventory thumbnail. Please reupload the item with a thumbnail. Solution: Reupload the item with a thumbnail image before listing it. Avatar-related items need a thumbnail if you want to list or replace them in the store. --- ### This look cannot be customized because the custom avatar has been deleted from your inventory. Solution: Restore or reimport the custom avatar to your inventory, or switch that look to a different avatar. --- ### Invalid product ID or URL. Solution: Use the listing's 36-character item number, the store listing page URL, or the Edit Listing page URL. Source: https://docs.sansar.com/help/error-message-faq --- # The Sansar Log The client keeps a local running log of what you mouse over and click plus a few other basic details to help aid in figuring out what caused a crash or problem, these logs can be really helpful when needing help from support staff, No personal information is retained within the logs other than some hardware information, worlds visited during that session and your public username. most of what can be found is chatter between the client and sansar services. ## locating the log files By default the Client log files are located in C:\Users\YOURUSERNAME\AppData\Local\LindenLab\SansarClient\log or by pasteing %localappdata%\LindenLab\SansarClient\log into your file browser. The current sessions logs are held in the parent folder C:\Users\YOURUSERNAME\AppData\Local\LindenLab\SansarClient and are added to the Historic 'log' folder once your client has shutdown.

Log files locations

**NOTE: you may need to show hidden folders to find these**

Show hidden folders

## Import assets logs The importer saves error logs to a different filepath and will give you the location on the import logs tab but can be found in C:\Users\YOURUSERNAME\AppData\Local\Temp\Sansar\Import\logs or by pasteing %localappdata%\Temp\Sansar\import\logs into your file browser.

Show hidden folders

## Providing log files If asked please make a copy of your latest log files when the error occurred from the historic log folder and if the client has remained open and not crashed, your current sessions logs from the parent folder noting what ones you are providing. There are a few types of log files you are looking for including any crash files. try to find the closest files to the time of the error you can, to best help support.

Show hidden folders

Source: https://docs.sansar.com/help/sansar-log --- # The Sansar Cache ## What is the Cache? The cache is a pair of files used to speed up loading of worlds, textures, sounds and a few other things, visiting a world for the first time will add it to the cache and it will load significantly faster the next time you visit. ## Where are the cache files located? By default the cache files are located in C:\Users\YOURUSERNAME\AppData\Local\LindenLab\SansarClient or by pasting %localappdata%\LindenLab\SansarClient into your file browser you may need to enable the visibility of hidden files in the windows file browser.

Show hidden folders

you are looking for two or more files called **ClientAssetCacheLarge.bag** and **ClientAssetCacheSmall.bag** sometimes extra cache files are created and have X's at the end if you login to alternate accounts or have reached the maximum file size.

Files you can delete or remove to clear the cache

## Clearing the Cache Sometimes, certain things can corrupt the cache, such as bad internet or a failed world load. Currently, you cannot selectively clear worlds from the cache; you must clear it all or replace it with a known good cache file. Support staff may ask you to clear the cache as a go-to first solution for solving a lot of issues. If you keep a copy of them, there is no harm in trying it first, as they can be dropped back in the folder later. Once cleared you will notice things take a few minutes to load in like your avatar and inventory's on the first time after a clear. ### Automated clearing 1. Open the 'More Options' menu from the left of the screen and then click settings.

2. Click on the 'Advanced' tab at the top and then click the 'Clear' button

3. Restart the Client, the Cache will auto clear itself. ### Manually clearing 1. Close Sansar and locate the above folder; you may need to enable hidden files to find it. 2. Either delete both the **ClientAssetCacheLarge.bag** and **ClientAssetCacheSmall.bag** or move them to another location to replace them later if it didn't solve the issue, (recommended) 3. Start up Sansar and wait for everything to load; you may notice it takes a minute or two for your avatar and inventory to appear. 4. If your issue is solved you will have to rebuild your cache over time, but if the issue remains you are able to replace the files previously removed. Tip: if your cache is prone to becoming corrupted due to bad internet before loading a new world create a copy of your current known good cache files and keep them somewhere safe, if your cache becomes corrupted for any reason you can place these know good files back in to not need to start from scratch. Source: https://docs.sansar.com/help/the-sansar-cache --- # Contact support > Contact Sansar support using the Contact Us form on sansar.com, Discord, or email. Contact Sansar support using the **Contact Us** form on sansar.com, on Discord, or by email. ## Use the Contact Us form You don't need to sign in on sansar.com to submit the **Contact Us** form. 1. Open [Contact Us](https://www.sansar.com/contact-us), or select **Contact us** in the main menu on sansar.com. The **Contact Us** page displays "We're here to help! Send us your query via the form below." 2. Fill in the form fields: - **Subject** — Required, up to 200 characters (placeholder "Insert a Subject"). - **Name** — Required, up to 120 characters (placeholder "Insert your name"). - **Email** — Required valid email address, up to 254 characters (placeholder "Insert your email"). - **Phone (optional)** — Optional, up to 40 characters (placeholder "Insert your phone number"). - **Category** — Required. The menu shows "Loading categories…" while loading, then "Select a category". Select a category from the loaded list. - **Description** — Required, up to 5000 characters (placeholder "Tell us what we can help you with..."). 3. Select **Send**. **Send** stays unavailable until categories load successfully and while the form is sending (when the button changes to **Sending…**). When your message is sent, the page displays "Thank you for contacting us, someone from our team will be in touch with you soon." Select **Send another message** to return to a cleared form. ### If the form shows an error - **Categories fail to load:** The form displays "We couldn't load the contact categories, so the form can't be sent right now. Try again or email support@sansar.com." Select **Try again** to reload the categories, or email `support@sansar.com`. - **Form unavailable:** The page displays "The contact form is temporarily unavailable. Please try again later or email support@sansar.com." Wait and try again later, or email `support@sansar.com`. - **Field or rate-limit errors:** Fix any missing or invalid fields shown on the form (such as "Subject is required", "Name is required", "Please enter a valid email address", "Please select a category", or "Description is required"). If the form reports a rate limit, it displays "You've sent several messages recently. Please wait a few minutes before sending another." **Note:** Some links on sansar.com (such as demo or hosting inquiries) open the same form with a different heading, intro text, and editable suggested **Subject**. ## Via our Discord You can also ask for help on the official [Sansar Discord](https://discord.com/invite/sansarofficial). ## Via email ### General support support@sansar.com ### Appealing a ban To appeal a ban, see [Appeal a ban](/guidelines/discord-server-rules#appeal-a-ban). Source: https://docs.sansar.com/help/contact-support --- # Using sansar.com > Find the docs for each menu on sansar.com, from Worlds and the Store to your account settings. Each list below matches a menu on [sansar.com](https://www.sansar.com) and uses the website's own labels. Select an item to read its docs page. Items marked **Not documented yet** link straight to that page on sansar.com instead. Source: https://docs.sansar.com/help/using-sansar-com --- # Glossary > Every page in the Sansar docs, from A to Z. To browse by topic, start from the [home page](/) or search the docs. For help with the website itself, see [Using sansar.com](/help/using-sansar-com). Source: https://docs.sansar.com/glossary --- # Script API reference > Reference for the Sansar C# scripting API (47.10.0). Browse the namespaces to find script types and their members. See [Allowed .NET APIs](/scripting/allowed-dotnet-apis) for the .NET APIs your scripts can use. | Namespace | Types | |---|---| | [(global)](/scripting/api/global) | 1 | | [Sansar](/scripting/api/sansar) | 5 | | [Sansar.Metadata](/scripting/api/sansar.metadata) | 2 | | [Sansar.Microthreading](/scripting/api/sansar.microthreading) | 3 | | [Sansar.Script](/scripting/api/sansar.script) | 43 | | [Sansar.Script.Testing](/scripting/api/sansar.script.testing) | 2 | | [Sansar.Simulation](/scripting/api/sansar.simulation) | 117 | | [Sansar.Utility](/scripting/api/sansar.utility) | 6 | ## Types documented only in the client These types are absent from the reference assemblies that scripts compile against. Scripts may not be able to use them. | Type | Kind | Summary | |---|---|---| | [Microthread.State](/scripting/api/sansar.microthreading/microthread.state) Client documentation only | Enum | Represents possible states for a Microthread | | [Reflective.ReflectiveBase](/scripting/api/sansar.script/reflective.reflectivebase) Client documentation only | Class | Internal support class. | | [SimpleScriptEventData](/scripting/api/sansar.script/simplescripteventdata) Client documentation only | Class | Used by [`ScriptBase.PostSimpleScriptEvent`](/scripting/api/sansar.script/scriptbase#postsimplescriptevent-string-object) to send simple script events. | | [AssertionFailureException](/scripting/api/sansar.script.testing/assertionfailureexception) Client documentation only | Class | Thrown by [`Assertions`](/scripting/api/sansar.script.testing/assertions) tests. | | [SimpleScript.OnAddUserOptionsAttribute](/scripting/api/sansar.simulation/simplescript.onadduseroptionsattribute) Client documentation only | Class | Use to create additional OnAddUser subscriptions | | [SimpleScript.OnRemoveUserOptionsAttribute](/scripting/api/sansar.simulation/simplescript.onremoveuseroptionsattribute) Client documentation only | Class | Use to create additional OnRemoveUser subscriptions |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api --- # Global namespace > Types in the global namespace. Types in the global namespace. | Type | Kind | Summary | |---|---|---| | [WaitCanceledException](/scripting/api/global/waitcanceledexception) | Class | Thrown by WaitFor variants which can fail without returning data. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/global --- # WaitCanceledException Kind: Class · Namespace: · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace (global) Inherits Exception
Thrown by WaitFor variants which can fail without returning data. ```csharp public class WaitCanceledException : Exception ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Message](#message) · [Reason](#reason) | ## Properties ### Message
```csharp signature public override string Message { get; } ``` String description of the error condition.
Remarks Useful for debugging.
### Reason
```csharp signature public int Reason { get; } ``` Integer error code. The value varies depending on the method called.
Remarks See the documentation for the Subscribe method for details.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/global/waitcanceledexception --- # Sansar > Types in the Sansar namespace. Core math types for vectors, rotations, colors and numeric operations. | Type | Kind | Summary | |---|---|---| | [Color](/scripting/api/sansar/color) | Struct | The Color class holds RGBA values that define a color. | | [Mathf](/scripting/api/sansar/mathf) | Class | Floating point math constants and utilities. | | [Quaternion](/scripting/api/sansar/quaternion) | Struct | Represents a quaternion orientation. | | [Vector](/scripting/api/sansar/vector) | Struct | The Vector class represents a 3 dimensional vector. | | [VectorExtensions](/scripting/api/sansar/vectorextensions) | Class | Additional methods for Mono.Simd.Vector4f. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar --- # Sansar.Metadata > Types in the Sansar.Metadata namespace. Metadata interfaces for inspecting script types and their members. | Type | Kind | Summary | |---|---|---| | [IAssemblyMetadata](/scripting/api/sansar.metadata/iassemblymetadata) | Interface | Provides information about user assemblies. | | [IScriptMetadata](/scripting/api/sansar.metadata/iscriptmetadata) | Interface | Provides information about user scripts. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.metadata --- # IAssemblyMetadata Kind: Interface · Namespace: Sansar.Metadata · Assembly: Sansar.Script.dll · Script API 47.10.0
Interface Namespace Sansar.Metadata
Provides information about user assemblies. ```csharp public interface IAssemblyMetadata ``` ## Remarks internal use only ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AllTypes](#alltypes) · [CompilerApiVersion](#compilerapiversion) | ## Properties ### AllTypes
```csharp signature public IScriptMetadata[] AllTypes { get; } ``` Collects all script types in the assembly, sorted by name **Value:** [IScriptMetadata](/scripting/api/sansar.metadata/iscriptmetadata)\[\] — An array of all script types in the assembly
Remarks internal use only
### CompilerApiVersion
```csharp signature public Version CompilerApiVersion { get; } ``` Returns the API version the assembly was compiled against. **Value:** [Version](https://learn.microsoft.com/dotnet/api/system.version) — The API version.
Remarks internal use only

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.metadata/iassemblymetadata --- # IScriptMetadata Kind: Interface · Namespace: Sansar.Metadata · Assembly: Sansar.Script.dll · Script API 47.10.0
Interface Namespace Sansar.Metadata
Provides information about user scripts. ```csharp public interface IScriptMetadata ``` ## Remarks internal use only ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Name](#name) · [RegisterReflective](#registerreflective) · [Type](#type) | | **Methods** | [Create](#create) | ## Properties ### Name
```csharp signature public string Name { get; } ``` The full name of the script class as returned by [`Type.FullName`](https://learn.microsoft.com/dotnet/api/system.type.fullname).
Remarks internal use only
### RegisterReflective
```csharp signature public bool RegisterReflective { get; } ``` True if [`RegisterReflectiveAttribute`](/scripting/api/sansar.script/registerreflectiveattribute) is attached to this type.
Remarks internal use only
### Type
```csharp signature public Type Type { get; } ``` The type of the script.
Remarks internal use only
## Methods ### Create
```csharp signature public object Create() ``` Creates a new instance of the script. **Returns:** [object](https://learn.microsoft.com/dotnet/api/system.object) — The new script
Remarks internal use only

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.metadata/iscriptmetadata --- # Sansar.Microthreading > Types in the Sansar.Microthreading namespace. Microthread execution and state types. | Type | Kind | Summary | |---|---|---| | [ApiErrorMode](/scripting/api/sansar.microthreading/apierrormode) | Enum | The error mode of the script. | | [Microthread](/scripting/api/sansar.microthreading/microthread) | Class | Internal class used to manage scheduling of tasks | | [Microthread.State](/scripting/api/sansar.microthreading/microthread.state) Client documentation only | Enum | Represents possible states for a Microthread |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.microthreading --- # ApiErrorMode Kind: Enum · Namespace: Sansar.Microthreading · Assembly: Sansar.Script.dll · Script API 47.10.0
Enum Namespace Sansar.Microthreading Added in 37.0.0
The error mode of the script. ```csharp public enum ApiErrorMode ``` ## Values | Value | Description | |---|---| | `Default` Added in 37.0.0 | Write errors to the Script Debug Console instead of throwing exceptions for some common API errors while still throwing exceptions for the more serious errors. | | `Relaxed` Added in 37.0.0 | Write errors to the Script Debug Console instead of throwing exceptions for almost all Sansar API errors. | | `Strict` Added in 37.0.0 | Throw exceptions for almost all Sansar API errors. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.microthreading/apierrormode --- # Microthread Kind: Class · Namespace: Sansar.Microthreading · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Microthreading Inherits IDisposable
Internal class used to manage scheduling of tasks ```csharp public class Microthread : IDisposable ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [Microthread](#microthread) | | **Fields** | [ThreadState](#threadstate) | | **Methods** | [Dispose](#dispose) · [GetCurrentThreadTicks](#getcurrentthreadticks) · [ToString](#tostring) · [Yield](#yield) · [YieldCurrentThread](#yieldcurrentthread) · [YieldIfQuantaExceeded](#yieldifquantaexceeded) | ## Constructors ### Microthread
```csharp signature public Microthread() ```

No description in the API snapshot.

## Fields ### ThreadState
```csharp signature protected Microthread.State ThreadState ``` The current state of this thread.
## Methods ### Dispose
```csharp signature public virtual void Dispose() ``` Disposes resources used by this microthread.
### GetCurrentThreadTicks
```csharp signature public static long GetCurrentThreadTicks() ``` Returns the time when this thread will yield. **Returns:** [long](https://learn.microsoft.com/dotnet/api/system.int64) — The timestamp as returned by [`Stopwatch.GetTimestamp`](https://learn.microsoft.com/dotnet/api/system.diagnostics.stopwatch.gettimestamp) when this thread will yield.
### ToString
```csharp signature public override string ToString() ```

No description in the API snapshot.

### Yield
```csharp signature public void Yield() ``` Explicitly yield the current thread or coroutine.
### YieldCurrentThread
```csharp signature public static long YieldCurrentThread() ``` Explicitly yield the current thread or coroutine. **Returns:** [long](https://learn.microsoft.com/dotnet/api/system.int64) — Returns the current thread ticks as returned by [`Microthread.GetCurrentThreadTicks`](/scripting/api/sansar.microthreading/microthread#getcurrentthreadticks).
### YieldIfQuantaExceeded
```csharp signature public static void YieldIfQuantaExceeded() ``` Conditionally yields if the thread has exceeded its given runtime.
```csharp signature public static long YieldIfQuantaExceeded(long ticks) ``` Conditionally yields if the thread has exceeded its given runtime. | Parameter | Type | Description | |---|---|---| | `ticks` | [long](https://learn.microsoft.com/dotnet/api/system.int64) | | **Returns:** [long](https://learn.microsoft.com/dotnet/api/system.int64)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.microthreading/microthread --- # Microthread.State Kind: Enum · Namespace: Sansar.Microthreading · Assembly: Sansar.Script.dll · Script API 47.10.0
Enum Namespace Sansar.Microthreading

This type is documented in the client, but it is not in the reference assemblies that scripts compile against. Scripts may not be able to use it.

Represents possible states for a Microthread ```csharp protected enum Microthread.State ``` ## Values | Value | Description | |---|---| | `Idle` | The thread id active but waiting on events. | | `Running` | The thread is in a running state. | | `ThreadError` | An unhandled exception or other non-recoverable error has occurred and the thread will not be run. | ## Used in examples - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs) - [ScriptLibrary/Scene/KeyframedMotion.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/KeyframedMotion.cs) - [ScriptLibrary/Scene/Mover.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Mover.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.microthreading/microthread.state --- # Sansar.Script > Types in the Sansar.Script namespace. Script base classes, events, identifiers, logging and script configuration attributes. | Type | Kind | Summary | |---|---|---| | [AddEntryAttribute](/scripting/api/sansar.script/addentryattribute) | Class | A | | [CancelData](/scripting/api/sansar.script/canceldata) | Class | The event is sent when a subscription is canceled. | | [ComponentId](/scripting/api/sansar.script/componentid) | Struct | Encapsulates a Component Id. | | [CoroutineException](/scripting/api/sansar.script/coroutineexception) | Class | An exception occurred relating to Coroutine execution. | | [DefaultScriptAttribute](/scripting/api/sansar.script/defaultscriptattribute) | Class | Tags a class to be the default selection for this script project. | | [DefaultValueAttribute](/scripting/api/sansar.script/defaultvalueattribute) | Class | Set a default value to show in the script properties field. | | [DisplayNameAttribute](/scripting/api/sansar.script/displaynameattribute) | Class | Set the name to be shown in script properties for this field. | | [EditorVisibleAttribute](/scripting/api/sansar.script/editorvisibleattribute) | Class | Explicitly set the editor visibility of a script field or class. | | [EntriesAttribute](/scripting/api/sansar.script/entriesattribute) | Class | List of entries to populate IList or IDictionary properties with. | | [ErrorModeAttribute](/scripting/api/sansar.script/errormodeattribute) | Class | Set the Api Error mode for this script. | | [EventData](/scripting/api/sansar.script/eventdata) | Class | Base class for events. | | [ICoroutine](/scripting/api/sansar.script/icoroutine) | Interface | Token representing a coroutine. | | [IEventSubscription](/scripting/api/sansar.script/ieventsubscription) | Interface | Token representing an event subscription. | | [InstanceInterface](/scripting/api/sansar.script/instanceinterface) | Class | Base class for all Sansar Script Object Oriented C\# interfaces. | | [LockedAttribute](/scripting/api/sansar.script/lockedattribute) | Class | Locks the IDictionary or IList properties so entries can not be added or removed. | | [Log](/scripting/api/sansar.script/log) | Class | The Log class handles script logging and error reporting | | [Log.Message](/scripting/api/sansar.script/log.message) | Struct | Represents a single console message. | | [LogLevel](/scripting/api/sansar.script/loglevel) | Enum | Used by [`Log`](/scripting/api/sansar.script/log) to filter messages. | | [MaxEntriesAttribute](/scripting/api/sansar.script/maxentriesattribute) | Class | Set the Maximum number of array values allowed. | | [Memory](/scripting/api/sansar.script/memory) | Class | The Memory class reports on script pool memory use. | | [Memory.SubscriptionHandler](/scripting/api/sansar.script/memory.subscriptionhandler) | Delegate | Notifies scripts about memory events. | | [MemoryData](/scripting/api/sansar.script/memorydata) | Class | Notifies scripts about memory events. | | [MemoryUseLevel](/scripting/api/sansar.script/memoryuselevel) | Enum | Used by [`Memory`](/scripting/api/sansar.script/memory) to report script memory use. | | [MinEntriesAttribute](/scripting/api/sansar.script/minentriesattribute) | Class | Set the Minimum number of array values allowed. | | [NonReflectiveAttribute](/scripting/api/sansar.script/nonreflectiveattribute) | Class | Prevents methods from being reflected using [`Reflective.AsInterface`](/scripting/api/sansar.script/reflective#asinterface). | | [ObjectId](/scripting/api/sansar.script/objectid) | Struct | Encapsulates an Object Id. | | [OperationCompleteEvent](/scripting/api/sansar.script/operationcompleteevent) | Class | Many asynchronous APIs will trigger an OperationCompleteEvent when done. | | [RangeAttribute](/scripting/api/sansar.script/rangeattribute) | Class | Specify a range of valid values for the field in script properties. | | [Reflective](/scripting/api/sansar.script/reflective) | Class | Base class which provides for simple reflection of methods through a given interface. | | [Reflective.Context](/scripting/api/sansar.script/reflective.context) | Enum | Use with [`RegisterReflectiveAttribute`](/scripting/api/sansar.script/registerreflectiveattribute) and `Reflective.Register` to specify specific access context for the registered reflective class. | | [Reflective.ReflectiveBase](/scripting/api/sansar.script/reflective.reflectivebase) Client documentation only | Class | Internal support class. | | [RegisterReflectiveAttribute](/scripting/api/sansar.script/registerreflectiveattribute) | Class | Registers this class to be found via [`ScenePrivate.FindReflective`](/scripting/api/sansar.simulation/sceneprivate#findreflective). | | [ScriptBase](/scripting/api/sansar.script/scriptbase) | Class | Base class for all scripts, has ScriptHandle accessors and coroutine utilities. | | [ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Delegate | Used to obtain notification that the operation has completed. | | [ScriptBase.ScopedLock](/scripting/api/sansar.script/scriptbase.scopedlock) | Class | Returned from [`ScriptBase.Lock`](/scripting/api/sansar.script/scriptbase#lock) for use in using statements. | | [ScriptEventData](/scripting/api/sansar.script/scripteventdata) | Class | Result of a [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective) call. | | [ScriptHandle](/scripting/api/sansar.script/scripthandle) | Class | A running script in Sansar. | | [ScriptId](/scripting/api/sansar.script/scriptid) | Struct | Encapsulates an Script Id. | | [SessionId](/scripting/api/sansar.script/sessionid) | Struct | Encapsulates a Session Id. | | [SimpleScriptEventData](/scripting/api/sansar.script/simplescripteventdata) Client documentation only | Class | Used by [`ScriptBase.PostSimpleScriptEvent`](/scripting/api/sansar.script/scriptbase#postsimplescriptevent-string-object) to send simple script events. | | [ThrottleException](/scripting/api/sansar.script/throttleexception) | Class | Thrown when a method is called too often | | [Timer](/scripting/api/sansar.script/timer) | Class | The Timer class is a static class that manages timer events for a script. | | [TooltipAttribute](/scripting/api/sansar.script/tooltipattribute) | Class | Set a helpful tooltip message to show in the editor. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script --- # Sansar.Script.Testing > Types in the Sansar.Script.Testing namespace. Assertions and exceptions for testing scripts. | Type | Kind | Summary | |---|---|---| | [AssertionFailureException](/scripting/api/sansar.script.testing/assertionfailureexception) Client documentation only | Class | Thrown by [`Assertions`](/scripting/api/sansar.script.testing/assertions) tests. | | [Assertions](/scripting/api/sansar.script.testing/assertions) | Class | Contains various test methods which throw exceptions if the conditions are false. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script.testing --- # AssertionFailureException Kind: Class · Namespace: Sansar.Script.Testing · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script.Testing Inherits Exception

This type is documented in the client, but it is not in the reference assemblies that scripts compile against. Scripts may not be able to use it.

Thrown by [`Assertions`](/scripting/api/sansar.script.testing/assertions) tests. ```csharp public class AssertionFailureException : Exception ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Message](#message) · [StackTrace](#stacktrace) | | **Methods** | [ToString](#tostring) | ## Properties ### Message
```csharp signature public override string Message { get; } ``` The exception message
### StackTrace
```csharp signature public override string StackTrace { get; } ``` The stack trace
## Methods ### ToString
```csharp signature public override string ToString() ``` Short description of the exception. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script.testing/assertionfailureexception --- # Assertions Kind: Class · Namespace: Sansar.Script.Testing · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script.Testing
Contains various test methods which throw exceptions if the conditions are false. ```csharp public static class Assertions ``` ## Remarks This class is restricted and may not be included in scripts for sale in the marketplace. All APIs are subject to change. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [LogSuccessful](#logsuccessful) | | **Methods** | [AlmostEqual](#almostequal) · [Equal](#equal) · [Fail](#fail) · [Greater](#greater) · [NotEqual](#notequal) · [NotNull](#notnull) · [Null](#null) · [NullOrMissing](#nullormissing) · [True](#true) · [Type](#type) | ## Properties ### LogSuccessful
```csharp signature public static bool LogSuccessful { get; set; } ``` Enables or disables logging of successful assertion diagnostic messages.
Remarks This can be used to trace test execution.
## Methods ### AlmostEqual
```csharp signature public static void AlmostEqual( Sansar.Quaternion a, Sansar.Quaternion b, int significantFigures, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the two Quaternions are not approximately equal. | Parameter | Type | Description | |---|---|---| | `a` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The first Quaternion to check. | | `b` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The second Quaternion to check. | | `significantFigures` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of significant digits to compare | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
```csharp signature public static void AlmostEqual( Sansar.Vector a, Sansar.Vector b, int significantFigures, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the two vectors are not approximately equal. | Parameter | Type | Description | |---|---|---| | `a` | [Sansar.Vector](/scripting/api/sansar/vector) | The first vector to check. | | `b` | [Sansar.Vector](/scripting/api/sansar/vector) | The second vector to check. | | `significantFigures` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of significant digits to compare | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
```csharp signature public static void AlmostEqual( float a, float b, int significantFigures, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the two floats are not approximately equal. | Parameter | Type | Description | |---|---|---| | `a` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The first float to check. | | `b` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The second float to check. | | `significantFigures` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of significant digits to compare | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### Equal
```csharp signature public static void Equal( T a, T b, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) where T : IComparable ``` Throws an exception if the passed objects do not compare as equal via [`IComparable.CompareTo`](https://learn.microsoft.com/dotnet/api/system.icomparable.compareto). Will NOT throw if both objects are null. | Parameter | Type | Description | |---|---|---| | `a` | T | The first object to check. | | `b` | T | The second object to check. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler | **Type parameters:** `T`: The type of the objects.
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### Fail
```csharp signature public static void Fail( string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception always. | Parameter | Type | Description | |---|---|---| | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### Greater
```csharp signature public static void Greater( T a, T b, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) where T : IComparable ``` Throws an exception if the first object does not compare as greater via [`IComparable.CompareTo`](https://learn.microsoft.com/dotnet/api/system.icomparable.compareto). | Parameter | Type | Description | |---|---|---| | `a` | T | The first object to check. | | `b` | T | The second object to check. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler | **Type parameters:** `T`: The type of the objects.
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### NotEqual
```csharp signature public static void NotEqual( T a, T b, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) where T : IComparable ``` Throws an exception if the passed objects compare as equal via [`IComparable.CompareTo`](https://learn.microsoft.com/dotnet/api/system.icomparable.compareto). | Parameter | Type | Description | |---|---|---| | `a` | T | The first object to check. | | `b` | T | The second object to check. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler | **Type parameters:** `T`: The type of the objects.
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### NotNull
```csharp signature public static void NotNull( object val, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the passed argument is not null. | Parameter | Type | Description | |---|---|---| | `val` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The value that must be null. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### Null
```csharp signature public static void Null( object val, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the passed argument is not null. | Parameter | Type | Description | |---|---|---| | `val` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The value that must be null. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### NullOrMissing
```csharp signature public static void NullOrMissing( string message, string contents, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the message is non-null and contains the contents substring. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to check. | | `contents` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A substring to check. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### True
```csharp signature public static void True( bool val, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the passed argument is false. | Parameter | Type | Description | |---|---|---| | `val` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The value that must be true. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
### Type
```csharp signature public static void Type( string typename, object obj, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the [`Type.FullName`](https://learn.microsoft.com/dotnet/api/system.type.fullname) of the passed object does not match the passed typename. | Parameter | Type | Description | |---|---|---| | `typename` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The expected typename. | | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object to check. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler |
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.
```csharp signature public static void Type( object obj, string diagnostic, [System.Runtime.CompilerServices.CallerMemberName] string memberName, [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath, [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber ) ``` Throws an exception if the passed type is not of the same type as the type param or if the obj is null. | Parameter | Type | Description | |---|---|---| | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object to check. | | `diagnostic` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional string to show with a faulure exception. | | `memberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceFilePath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | generated by the compiler | | `sourceLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | generated by the compiler | **Type parameters:** `T`: The type to confirm.
Remarks The method is restricted. The method is subject to change or removal at any time and may not be included in scripts for sale in the marketplace.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script.testing/assertions --- # AddEntryAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
A ```csharp [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=true)] public class AddEntryAttribute : Attribute ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [AddEntryAttribute](#addentryattribute) | ## Constructors ### AddEntryAttribute
```csharp signature public AddEntryAttribute(object entry) ``` Add an entry to the initial values in the parameter for IList and IDictionary | Parameter | Type | Description | |---|---|---| | `entry` | [object](https://learn.microsoft.com/dotnet/api/system.object) | IDictionary: the key of the entry. IList: the default value of the entry. |
Remarks For IDictionary sets the key only, with no default value. For IList sets the default value of the entry. Has no effect for other parameter types.
```csharp signature public AddEntryAttribute(string key, object value) ``` Add an entry to the initial values in the parameter for IList and IDictionary | Parameter | Type | Description | |---|---|---| | `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | IDictionary: the key of the entry. IList: the default value. | | `value` | [object](https://learn.microsoft.com/dotnet/api/system.object) | IDictionary: the default value of the entry. IList: ignored |
Remarks For IDictionary sets both a key and a default value for that key. For IList the value is ignored. Has no effect for other parameter types. Can be used multiple times to add multiple entries for IDictionary

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/addentryattribute --- # CancelData Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits EventData
The event is sent when a subscription is canceled. ```csharp public class CancelData : EventData ``` ## Remarks Coroutines in a WaitFor will capture this event and throw [`WaitCanceledException`](/scripting/api/global/waitcanceledexception). ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Message](#message) · [Reason](#reason) | ## Properties ### Message
```csharp signature public string Message { get; } ``` String description of the error condition. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The error message string.
Remarks Useful for debugging.
### Reason
```csharp signature public int Reason { get; } ``` Integer error code. The value varies depending on the method called. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Error message int reason.
Remarks See the documentation for the Subscribe method for details.
## Used in examples - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/canceldata --- # ComponentId Kind: Struct · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar.Script
Encapsulates a Component Id. ```csharp public struct ComponentId ``` ## Remarks The ComponentId is a unique identifier for a component. An [`ObjectId`](/scripting/api/sansar.script/objectid) can be derived from a ComponentId. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Invalid](#invalid) | | **Properties** | [ObjectId](#objectid) | | **Methods** | [Equals](#equals) · [GetHashCode](#gethashcode) · [ToString](#tostring) | | **Operators** | [op\_Equality](#op_equality) · [op\_Implicit](#op_implicit) · [op\_Inequality](#op_inequality) | ## Fields ### Invalid
```csharp signature public static readonly ComponentId Invalid ``` The invalid id object.
Remarks This value is used by certain APIs to represent an invalid ComponentId.
## Properties ### ObjectId
```csharp signature public ObjectId ObjectId { get; } ``` Retrieves the [`ObjectId`](/scripting/api/sansar.script/objectid) associated with this ComponentId. **Value:** [ObjectId](/scripting/api/sansar.script/objectid) — The is exactly 1 ObjectId associated with each ComponentId.
Remarks The ObjectId returned will be valid if the ComponentId is valid. An [`ComponentId.Invalid`](/scripting/api/sansar.script/componentid#invalid) ComponentId will return [`ObjectId.Invalid`](/scripting/api/sansar.script/objectid#invalid).
## Methods ### Equals
```csharp signature public override bool Equals(object obj) ``` Value comparison for ComponentId. | Parameter | Type | Description | |---|---|---| | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the argument is a ComponentId and has the same value.
Remarks This method overrides [`ValueType.Equals`](https://learn.microsoft.com/dotnet/api/system.valuetype.equals).
### GetHashCode
```csharp signature public override int GetHashCode() ``` Retrieves the hash code for this instance. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The hash code for this instance.
Remarks This method overrides [`ValueType.GetHashCode`](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode).
### ToString
```csharp signature public override string ToString() ``` Converts the id to a hexadecimal string representation. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The hexadecimal string representation.
Remarks This method overrides [`Object.ToString`](https://learn.microsoft.com/dotnet/api/system.object.tostring).
## Operators ### op_Equality
```csharp signature public static bool operator ==(ComponentId a, ComponentId b) ``` ComponentId equality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ComponentId](/scripting/api/sansar.script/componentid) | First ComponentId to compare. | | `b` | [ComponentId](/scripting/api/sansar.script/componentid) | Second ComponentId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ComponentIds have the same value.
Remarks This is a value comparison.
### op_Implicit
```csharp signature public static implicit operator ComponentId(ulong id) ``` Internal explicit conversion from a ulong. | Parameter | Type | Description | |---|---|---| | `id` | [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | A ulong representation of an ComponentId | **Returns:** [ComponentId](/scripting/api/sansar.script/componentid) — A new ComponentId initialized with the given ulong.
Remarks Internal.
### op_Inequality
```csharp signature public static bool operator !=(ComponentId a, ComponentId b) ``` ComponentId inequality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ComponentId](/scripting/api/sansar.script/componentid) | First ComponentId to compare. | | `b` | [ComponentId](/scripting/api/sansar.script/componentid) | Second ComponentId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ComponentIds have a different value.
Remarks This is a value comparison.
## Used in examples - [RandomMovement.cs](/scripting/examples/random-movement) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs) - [ScriptLibrary/Scene/Interaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Interaction.cs) - [ScriptLibrary/Scene/PositionReset.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/PositionReset.cs) - [ScriptLibrary/ScriptWatcher.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/ScriptWatcher.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/componentid --- # CoroutineException Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Exception
An exception occurred relating to Coroutine execution. ```csharp public class CoroutineException : Exception ``` ## Remarks This exception is thrown when a coroutine method is called outside of a coroutine context (i.e. in a method that was not started with `ScriptBase.StartCoroutine`) or attempting to use the context of another script.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/coroutineexception --- # DefaultScriptAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Tags a class to be the default selection for this script project. ```csharp [System.AttributeUsage(System.AttributeTargets.Class)] public class DefaultScriptAttribute : Attribute ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [DefaultScriptAttribute](#defaultscriptattribute) | ## Constructors ### DefaultScriptAttribute
```csharp signature public DefaultScriptAttribute() ```

No description in the API snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/defaultscriptattribute --- # DefaultValueAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Set a default value to show in the script properties field. ```csharp [System.AttributeUsage(System.AttributeTargets.Field)] public class DefaultValueAttribute : Attribute ``` ## Remarks Unless specified by this attribute all fields shown in script properties are initialized to the default value for their type (usually 0 or empty string equivalents.). Note that Vector and Quaternions require an appropriately formatted string to work correctly. Vectors start with '<', have 3 or 4 numerical elements seperated by commas, and end with '>'. Quaternions start with '\[', have 4 numerical elements seperated by commas, and end with '\]' ## Example ```csharp [DefaultValue("Default Event")] public string MyString = null; [DefaultValue(12.34)] public float MyFloat = 1; [DefaultValue("<1.2,3.4,5.6>")] public Sansar.Vector MyVector; [DefaultValue("[1.2,3.4,5.6,7.8]")] public Sansar.Quaternion MyQuaternion; [DefaultValue("(1.2,3.4,5.6,7.8)")] public Sansar.Color MyColor; [DefaultValue(true)] public bool MyBool; [DefaultValue(2)] [Range(-20, 5)] public int myInt; ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [DefaultValueAttribute](#defaultvalueattribute) | ## Constructors ### DefaultValueAttribute
```csharp signature public DefaultValueAttribute(bool value) ``` Set a default bool value to show in the script properties for this field. Without the DefaultValue attribute bools default to 'false'. | Parameter | Type | Description | |---|---|---| | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The default boolvalue to show in script properties. |
Example ```csharp [DefaultValue(true)] public bool MyBool; ```
```csharp signature public DefaultValueAttribute(byte value) ``` Set a default byte value to show in the script properties for this field. Without the DefaultValue attribute bytes default to 0. | Parameter | Type | Description | |---|---|---| | `value` | [byte](https://learn.microsoft.com/dotnet/api/system.byte) | The default byte value to show in script properties. |
Example ```csharp [DefaultValue(0x00C9)] public byte MyField; ```
```csharp signature public DefaultValueAttribute(double value) ``` Set a default double value to show in the script properties for this field. Without the DefaultValue attribute doubles default to 0.0. | Parameter | Type | Description | |---|---|---| | `value` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The default double value to show in script properties. |
Remarks Script properties only support floats, this constructor is provided for convenience and values will be converted to floats.
Example ```csharp [DefaultValue(12.34)] public double MyField; ```
```csharp signature public DefaultValueAttribute(params double[] value) ``` Set a default double value to show in the script properties for this field. Without the DefaultValue attribute doubles default to 0.0. | Parameter | Type | Description | |---|---|---| | `value` | [double](https://learn.microsoft.com/dotnet/api/system.double)\[\] | The default double value to show in script properties. |
Remarks Script properties only support floats, this constructor is provided for convenience and values will be converted to floats.
Example ```csharp [DefaultValue(1.3, 2.4, 3.5)] public Vector MyField; ```
```csharp signature public DefaultValueAttribute(short value) ``` Set a default short value to show in the script properties for this field. Without the DefaultValue attribute shorts default to 0. | Parameter | Type | Description | |---|---|---| | `value` | [short](https://learn.microsoft.com/dotnet/api/system.int16) | The default short value to show in script properties. |
Example ```csharp [DefaultValue(123)] public short MyField; ```
```csharp signature public DefaultValueAttribute(int value) ``` Set a default int value to show in the script properties for this field. Without the DefaultValue attribute ints default to 0. | Parameter | Type | Description | |---|---|---| | `value` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The default int value to show in script properties. |
Example ```csharp [DefaultValue(123)] public int MyField; ```
```csharp signature public DefaultValueAttribute(long value) ``` Set a default long value to show in the script properties for this field. Without the DefaultValue attribute longs default to 0. | Parameter | Type | Description | |---|---|---| | `value` | [long](https://learn.microsoft.com/dotnet/api/system.int64) | The default long value to show in script properties. |
Example ```csharp [DefaultValue(123)] public long MyField; ```
```csharp signature public DefaultValueAttribute(float value) ``` Set a default float value to show in the script properties for this field. Without the DefaultValue attribute floats default to 0.0. | Parameter | Type | Description | |---|---|---| | `value` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The default float value to show in script properties. |
Remarks Script properties only support up to 32bit int, this constructor is provided for convenience and values will be converted to 32bit int.
Example ```csharp [DefaultValue(12.34)] public float MyField; ```
```csharp signature public DefaultValueAttribute(string value) ``` Set a default string value to show in the script properties for this field. Without the DefaultValue attribute strings default to an empty string. | Parameter | Type | Description | |---|---|---| | `value` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The default value in string form for strings, quaternions and vector fields. |
Remarks The string DefaultValue attribute can be used to set Vector and Quaternions with an appropriately formatted string. Vectors start with '<', have 3 or 4 numerical elements seperated by commas, and end with '>'. Quaternions start with '\[', have 4 numerical elements seperated by commas, and end with '\]'
Example ```csharp [DefaultValue("Default Event")] public string MyString = null; [DefaultValue("<1.2,3.4,5.6>")] public Sansar.Vector MyVector; [DefaultValue("[1.2,3.4,5.6,7.8]")] public Sansar.Quaternion MyQuaternion; [DefaultValue("(1.2,3.4,5.6,7.8)")] public Sansar.Quaternion MyQuaternion; ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/defaultvalueattribute --- # DisplayNameAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Set the name to be shown in script properties for this field. ```csharp [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field)] public class DisplayNameAttribute : Attribute ``` ## Remarks By default the variable name is used, replacing underscores ('\_') with spaces. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [DisplayNameAttribute](#displaynameattribute) | ## Constructors ### DisplayNameAttribute
```csharp signature public DisplayNameAttribute(string name) ``` Set the name to be shown in script properties for this field. | Parameter | Type | Description | |---|---|---| | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
Remarks By default the variable name is used, replacing underscores ('\_') with spaces.
Example ```csharp [DisplayName("")] public float namedFloat; ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/displaynameattribute --- # EditorVisibleAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Explicitly set the editor visibility of a script field or class. ```csharp [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field)] public class EditorVisibleAttribute : Attribute ``` ## Remarks By default only public fields are exposed in the editor. Using this attribute, protected, private or internal fields may be exposed as well. Classes can be hidden setting this attribute to false. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [EditorVisibleAttribute](#editorvisibleattribute) | | **Properties** | [Visible](#visible) | ## Constructors ### EditorVisibleAttribute
```csharp signature public EditorVisibleAttribute() ``` Mark a non-public script field as visible in the editor.
```csharp signature public EditorVisibleAttribute(bool visible) ``` Explicitly set the visibility of a field or class | Parameter | Type | Description | |---|---|---| | `visible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | |
## Properties ### Visible
```csharp signature public bool Visible { get; set; } ``` The visibility value.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/editorvisibleattribute --- # EntriesAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
List of entries to populate IList or IDictionary properties with. ```csharp [System.AttributeUsage(System.AttributeTargets.Field)] public class EntriesAttribute : Attribute ``` ## Remarks When used with IDictionary the entries are the keys with no default values. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [EntriesAttribute](#entriesattribute) | | **Fields** | [Locked](#locked) | ## Constructors ### EntriesAttribute
```csharp signature public EntriesAttribute(params object[] entries) ``` List of entries to populate IList or IDictionary properties with. | Parameter | Type | Description | |---|---|---| | `entries` | [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] | |
Remarks When used with IDictionary the entries are the keys with no default values. When used with IList the entries are the default values. To set an IList of a specific Count with no default values use [`MinEntriesAttribute`](/scripting/api/sansar.script/minentriesattribute) Has no effect on other parameter types. For [`Vector`](/scripting/api/sansar/vector), [`Quaternion`](/scripting/api/sansar/quaternion), and [`Color`](/scripting/api/sansar/color)s in IList their default values must be specified in string form.
Example ```csharp [Entries("King", "Queen", "Rook", "Bishop", "Knight", "Pawn")] public IDictionary GamePieces; [Entries("<1,2,3>", "<2.5,3.6,4.6>")] public IList GamePieces; ```
## Fields ### Locked
```csharp signature public bool Locked ``` Locks the IDictionary or IList properties so entries can not be added or removed.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/entriesattribute --- # ErrorModeAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Set the Api Error mode for this script. ```csharp [System.AttributeUsage(System.AttributeTargets.Class)] public class ErrorModeAttribute : Attribute ``` ## Remarks Set to ApiErrorMode.Default, ApiErrorMode.Relaxed, or ApiErrorMode.Strict ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [ErrorModeAttribute](#errormodeattribute) | ## Constructors ### ErrorModeAttribute
```csharp signature public ErrorModeAttribute(Sansar.Microthreading.ApiErrorMode mode) ``` Set the Api Error mode for this script. | Parameter | Type | Description | |---|---|---| | `mode` | [Sansar.Microthreading.ApiErrorMode](/scripting/api/sansar.microthreading/apierrormode) | |
Remarks Set to ApiErrorMode.Default, ApiErrorMode.Relaxed, or ApiErrorMode.Strict

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/errormodeattribute --- # EventData Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script
Base class for events. ```csharp public class EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [ToString](#tostring) | ## Methods ### ToString
```csharp signature public override string ToString() ``` Generates a string representation of the EventData. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The EventData as a string.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/eventdata --- # ICoroutine Kind: Interface · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Interface Namespace Sansar.Script
Token representing a coroutine. ```csharp public interface ICoroutine ``` ## Remarks Manages an existing coroutine. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [IsAlive](#isalive) · [IsWaiting](#iswaiting) · [Name](#name) | | **Methods** | [Abort](#abort) · [ResetSignals](#resetsignals) · [Signal](#signal) | ## Properties ### IsAlive
```csharp signature public bool IsAlive { get; } ``` Is this coroutine is still working or waiting. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Will return false if this coroutine has completed or had Abort() called on it or thrown an exception.
### IsWaiting
```csharp signature public bool IsWaiting { get; } ``` Is the coroutine waiting. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if the coroutine is waiting for time or an event.
### Name
```csharp signature public string Name { get; set; } ``` The name of the coroutine.
Remarks By default the function name, but can be overwritten by anyone with the ICoroutine interface handle.
## Methods ### Abort
```csharp signature public void Abort() ``` Stop the coroutine
Remarks The coroutine will be deleted and will not run again.
### ResetSignals
```csharp signature public void ResetSignals() ``` Reset the signal count on a coroutine.
Remarks Will not re-sleep a coroutine that was waiting on signals.
### Signal
```csharp signature public void Signal() ``` Send a signal to the coroutine and wake it up if it is waiting for a signal.
## Used in examples - [AdvancedCoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AdvancedCoroutineExample.cs) - [ScriptLibrary/Scene/Light.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Light.cs) - [ScriptLibrary/Scene/LightOnOff.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/LightOnOff.cs) - [ScriptLibrary/Scene/Sound.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Sound.cs) - [ScriptLibrary/Scene/TimeCountdown.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/TimeCountdown.cs) - [ScriptLibrary/Scene/TimedEvents.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/TimedEvents.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/icoroutine --- # IEventSubscription Kind: Interface · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Interface Namespace Sansar.Script
Token representing an event subscription. ```csharp public interface IEventSubscription ``` ## Remarks Manages existing events. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Active](#active) | | **Methods** | [Unsubscribe](#unsubscribe) | ## Properties ### Active
```csharp signature public bool Active { get; } ``` Is this subscription is still listening for events. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Will return false if this subscription has been unsubscribed or is not persistent and an event has been generated.
## Methods ### Unsubscribe
```csharp signature public void Unsubscribe() ``` Removes this subscription.
Remarks Events which have already been queued but not sent may be generated after this call.
## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs) - [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs) - [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs) - [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs) - [ScriptLibrary/Scene/SitStand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/SitStand.cs) - [ScriptLibrary/Scene/TimedEvents.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/TimedEvents.cs) - [ScriptLibrary/Scene/Visitors.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Visitors.cs) - [TwitchEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/TwitchEventExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/ieventsubscription --- # InstanceInterface Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script
Base class for all Sansar Script Object Oriented C\# interfaces. ```csharp public class InstanceInterface ``` ## Remarks Internal. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [IsValid](#isvalid) | | **Operators** | [op\_Implicit](#op_implicit) | ## Properties ### IsValid
```csharp signature public bool IsValid { get; } ``` Whether or not this interface is valid. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this interface is valid
Remarks This function is provided for debugging and convenience only. Scripts are frequently "force yielded", which means there is still the (rare) possibility that on the line after checking IsValid the interface could become invalid. It is highly recommended to "program defensively" and wrap the use of volatile interfaces, like AgentPrivate, in try/catch blocks. Once an interface becomes invalid it will never again become valid. Attempting to call any method on an invalid interface may throw an exception.
## Operators ### op_Implicit
```csharp signature public static implicit operator IntPtr(InstanceInterface instance) ``` Internal use only. | Parameter | Type | Description | |---|---|---| | `instance` | [InstanceInterface](/scripting/api/sansar.script/instanceinterface) | | **Returns:** [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/instanceinterface --- # LockedAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Locks the IDictionary or IList properties so entries can not be added or removed. ```csharp [System.AttributeUsage(System.AttributeTargets.Field)] public class LockedAttribute : Attribute ``` ## Remarks Should be used in conjunction with [`EntriesAttribute`](/scripting/api/sansar.script/entriesattribute) or [`AddEntryAttribute`](/scripting/api/sansar.script/addentryattribute). ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [LockedAttribute](#lockedattribute) | ## Constructors ### LockedAttribute
```csharp signature public LockedAttribute() ``` Locks the IDictionary or IList properties so entries can not be added or removed.
Remarks Should be used in conjunction with [`EntriesAttribute`](/scripting/api/sansar.script/entriesattribute) or [`AddEntryAttribute`](/scripting/api/sansar.script/addentryattribute). IDictionary keys will be unchangeable and entries can not be added or removed. IList entries can not be added or removed. Will not prevent values from being modified in either case. Has no effect on other parameter types.
Example ```csharp [Locked] public IListfloatList; ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/lockedattribute --- # Log Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits InstanceInterface
The Log class handles script logging and error reporting ```csharp public class Log : InstanceInterface ``` ## Remarks A simple script for viewing the log messages might be: ## Example ```csharp title="LogExample.cs" /* (C) Linden Research, Inc. All Rights Reserved. */ using Sansar.Script; using Sansar.Simulation; public class LogExample : SceneObjectScript { public override void Init() { // Basic log message Log.Write(LogLevel.Info, "LogExample initialized"); // Log with format parameters var sampleValue = "example"; Log.Write(LogLevel.Warning, "Sample value: {0}", sampleValue); // Simulate a recoverable error to show LogLevel.Error usage. var success = TryDoWork(); if (!success) { Log.Write(LogLevel.Error, "The sample work loop reported a failure."); } } private bool TryDoWork() { // Placeholder for sample logic return false; } } ```

Source: Examples/LogExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Fields** | [ConsoleHistory](#consolehistory) · [MaximumMessageLength](#maximummessagelength) · [MaximumTagLength](#maximumtaglength) | | **Properties** | [Messages](#messages) | | **Methods** | [Clear](#clear) · [Write](#write) · [WriteDebug](#writedebug) | ## Fields ### ConsoleHistory
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public const int ConsoleHistory ``` The maximum number of messages to store on this console. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The maximum number of messages stored by the console.
### MaximumMessageLength
Added in 45.0.4
```csharp signature public const int MaximumMessageLength ``` The maximum length of a log message.
### MaximumTagLength
Added in 45.0.4
```csharp signature public const int MaximumTagLength ``` The maximum length of the log message tag.
## Properties ### Messages
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public IEnumerable Messages { get; } ``` All current log messages. **Value:** [IEnumerable<Log.Message>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — All currently stored log messages.
## Methods ### Clear
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public void Clear() ``` Clears all messages in this console.
Remarks Messages cannot be restored.
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public void Clear(LogLevel logLevel) ``` Clears all messages in this console with the given logLevel. | Parameter | Type | Description | |---|---|---| | `logLevel` | [LogLevel](/scripting/api/sansar.script/loglevel) | The LogLevel to clear from the log. Multiple loglevels can be cleared in a single cal. |
Remarks Messages cannot be restored.
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public void Clear(ScriptId scriptId) ``` Clears all messages in this console with the given ScriptId. | Parameter | Type | Description | |---|---|---| | `scriptId` | [ScriptId](/scripting/api/sansar.script/scriptid) | The ScriptId to clear from the log. |
Remarks Messages cannot be restored.
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public void Clear(string tag) ``` Clears all messages in this console with the given tag. | Parameter | Type | Description | |---|---|---| | `tag` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The tag to clear from the log. |
Remarks Messages cannot be restored.
### Write
```csharp signature public void Write(string message) ``` Writes an info message to the server log. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to be logged. |
Remarks Log messages may be throttled.
```csharp signature public void Write(LogLevel logLevel, string message) ``` Writes a message to the server log. | Parameter | Type | Description | |---|---|---| | `logLevel` | [LogLevel](/scripting/api/sansar.script/loglevel) | LogLevel of the message. | | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to be logged. |
Remarks Log messages may be throttled.
```csharp signature public void Write(string tag, string message) ``` Writes an info message to the server log. | Parameter | Type | Description | |---|---|---| | `tag` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A freeform string tag for filtering the message. | | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to be logged. |
Remarks Log messages may be throttled.
```csharp signature public void Write(LogLevel logLevel, string tag, string message) ``` Writes a message to the server log. | Parameter | Type | Description | |---|---|---| | `logLevel` | [LogLevel](/scripting/api/sansar.script/loglevel) | LogLevel of the message. | | `tag` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Tag for the message. | | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Message to log. |
Remarks Also tracks the sending script and the time. No messages are locally retained.
### WriteDebug
Added in 45.0.4
```csharp signature public void WriteDebug( string message, string tag, [System.Runtime.CompilerServices.CallerMemberName] string callerMemberName, [System.Runtime.CompilerServices.CallerLineNumber] int callerLineNumber ) ``` Writes a debug message to the server log, including caller information. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | (Optional) The message to be logged. When left empty, it will only log caller information. | | `tag` | [string](https://learn.microsoft.com/dotnet/api/system.string) | (Optional) A tag for the message. | | `callerMemberName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Automatically populated with the name of the calling member (method or property). | | `callerLineNumber` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Automatically populated with the line number in the source code where the method was called. |
Remarks Log messages may be throttled. WriteDebug(..) serves the same purpose as using Write(LogLevel.Debug, ..), while also including automatically populated caller information for debugging purposes.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/log --- # Log.Message Kind: Struct · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar.Script
Represents a single console message. ```csharp public struct Log.Message ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [LogLevel](#loglevel) · [ScriptId](#scriptid) · [Tag](#tag) · [Text](#text) · [TimeStamp](#timestamp) | | **Methods** | [ToString](#tostring) | ## Properties ### LogLevel
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] [get: System.Runtime.CompilerServices.IsReadOnly] public LogLevel LogLevel { get; } ``` Message severity for filtering. **Value:** [LogLevel](/scripting/api/sansar.script/loglevel) — The [`LogLevel`](/scripting/api/sansar.script/loglevel) of the message.
### ScriptId
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] [get: System.Runtime.CompilerServices.IsReadOnly] public ScriptId ScriptId { get; } ``` Source script id. **Value:** [ScriptId](/scripting/api/sansar.script/scriptid) — The [`ScriptId`](/scripting/api/sansar.script/scriptid) of the source of the message.
### Tag
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] [get: System.Runtime.CompilerServices.IsReadOnly] public string Tag { get; } ``` Free form tag which can be used to filter messages. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The tag of the message.
### Text
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] [get: System.Runtime.CompilerServices.IsReadOnly] public string Text { get; } ``` The text of the message. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The text of the message.
### TimeStamp
Deprecated
```csharp signature [System.Obsolete("Messages are no longer stored.", true)] public DateTime TimeStamp { get; } ``` Time the message was written. **Value:** [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) — The timestamp of the message.
## Methods ### ToString
```csharp signature public override string ToString() ``` String representation of the message. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String representation of the message.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - `ColorLutExample.cs` - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs) - [GravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/GravityExample.cs) - [MediaOverrideExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MediaOverrideExample.cs) - [MemoryExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MemoryExample.cs) …and 12 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/log.message --- # LogLevel Kind: Enum · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Enum Namespace Sansar.Script
Used by [`Log`](/scripting/api/sansar.script/log) to filter messages. ```csharp [System.Flags] public enum LogLevel ``` ## Values | Value | Description | |---|---| | `Debug` Added in 45.0.4 | Debugging messages. | | `Error` | Error messages. | | `Info` | Basic informational messages. | | `Warning` | Warning messages. | ## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [SimpleScriptExample.cs](/scripting/examples/simple-script) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [LogExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/LogExample.cs) - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs) - [ScriptLibrary/LibraryDebugger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryDebugger.cs) - [ScriptLibrary/Quest/QuestCharacter.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestCharacter.cs) …and 36 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/loglevel --- # MaxEntriesAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Set the Maximum number of array values allowed. ```csharp [System.AttributeUsage(System.AttributeTargets.Field)] public class MaxEntriesAttribute : Attribute ``` ## Remarks Defaults to 20, which is the system maximum. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [MaxEntriesAttribute](#maxentriesattribute) | ## Constructors ### MaxEntriesAttribute
```csharp signature public MaxEntriesAttribute(int maxCount) ``` Set the Maximum number of IList or IDictionary allowed. | Parameter | Type | Description | |---|---|---| | `maxCount` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | |
Remarks Defaults to 20, which is the system maximum.
Example ```csharp [MaxValues(1)] public IListfloatList; ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/maxentriesattribute --- # Memory Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits InstanceInterface
The Memory class reports on script pool memory use. ```csharp public class Memory : InstanceInterface ``` ## Remarks Memory use is tracked by groups of scripts called "pools". There are two types of pools: - Scene: The scripts attached to the scene and to objects built into the scene all share a pool that is allowed a large amount of memory. - Guests: Scripts associated with each visiting user share their own pool independent of other users. These pools are allowed a smaller amount of memory. The Policy properties will reflect the use levels for the type of pool this script is associated with. ## Example ```csharp title="MemoryExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ using System; using Sansar.Script; using Sansar.Simulation; // This example shows how to track and report on script memory use. // Memory use is tracked by "pool". There are two types of pools: // Scene: The scripts attached to the scene all share a pool that is allowed a large amount of memory // User: Scripts associated with each user share their own pool and are allowed a smaller amount of memory public class MemoryExample : SceneObjectScript { // Set the Report_Command in the object properties to the chat command used to get the memory report. [DefaultValue("/memory")] [DisplayName("Report Command")] public readonly string Report_Command = "/memory"; private MemoryUseLevel memoryLevel = MemoryUseLevel.Low; public override void Init() { //When the memory level changes, store the new memory level. // If used in a more complex script this event could be used to clear log history or otherwise reduce used memory Memory.Subscribe((data) => { memoryLevel = data.UseLevel; }); // Set a chat subscription that will call ReportMemory when anyone says the Report_Command ScenePrivate.Chat.Subscribe(0, null, (data) => { if (data.Message == Report_Command) ReportMemory(ScenePrivate.FindAgent(data.SourceId)); }); } // Reports the last recorded memory level from an event along with current Memory data. private void ReportMemory(AgentPrivate agent) { agent.SendChat(String.Format("Memory info: [{0}] {1}", memoryLevel.ToString(), Memory.ToString())); } } ```

Source: Examples/MemoryExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Properties** | [ActivityLevel](#activitylevel) · [PeakUsedBytes](#peakusedbytes) · [PolicyCritical](#policycritical) · [PolicyLimit](#policylimit) · [PolicyWarning](#policywarning) · [UsedBytes](#usedbytes) | | **Methods** | [Subscribe](#subscribe) · [ToString](#tostring) | ## Properties ### ActivityLevel
```csharp signature public float ActivityLevel { get; } ``` Current memory activity level since start of last memory counting. **Value:** [float](https://learn.microsoft.com/dotnet/api/system.single) — uint
Remarks Returns a measure of the pools memory activity since the start of the last counting run. Activity levels are 0-1: Low activity, 1-2: Medium activity, >2: High activity. Activity level is used to determine when memory counting is required with more active memory use requiring more frequent memory counting.
### PeakUsedBytes
```csharp signature public uint PeakUsedBytes { get; } ``` The highest level of memory used by the script pool. **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — uint
Remarks The peak is reset when the server resets.
### PolicyCritical
```csharp signature public uint PolicyCritical { get; } ``` Current policy Critical level of used memory by the script pool **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — uint
Remarks When the memory used in the pool passes this mark events will be sent to scripts subscribed to ScriptMemoryEvents and memory counting will become more frequent.
### PolicyLimit
```csharp signature public uint PolicyLimit { get; } ``` Current policy Limit level of used memory by the script pool **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — uint
Remarks When the memory used in the pool passes this mark events will be sent to scripts subscribed to ScriptMemoryEvents. Script pools that stay above this limit may be stopped or removed from the scene.
### PolicyWarning
```csharp signature public uint PolicyWarning { get; } ``` Current policy Warning level of used memory by the script pool **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — uint
Remarks When the memory used in the pool passes this mark events will be sent to scripts subscribed to ScriptMemoryEvents
### UsedBytes
```csharp signature public uint UsedBytes { get; } ``` Total bytes used by this script pool as of last accounting. **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — uint
Remarks Memory is counted based on script activity in the scene across all pools. [`Memory.ActivityLevel`](/scripting/api/sansar.script/memory#activitylevel)
## Methods ### Subscribe
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( Memory.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Memory Events. | Parameter | Type | Description | |---|---|---| | `callback` | [Memory.SubscriptionHandler](/scripting/api/sansar.script/memory.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public IEventSubscription Subscribe( Action callback, bool persistent ) ``` Subscribes to Memory Events. | Parameter | Type | Description | |---|---|---| | `callback` | [Action<MemoryData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MemoryExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MemoryExample.cs) - [ScriptLibrary/LibraryDebugger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryDebugger.cs) - [ScriptLibrary/ScriptWatcher.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/ScriptWatcher.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/memory --- # Memory.SubscriptionHandler Kind: Delegate · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Delegate Namespace Sansar.Script
Notifies scripts about memory events. ```csharp [System.Obsolete("Use subscription callbacks of type Action", false)] public delegate void Memory.SubscriptionHandler( uint TrackingId, MemoryUseLevel UseLevel ) ``` | Parameter | Type | Description | |---|---|---| | `TrackingId` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The id of the animation component. The id of the component generating the event. | | `UseLevel` | [MemoryUseLevel](/scripting/api/sansar.script/memoryuselevel) | The behavior name of the Animation. This name will match the subscribed event. | ## Remarks See [`Memory`](/scripting/api/sansar.script/memory).

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/memory.subscriptionhandler --- # MemoryData Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits EventData
Notifies scripts about memory events. ```csharp public class MemoryData : EventData ``` ## Remarks See [`Memory`](/scripting/api/sansar.script/memory). ## Members at a glance | Kind | Members | |---|---| | **Properties** | [TrackingId](#trackingid) · [UseLevel](#uselevel) | | **Methods** | [ToString](#tostring) | ## Properties ### TrackingId
```csharp signature public uint TrackingId { get; } ``` Internal Id of the memory tracker.
Remarks Used for routing the event.
### UseLevel
```csharp signature public MemoryUseLevel UseLevel { get; } ``` The level subscribed to.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/ScriptWatcher.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/ScriptWatcher.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/memorydata --- # MemoryUseLevel Kind: Enum · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Enum Namespace Sansar.Script
Used by [`Memory`](/scripting/api/sansar.script/memory) to report script memory use. ```csharp public enum MemoryUseLevel ``` ## Values | Value | Description | |---|---| | `Critical` | Critical memory use, nearing limit. | | `Limit` | Memory limit hit, if nothing is done scripts in this pool may be disabled. | | `Low` | Script memory use under Warning level. | | `Warning` | First warning of high memory use. | ## Used in examples - [MemoryExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MemoryExample.cs) - [ScriptLibrary/ScriptWatcher.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/ScriptWatcher.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/memoryuselevel --- # MinEntriesAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Set the Minimum number of array values allowed. ```csharp [System.AttributeUsage(System.AttributeTargets.Field)] public class MinEntriesAttribute : Attribute ``` ## Remarks Defaults to 0, allowing the array to be empty. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [MinEntriesAttribute](#minentriesattribute) | ## Constructors ### MinEntriesAttribute
```csharp signature public MinEntriesAttribute(int minCount) ``` Set the Minimum number of array values allowed. | Parameter | Type | Description | |---|---|---| | `minCount` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | |
Remarks Defaults to 0, allowing the array to be empty.
Example ```csharp [MinValues(1)] public IListfloatList; ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/minentriesattribute --- # NonReflectiveAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Prevents methods from being reflected using [`Reflective.AsInterface`](/scripting/api/sansar.script/reflective#asinterface). ```csharp [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field)] public class NonReflectiveAttribute : Attribute ``` ## Remarks This can be used at the class level to block all methods or on individual methods or properties methods ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [NonReflectiveAttribute](#nonreflectiveattribute) | ## Constructors ### NonReflectiveAttribute
```csharp signature public NonReflectiveAttribute() ``` Prevents methods from being reflected using [`Reflective.AsInterface`](/scripting/api/sansar.script/reflective#asinterface).

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/nonreflectiveattribute --- # ObjectId Kind: Struct · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar.Script
Encapsulates an Object Id. ```csharp public struct ObjectId ``` ## Remarks An ObjectId can be derived from a [`ComponentId`](/scripting/api/sansar.script/componentid). ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Invalid](#invalid) | | **Methods** | [Equals](#equals) · [GetHashCode](#gethashcode) · [ToString](#tostring) | | **Operators** | [op\_Equality](#op_equality) · [op\_Implicit](#op_implicit) · [op\_Inequality](#op_inequality) | ## Fields ### Invalid
```csharp signature public static readonly ObjectId Invalid ``` The invalid id object.
Remarks This value is used by certain APIs to represent an invalid ObjectId.
## Methods ### Equals
```csharp signature public override bool Equals(object obj) ``` Value comparison for ObjectId. | Parameter | Type | Description | |---|---|---| | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the argument is an ObjectId and has the same value.
Remarks This method overrides [`ValueType.Equals`](https://learn.microsoft.com/dotnet/api/system.valuetype.equals).
### GetHashCode
```csharp signature public override int GetHashCode() ``` Retrieves the hash code for this instance. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The hash code for this instance.
Remarks This method overrides [`ValueType.GetHashCode`](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode).
### ToString
```csharp signature public override string ToString() ``` Converts the id to a hexadecimal string representation. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The hexadecimal string representation.
Remarks This method overrides [`Object.ToString`](https://learn.microsoft.com/dotnet/api/system.object.tostring).
## Operators ### op_Equality
```csharp signature public static bool operator ==(ObjectId a, ObjectId b) ``` ObjectId equality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ObjectId](/scripting/api/sansar.script/objectid) | First ObjectId to compare. | | `b` | [ObjectId](/scripting/api/sansar.script/objectid) | Second ObjectId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ObjectIds have the same value.
Remarks This is a value comparison.
### op_Implicit
```csharp signature public static implicit operator ObjectId(uint id) ``` Internal explicit conversion from a uint. | Parameter | Type | Description | |---|---|---| | `id` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | A uint representation of an ObjectId | **Returns:** [ObjectId](/scripting/api/sansar.script/objectid) — A new ObjectId initialized with the given uint.
Remarks Internal.
### op_Inequality
```csharp signature public static bool operator !=(ObjectId a, ObjectId b) ``` ObjectId inequality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ObjectId](/scripting/api/sansar.script/objectid) | First ObjectId to compare. | | `b` | [ObjectId](/scripting/api/sansar.script/objectid) | Second ObjectId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ObjectIds have a different value.
Remarks This is a value comparison.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [StatsExample.cs](/scripting/examples/stats-example) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs) …and 28 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/objectid --- # OperationCompleteEvent Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits EventData
Many asynchronous APIs will trigger an OperationCompleteEvent when done. ```csharp public class OperationCompleteEvent : EventData ``` ## Remarks See [`RigidBodyComponent.SetPosition`](/scripting/api/sansar.simulation/rigidbodycomponent#setposition-vector-operationcomplete) ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OperationCompleteEvent](#operationcompleteevent) | | **Properties** | [Exception](#exception) · [Message](#message) · [Success](#success) | ## Constructors ### OperationCompleteEvent
```csharp signature public OperationCompleteEvent() ``` Default constructor
## Properties ### Exception
```csharp signature public Exception Exception { get; } ``` If an operation threw an exception Success will be false and the exception will be stored here.
### Message
```csharp signature public string Message { get; } ``` If Success is false, Message may contain more information about the failure. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — Information about the failure.
### Success
```csharp signature public bool Success { get; } ``` Whether or not the operation completed successfully. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the operation succeeded.
## Used in examples - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs) - [ScriptLibrary/Scene/ProgressBar.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/ProgressBar.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/operationcompleteevent --- # RangeAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Specify a range of valid values for the field in script properties. ```csharp [System.AttributeUsage(System.AttributeTargets.Field)] public class RangeAttribute : Attribute ``` ## Remarks Fields with a specified range will show in script properties with both a slider and an editable field. Values will be clamped to be within the range. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [RangeAttribute](#rangeattribute) | | **Properties** | [Max](#max) · [Min](#min) | ## Constructors ### RangeAttribute
```csharp signature public RangeAttribute() ``` Specify the allowed range of values for a field using named arguments.
Example ```csharp [Range(Min=-10.0, Max=10.0)] public float namedRangeFloat; ```
```csharp signature public RangeAttribute(double min, double max) ``` Specify the allowed range of values for a float or double field. | Parameter | Type | Description | |---|---|---| | `min` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The lower bound on the range. Default: 0.0f | | `max` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The upper bound on the range. Default: 0.0f |
Example ```csharp [Range(-10.0, 10.0)] public float namedRangeFloat; ```
```csharp signature public RangeAttribute(int min, int max) ``` Specify the allowed range of values for an int field. | Parameter | Type | Description | |---|---|---| | `min` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The lower bound on the range. Default: 0 | | `max` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The upper bound on the range. Default: 0 |
Example ```csharp [Range(-10, 10)] public int rangeInt; ```
## Properties ### Max
```csharp signature public object Max { get; set; } ``` Used with default constructor to specify the upper bound on the range. **Value:** [object](https://learn.microsoft.com/dotnet/api/system.object) — The maximum allowed value for the parameter.
Example ```csharp [Range(Min=-10.0, Max=10.0)] public float rangeFloat; ```
### Min
```csharp signature public object Min { get; set; } ``` Used with default constructor to specify the lower bound on the range. **Value:** [object](https://learn.microsoft.com/dotnet/api/system.object) — The minimum allowed value for the parameter.
Example ```csharp [Range(Min=-10.0, Max=10.0)] public float rangeFloat; ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/rangeattribute --- # Reflective Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script
Base class which provides for simple reflection of methods through a given interface. ```csharp public class Reflective ``` ## Remarks If the object already implements the interface it will return the object directly. Otherwise an facade class is created to map between public methods and properties. Two scripts which use a Reflective object to communicate via script events are below: ```csharp title="SharedStopwatchReaderExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ using Sansar.Simulation; using Sansar.Script; using System; public class ScriptEventSourceExample : SceneObjectScript { #region ResetTime // This is the event interface that this script will use. Only the public methods and properties // that will be referenced are used. public interface ResetTime { // The current start time. // The setter is not public so this script will only ask for the getter DateTime StartTime { get; } // The calculated elapsed time TimeSpan Elapsed { get; } } #endregion ResetTime #region EditorProperties [DefaultValue("request")] public readonly string requestCommand = "request"; [DefaultValue("elapsed")] public readonly string elapsedCommand = "elapsed"; [DefaultValue("reset")] public readonly string resetCommand = "reset"; [DefaultValue(3)] public readonly double resetMinutes = .2; #endregion EditorProperties #region EventHandlers private void elapsed(ScriptEventData elapsed) { if(elapsed.Data == null) { Log.Write(LogLevel.Warning, Script.ID.ToString(), "Expected non-null event data"); return; } ResetTime resetTime = elapsed.Data.AsInterface(); if(resetTime == null) { Log.Write(LogLevel.Error, Script.ID.ToString(), "Unable to create interface, check logs for missing member(s)"); return; } Log.Write(LogLevel.Info, Script.ID.ToString(), $"Elapsed time = {resetTime.Elapsed} since {resetTime.StartTime}"); } #endregion EventHandlers public override void Init() { // write this script id to the log to track messages Log.Write(LogLevel.Info, Script.ID.ToString(), nameof(ScriptEventSourceExample)); // Subscribe to elapsed messages SubscribeToScriptEvent(elapsedCommand, elapsed); // set up a timer to periodically reset the elapsed time Timer.Create(TimeSpan.FromMinutes(resetMinutes), TimeSpan.FromMinutes(resetMinutes), () => PostScriptEvent(resetCommand)); } } ```

Source: Examples/SharedStopwatchReaderExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Example ```csharp title="SharedStopwatchExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ using Sansar.Simulation; using Sansar.Script; using System; using System.Diagnostics; // This class is a simple stopwatch that can respond to requests for the current elapsed time // and resets. The elapsed time is also broadcast periodically. public class SharedStopwatchExample : SceneObjectScript { #region ResetTime // This is the event object. Setting the base class to Reflective allows access to the public // properties and methods without needing a reference to this script public class ResetTime : Reflective { // The id of the script which made the last reset request. // The setter is made internal so that our script can call // it but other scripts cannot. public ScriptId SourceScriptId { get; internal set; } // The current start time. // The setter is made internal so that our script can call // it but other scripts cannot. public long StartTime { get; internal set; } // The calculated elapsed time public TimeSpan Elapsed { get { return TimeSpan.FromTicks(Stopwatch.GetTimestamp() - StartTime); } } // The count of times the timer has been reset // The setter is made internal so that our script can call // it but other scripts cannot. public int ResetCount { get; internal set; } } #endregion ResetTime #region EditorProperties [DefaultValue("request")] public readonly string requestCommand = "request"; [DefaultValue("elapsed")] public readonly string elapsedCommand = "elapsed"; [DefaultValue("reset")] public readonly string resetCommand = "reset"; [DefaultValue(1)] public readonly double broadcastMinutes = .15; #endregion EditorProperties #region EventHandlers // Handler for the requestCommand, sends the current information back to the requesting script private void requestElapsed(ScriptEventData uptime) { sendElapsed(uptime.SourceScriptId); } // Handler for the resetCommand, resets the start time private void resetElapsed(ScriptEventData uptime) { resetElapsed(uptime.SourceScriptId); } #endregion EventHandlers #region Implementation // Object which tracks all the info we need private ResetTime resetTime = new ResetTime(); // Posts the current time information to the given script id // targetScriptId will be AllScripts for the broadcast private void sendElapsed(ScriptId targetScriptId) { PostScriptEvent(targetScriptId, elapsedCommand, resetTime); } // Resets the elapsed time and tracks the id of the script making the request private void resetElapsed(ScriptId id) { Log.Write(LogLevel.Info, Script.ID.ToString(), $"reset requested by script {id}"); resetTime.SourceScriptId = id; resetTime.StartTime = Stopwatch.GetTimestamp(); resetTime.ResetCount++; } #endregion Implementation #region Overrides public override void Init() { // write this script id to the log to track messages Log.Write(LogLevel.Info, Script.ID.ToString(), nameof(SharedStopwatchExample)); // sets the initial timer and script id to this script resetElapsed(Script.ID); // listen for direct requests for the elapsed time SubscribeToScriptEvent(requestCommand, requestElapsed); // listen for requests to reset the time SubscribeToScriptEvent(resetCommand, resetElapsed); // set up a timer that broadcasts the elapsed time Timer.Create(TimeSpan.FromMinutes(broadcastMinutes), TimeSpan.FromMinutes(broadcastMinutes), () => sendElapsed(ScriptId.AllScripts)); } #endregion Overrides } ```

Source: Examples/SharedStopwatchExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Constructors** | [Reflective](#reflective) | | **Properties** | [AllowedContexts](#allowedcontexts) · [ReflectiveContexts](#reflectivecontexts) · [ReflectiveName](#reflectivename) | | **Methods** | [AsInterface](#asinterface) · [FullInterface](#fullinterface) · [Register](#register) · [Unregister](#unregister) | ## Constructors ### Reflective
```csharp signature protected Reflective() ``` Default constructor.
## Properties ### AllowedContexts
```csharp signature protected virtual Reflective.Context AllowedContexts { get; } ``` Internal Use Only. Overridden by subclasses to return only those contexts requested which are allowed for that type of script.
Remarks Used internally to prevent visiting guest scripts from registering as 'scene level' APIs.
### ReflectiveContexts
```csharp signature [Sansar.Script.NonReflective] protected virtual Reflective.Context ReflectiveContexts { get; } ``` Override ReflectiveContexts to limit which contexts this Reflective interface is available in when registered with.
Remarks This can be used to further restrict which contexts an interface is available in. It can not be used to register for a context not allowed by the running script type. SceneObjectScript allows ScenePrivate, ScenePublic, ObjectPrivate. ObjectScript allows ObjectPrivate. Overriding this will automatically register this Reflective
### ReflectiveName
```csharp signature [Sansar.Script.NonReflective] protected virtual string ReflectiveName { get; } ``` Override ReflectiveName to change which name this class will be registered as in the Reflective system.
Remarks Defaults to GetType().FullName
## Methods ### AsInterface
```csharp signature [Sansar.Script.NonReflective] public TInterface AsInterface() where TInterface : class ``` Returns a TInterface object if one can be created, null otherwise **Type parameters:** `TInterface`: The interface describing the methods and properties desired. **Returns:** TInterface — A TInterface instance if this object is compatible. An object is compatible if it implements the interface or has public methods and properties which match TInterface.
### FullInterface
```csharp signature [Sansar.Script.NonReflective] public string FullInterface(string interfaceName) ``` Generates a string which shows all the members which can be reflected. | Parameter | Type | Description | |---|---|---| | `interfaceName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name to give the generated interface class in the output. | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The generated string. If no members can be reflected, returns the empty string
### Register
```csharp signature [Sansar.Script.NonReflective] public void Register() ``` Register this object to be found with `ScenePrivate.FindReflective`
Remarks Will register this reflective object with [`Reflective.AllowedContexts`](/scripting/api/sansar.script/reflective#allowedcontexts) if overridden, otherwise with ScenePrivate and ObjectPrivate.
### Unregister
```csharp signature [Sansar.Script.NonReflective] public void Unregister() ``` Unregister this object so it will not be found with `ScenePrivate.FindReflective`
Remarks If the Reflective object has not previously been registered nothing happens.
## Used in examples - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [CoroutineLockExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineLockExample.cs) - [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs) - [SharedStopwatchExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SharedStopwatchExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/reflective --- # Reflective.Context Kind: Enum · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Enum Namespace Sansar.Script
Use with [`RegisterReflectiveAttribute`](/scripting/api/sansar.script/registerreflectiveattribute) and `Reflective.Register` to specify specific access context for the registered reflective class. ```csharp [System.Flags] public enum Reflective.Context ``` ## Values | Value | Description | |---|---| | `All` | All contexts. | | `None` | Not discoverable via FindReflective or FindScript | | `ObjectPrivate` | Works only for running scripts, makes them findable in ObjectPrivate.FindScript and ObjectPrivate.FindScripts. | | `ScenePrivate` | Findable in ScenePrivate.FindReflective | | `ScenePublic` | Findable in ScenePublic.FindReflective | ## Used in examples - [ScriptLibrary/LibraryDebugger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryDebugger.cs) - [ScriptLibrary/Scene/Target.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Target.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/reflective.context --- # Reflective.ReflectiveBase Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script

This type is documented in the client, but it is not in the reference assemblies that scripts compile against. Scripts may not be able to use it.

Internal support class. ```csharp public class Reflective.ReflectiveBase ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [ReflectiveBase](#reflectivebase) | | **Fields** | [originalObject](#originalobject) | ## Constructors ### ReflectiveBase
```csharp signature public Reflective.ReflectiveBase() ```

No description in the API snapshot.

## Fields ### originalObject
```csharp signature protected object originalObject ``` Wrapped object.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/reflective.reflectivebase --- # RegisterReflectiveAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Registers this class to be found via [`ScenePrivate.FindReflective`](/scripting/api/sansar.simulation/sceneprivate#findreflective). ```csharp [System.AttributeUsage(System.AttributeTargets.Class)] public class RegisterReflectiveAttribute : Attribute ``` ## Remarks Every instance of a reflective object with this attribute will be automatically registered with the scene to be found by [`ScenePrivate.FindReflective`](/scripting/api/sansar.simulation/sceneprivate#findreflective). Specific instances of a Reflective class can be registered manually with [`Reflective.Register`](/scripting/api/sansar.script/reflective#register). For script objects themselves it is recommended to use this attribute to minimize race conditions between Register calls and FindReflective calls. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [RegisterReflectiveAttribute](#registerreflectiveattribute) | ## Constructors ### RegisterReflectiveAttribute
```csharp signature public RegisterReflectiveAttribute() ``` Automatically registers all instances of this class to be found with [`ScenePrivate.FindReflective`](/scripting/api/sansar.simulation/sceneprivate#findreflective) .
Remarks Every instance of a reflective object with this attribute will be automatically registered with the scene to be found by [`ScenePrivate.FindReflective`](/scripting/api/sansar.simulation/sceneprivate#findreflective). Specific instances of a Reflective class can be registered manually with [`Reflective.Register`](/scripting/api/sansar.script/reflective#register). For script objects themselves it is recommended to use this attribute to minimize race conditions between Register calls and FindReflective calls.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/registerreflectiveattribute --- # ScriptBase Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Reflective
Base class for all scripts, has ScriptHandle accessors and coroutine utilities. ```csharp public abstract class ScriptBase : Reflective ``` ## Remarks This abstract class manages shared information for all script types. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [ScriptBase](#scriptbase) | | **Properties** | [CurrentCoroutine](#currentcoroutine) · [Log](#log) · [MaxCoroutines](#maxcoroutines) · [Memory](#memory) · [PendingEventCount](#pendingeventcount) · [Script](#script) · [ScriptEventMessageIdCount](#scripteventmessageidcount) | | **Methods** | [GetAllCoroutines](#getallcoroutines) · [GetCoroutineCount](#getcoroutinecount) · [Init](#init) · [Lock](#lock) · [PostScriptEvent](#postscriptevent) · [PostSimpleScriptEvent](#postsimplescriptevent) · [ReleaseLock](#releaselock) · [SetDefaultErrorMode](#setdefaulterrormode) · [SetRelaxedErrorMode](#setrelaxederrormode) · [SetStrictErrorMode](#setstricterrormode) · [StartCoroutine](#startcoroutine) · [SubscribeToScriptEvent](#subscribetoscriptevent) · [Terminate](#terminate) · [Wait](#wait) · [WaitFor](#waitfor) · [WaitForLock](#waitforlock) · [WaitForSignal](#waitforsignal) · [Yield](#yield) | ## Constructors ### ScriptBase
```csharp signature public ScriptBase() ``` Constructor
Remarks Initializes a new instance of the ScriptBase class.
## Properties ### CurrentCoroutine
```csharp signature protected ICoroutine CurrentCoroutine { get; } ``` Gets the ICoroutine interface for the current coroutine. **Value:** [ICoroutine](/scripting/api/sansar.script/icoroutine) — The ICoroutine interface to the currently running coroutine.
### Log
```csharp signature [Sansar.Script.NonReflective] public Log Log { protected get; set; } ``` Gets the script console.
### MaxCoroutines
```csharp signature protected int MaxCoroutines { get; } ``` The maximum number of coroutines that a single script can run. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The maximum number of coroutines that a single script can run.
Remarks If GetCoroutineCount() == MaxCoroutines, no more coroutines will be started.
### Memory
```csharp signature [Sansar.Script.NonReflective] public Memory Memory { protected get; set; } ``` Memory information for the pool this script is in.
Remarks Scripts are pooled by their owner and share memory. Use this object to get events on nearing memory limits as well as get information on memory activity and use.
### PendingEventCount
```csharp signature protected int PendingEventCount { get; } ``` The number of events currently waiting to be processed. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The number of events currently waiting to be processed.
Remarks If this number grows it indicates the script is not processing events as fast as it is receiving them which will bloat memory and is generally a sign of poor performance. To remedy a situation of growing pending event count try reducing the number or rate of events the script is receiving or the amount of work done in each event.
### Script
```csharp signature [Sansar.Script.NonReflective] public ScriptHandle Script { protected get; set; } ``` Script handle to this script. **Value:** [ScriptHandle](/scripting/api/sansar.script/scripthandle) — An opaque type used by certain API methods.
### ScriptEventMessageIdCount
Deprecated
```csharp signature [System.Obsolete("No longer used as there is no longer a limited number of message ids. Obsoleted 2018-04.", true)] protected static int ScriptEventMessageIdCount { get; } ``` Obsolete **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Always returns 0
Remarks No longer used as there is no longer a limited number of message ids. Obsoleted 2018-04.
## Methods ### GetAllCoroutines
```csharp signature protected IReadOnlyList GetAllCoroutines() ``` A list of all coroutines for this script. **Returns:** [IReadOnlyList<ICoroutine>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1) — A list containing all running or waiting coroutines.
### GetCoroutineCount
```csharp signature protected int GetCoroutineCount() ``` The total number of coroutines running on this script. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The total number of coroutines running on this script.
Remarks Includes currently active and waiting coroutines, but not killed coroutines. A new list is created every time it is called with the coroutines at the time of the call. It is possible for coroutines to finish while iterating on the list which will not remove them from the list. Any finished coroutines still in the list will have IsAlive == false.
### Init
```csharp signature [Sansar.Script.NonReflective] public abstract void Init() ``` Init() is called after all interfaces have been initialized.
Remarks Override Init() to set up script subscriptions and callbacks. Any members set before Init is called (such as in a script constructor) may be overwritten before Init is called.
### Lock
```csharp signature protected IDisposable Lock(object Token) ``` Use to create a critical section with a using statement, ensuring that no other coroutines or scripts (via Reflective) may enter this code section while one coroutine or script is in it. | Parameter | Type | Description | |---|---|---| | `Token` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object controlling the lock. Recommended to be a private object member. | **Returns:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) — A ScopedLock that holds the lock and will release it in IDisposable.Dispose. **Throws** [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): Thrown if Token is null.
Remarks Use with `using` to create a critical section. If a lock is already held on Token by a different coroutine then this coroutine will wait for the lock to be released before entering the critical section. Lock is conceptually similar to the `lock` keyword.
Example ```csharp private object BalanceLock = new Object(); int Balance = 100; bool Spend(int value) { using (Lock(BalanceLock)) { if (Balance > value) { Balance -= value; return true; } return false; } } ```
### PostScriptEvent
```csharp signature protected void PostScriptEvent(string message) ``` Post the event for all scripts. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message id used to direct the event. |
```csharp signature protected void PostScriptEvent(string message, Reflective data) ``` Post the event for all scripts. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message id used to direct the event. | | `data` | [Reflective](/scripting/api/sansar.script/reflective) | The object to be post. |
```csharp signature protected void PostScriptEvent( ScriptId targetScriptId, string message, Reflective data ) ``` Post the event for the target script. | Parameter | Type | Description | |---|---|---| | `targetScriptId` | [ScriptId](/scripting/api/sansar.script/scriptid) | The id of the script to sent the event to. To broadcast the message to all subscripted scripts use [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-string-reflective). | | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message id used to direct the event. | | `data` | [Reflective](/scripting/api/sansar.script/reflective) | The object to be post. |
### PostSimpleScriptEvent
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use PostScriptEvent directly instead.", true)] protected void PostSimpleScriptEvent(string message, object data) ``` Deprecated. Use [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective) | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message id used to direct the event. | | `data` | [object](https://learn.microsoft.com/dotnet/api/system.object) | An object to send to scripts subscribed to message. |
Remarks Deprecated. Use [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective)
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use PostScriptEvent directly instead.", true)] protected void PostSimpleScriptEvent( ScriptId targetScriptId, string message, object data ) ``` Deprecated. Use [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective) | Parameter | Type | Description | |---|---|---| | `targetScriptId` | [ScriptId](/scripting/api/sansar.script/scriptid) | The id of the script to sent the event to. To broadcast the message to all subscripted scripts use [`ScriptBase.PostSimpleScriptEvent`](/scripting/api/sansar.script/scriptbase#postsimplescriptevent-string-object). | | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message id used to direct the event. | | `data` | [object](https://learn.microsoft.com/dotnet/api/system.object) | An object to send to script targetScriptId if subscribed to message. |
Remarks Deprecated. Use [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective)
### ReleaseLock
```csharp signature protected void ReleaseLock(object Token) ``` Release a lock if held. | Parameter | Type | Description | |---|---|---| | `Token` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object controlling the lock. Recommended to be a private object member. | **Throws** [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): Thrown if Token is null.
Remarks It is highly recommended to use [`ScriptBase.Lock`](/scripting/api/sansar.script/scriptbase#lock) instead. This is for advanced use only and can easily create deadlocks that stop scripts from working. Can not be used to release a lock not currently held by this coroutine.
Example ```csharp private object BalanceLock = new Object(); int Balance = 100; bool Spend(int value) { WaitForLock(BalanceLock); bool success = false; if (Balance > value) { Balance -= value; success = true; } ReleaseLock(BalanceLock); // Note that any early exit between WaitForLock and ReleaseLock fail to release the lock, creating a deadlock the next time this method is called. // For this reason it is highly recommended to instead do: using (Lock(BalanceLock)) return success; } ```
### SetDefaultErrorMode
Added in 37.0.0
```csharp signature protected void SetDefaultErrorMode() ``` Write errors to the Script Debug Console instead of throwing exceptions for some common API errors while still throwing exceptions for the more serious errors.
### SetRelaxedErrorMode
Added in 37.0.0
```csharp signature protected void SetRelaxedErrorMode() ``` Write errors to the Script Debug Console instead of throw exceptions for almost all Sansar API errors.
### SetStrictErrorMode
Added in 37.0.0
```csharp signature protected void SetStrictErrorMode() ``` Throw exceptions for almost all Sansar API errors.
### StartCoroutine
```csharp signature protected ICoroutine StartCoroutine( Action coroutine, Action handler ) ``` Starts a coroutine on the current script. | Parameter | Type | Description | |---|---|---| | `coroutine` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The coroutine to run. | | `handler` | [Action<OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | A callback to know when the coroutine has finished. | **Returns:** [ICoroutine](/scripting/api/sansar.script/icoroutine) — An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks A coroutine can call `ScriptBase.WaitFor` to block while waiting for events to return. The following three scripts acccomplish the same goal using event subscriptions and coroutines. Each script will listen for new agents to join the scene and keep track of the agents name and the time it joined. When the agent leaves, its name and the duration of its visit will be reported. Event handlers are useful when there is a well contained bit of code which can get most or all of its state from the [`EventData`](/scripting/api/sansar.script/eventdata) it receives. In this example, a separate data structure is needed to keep track of the name and join time for each agent since there could be multiple agents in the scene. ```csharp title="CoroutineExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ /* Use a coroutine to wait for event callbacks to track visitors to a scene. * For every visitor start a new coroutine to track that visitor's time. */ using System; using Sansar.Script; using Sansar.Simulation; using System.Diagnostics; // This example shows how to use coroutines to track agents entering and leaving the scene public class CoroutineExample : SceneObjectScript { public override void Init() { StartCoroutine(TrackNewUsers); } // Wait for new users and start a new coroutine to time them. private void TrackNewUsers() { // This coroutine will run for the lifetime of the script. while (true) { // Block until an add user event happens UserData data = (UserData)WaitFor(ScenePrivate.User.Subscribe, User.AddUser, SessionId.Invalid); // Start a new coroutine to track the new user // Each coroutine will run cooperatively with the others, this script, and other scripts in the system StartCoroutine(TrackUser, data.User); } } // There will be one instance of this coroutine per active user in the scene private void TrackUser(SessionId userId) { // Track joined time long joined = Stopwatch.GetTimestamp(); // Lookup the name of the agent. This is looked up now since the agent cannot be retrieved after they // leave the scene. string name = ScenePrivate.FindAgent(userId).AgentInfo.Name; // Block until the agent leaves the scene WaitFor(ScenePrivate.User.Subscribe, User.RemoveUser, userId); // Calculate elapsed time and report. TimeSpan elapsed = TimeSpan.FromTicks(Stopwatch.GetTimestamp()-joined); ScenePrivate.Chat.MessageAllUsers(string.Format("{0} was present for {0} seconds", name, elapsed.TotalSeconds)); } } ```

Source: Examples/CoroutineExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

While the amount of code is approximately the same for each, the coroutine version does not require access to any member data, simplifying the tracking by moving all the required information to stack variables. ```csharp title="CoroutineEventExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ /* Use a coroutine as an event callback to easily track visitors to a scene. * Every visitor triggers an AddUser event which will start a coroutine for that visitor. */ using System; using Sansar.Script; using Sansar.Simulation; using System.Diagnostics; // This example shows how to use coroutines and events to track agents entering and leaving the scene public class CoroutineEventExample : SceneObjectScript { public override void Init() { // Subscribe to Add User events // Events can be handled by anonymous methods ScenePrivate.User.Subscribe(User.AddUser, (UserData data) => StartCoroutine(TrackUser, data.User), true); } // There will be one instance of this coroutine per active user in the scene private void TrackUser(SessionId userId) { // Track joined time long joined = Stopwatch.GetTimestamp(); // Lookup the name of the agent. This is looked up now since the agent cannot be retrieved after they // leave the scene. string name = ScenePrivate.FindAgent(userId).AgentInfo.Name; // Block until the agent leaves the scene WaitFor(ScenePrivate.User.Subscribe, User.RemoveUser, userId); // Calculate elapsed time and report. TimeSpan elapsed = TimeSpan.FromTicks(Stopwatch.GetTimestamp()-joined); ScenePrivate.Chat.MessageAllUsers(string.Format("{0} was present for {0} seconds", name, elapsed.TotalSeconds)); } } ```

Source: Examples/CoroutineEventExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

Coroutines can be mixed with event handlers. This example uses an event handler for the new user events to start a coroutine to watch for the remove user events.
Example ```csharp title="EventExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ using System; using Sansar.Script; using Sansar.Simulation; using System.Collections.Generic; public class StarWarsVoiceover : SceneObjectScript { // PUBLIC MEMBERS ------ public SoundResource Sound; [Range(0.0, 60.0)] [DefaultValue(48.0)] public double Loudness_dB; // PRIVATE MEMBERS ------ private float ZeroDBOffset = 48.0f; private RigidBodyComponent RigidBody; private float Relative_Loudness; static private Dictionary playHandles = new Dictionary(); private void PlayOnAgent(AgentPrivate agent) { try { SessionId agentId = agent.AgentInfo.SessionId; Stop(agentId); PlaySettings playSettings = PlaySettings.PlayOnce; playSettings.Loudness = Relative_Loudness; if (agent.IsValid) { PlayHandle playHandle = agent.PlaySound(Sound, playSettings); if (playHandle != null) { playHandles.Add(agentId, playHandle); playHandle.OnFinished(() => Stop(agentId)); } } } catch (Exception e) { Log.Write(LogLevel.Warning, "Voiceover", $"Exception {e.GetType().Name} in PlayOnAgent"); } } private void Stop(SessionId id) { try { PlayHandle playing; if (playHandles.TryGetValue(id, out playing)) { playing.Stop(); playHandles.Remove(id); } } catch (Exception e) { Log.Write(LogLevel.Warning, "Voiceover", $"Exception {e.GetType().Name} while stopping a sound"); } } private void OnCollide(CollisionData data) { if (data.Phase == Sansar.Simulation.CollisionEventPhase.TriggerEnter) { try { AgentPrivate agent = ScenePrivate.FindAgent(data.HitComponentId.ObjectId); if (agent != null && agent.IsValid) PlayOnAgent(agent); } catch (Exception e) { // User left with _really_ bad timing, don't worry about it. Log.Write(LogLevel.Warning, "Voiceover", $"Exception {e.GetType().Name} in OnCollide"); } } } private void UserLeft(UserData data) { Stop(data.User); } public override void Init() { ScenePrivate.User.Subscribe(User.RemoveUser, UserLeft); // Collision events are related to the RigidBody component so we must find it. // See if this object has a RigidBodyComponent and grab the first one. if (ObjectPrivate.TryGetFirstComponent(out RigidBody)) { Relative_Loudness = (float)Loudness_dB - ZeroDBOffset; if (RigidBody.IsTriggerVolume()) { // Subscribe to TriggerVolume collisions on our rigid body: our callback (OnCollide) will get called // whenever a character or character vr hand collides with our trigger volume RigidBody.Subscribe(CollisionEventType.Trigger, OnCollide); } } else { // This will write to the region's log files. Only helpful to Linden developers. Log.Write("Couldn't find rigid body!"); } } } ```

Source: Examples/EventExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

```csharp signature protected ICoroutine StartCoroutine( Action coroutine, T arg1, Action handler ) ``` Starts a coroutine on the current script. | Parameter | Type | Description | |---|---|---| | `coroutine` | [Action<T>](https://learn.microsoft.com/dotnet/api/system.action-1) | The coroutine to run. | | `arg1` | T | First parameter to pass to the coroutine when it is run. | | `handler` | [Action<OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine. | **Type parameters:** `T`: Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action. **Returns:** [ICoroutine](/scripting/api/sansar.script/icoroutine) — An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks A coroutine can call `ScriptBase.WaitFor` to block while waiting for events to return. See [`ScriptBase.StartCoroutine`](/scripting/api/sansar.script/scriptbase#startcoroutine-action-action) for an extended example.
```csharp signature protected ICoroutine StartCoroutine( Action coroutine, T arg1, T1 arg2, Action handler ) ``` Starts a coroutine on the current script. | Parameter | Type | Description | |---|---|---| | `coroutine` | [Action<T, T1>](https://learn.microsoft.com/dotnet/api/system.action-2) | The coroutine to run. | | `arg1` | T | First parameter to pass to the coroutine when it is run. | | `arg2` | T1 | Second parameter to pass to the coroutine when it is run. | | `handler` | [Action<OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine. | **Type parameters:** `T`: Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.; `T1`: Type of the second parameter to pass to the coroutine when it is run. This can usually be derived from the Action. **Returns:** [ICoroutine](/scripting/api/sansar.script/icoroutine) — An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks A coroutine can call `ScriptBase.WaitFor` to block while waiting for events to return. See [`ScriptBase.StartCoroutine`](/scripting/api/sansar.script/scriptbase#startcoroutine-action-action) for an extended example.
```csharp signature protected ICoroutine StartCoroutine( Action coroutine, T arg1, T1 arg2, T2 arg3, Action handler ) ``` Starts a coroutine on the current script. | Parameter | Type | Description | |---|---|---| | `coroutine` | [Action<T, T1, T2>](https://learn.microsoft.com/dotnet/api/system.action-3) | The coroutine to run. | | `arg1` | T | First parameter to pass to the coroutine when it is run. | | `arg2` | T1 | Second parameter to pass to the coroutine when it is run. | | `arg3` | T2 | Third parameter to pass to the coroutine when it is run. | | `handler` | [Action<OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine. | **Type parameters:** `T`: Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.; `T1`: Type of the second parameter to pass to the coroutine when it is run. This can usually be derived from the Action.; `T2`: Type of the third parameter to pass to the coroutine when it is run. This can usually be derived from the Action. **Returns:** [ICoroutine](/scripting/api/sansar.script/icoroutine) — An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks A coroutine can call `ScriptBase.WaitFor` to block while waiting for events to return. See [`ScriptBase.StartCoroutine`](/scripting/api/sansar.script/scriptbase#startcoroutine-action-action) for an extended example.
```csharp signature protected ICoroutine StartCoroutine( Action coroutine, T arg1, T1 arg2, T2 arg3, T3 arg4, Action handler ) ``` Starts a coroutine on the current script. | Parameter | Type | Description | |---|---|---| | `coroutine` | [Action<T, T1, T2, T3>](https://learn.microsoft.com/dotnet/api/system.action-4) | The coroutine to run. | | `arg1` | T | First parameter to pass to the coroutine when it is run. | | `arg2` | T1 | Second parameter to pass to the coroutine when it is run. | | `arg3` | T2 | Third parameter to pass to the coroutine when it is run. | | `arg4` | T3 | Fourth parameter to pass to the coroutine when it is run. | | `handler` | [Action<OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | A callback to know when the coroutine has finished. Will report Success==false only if an exception was thrown by the coroutine. Message will be the name of the coroutine. | **Type parameters:** `T`: Type of the first parameter to pass to the coroutine when it is run. This can usually be derived from the Action.; `T1`: Type of the second parameter to pass to the coroutine when it is run. This can usually be derived from the Action.; `T2`: Type of the third parameter to pass to the coroutine when it is run. This can usually be derived from the Action.; `T3`: Type of the fourth parameter to pass to the coroutine when it is run. This can usually be derived from the Action. **Returns:** [ICoroutine](/scripting/api/sansar.script/icoroutine) — An ICoroutine interface to stop the coroutine or see if it has finished.
Remarks A coroutine can call `ScriptBase.WaitFor` to block while waiting for events to return. See [`ScriptBase.StartCoroutine`](/scripting/api/sansar.script/scriptbase#startcoroutine-action-action) for an extended example.
### SubscribeToScriptEvent
```csharp signature protected IEventSubscription SubscribeToScriptEvent( string message, Action callback, bool persistent ) ``` Subscribes to events sent by other scripts | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The event message to listen for. | | `callback` | [Action<ScriptEventData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to call when the event is generated | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Set to false if a one time event is desired. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An IEventSubscription that can be used to Unsubscribe from these script events.
```csharp signature protected IEventSubscription SubscribeToScriptEvent( ScriptId sourceScriptId, string message, Action callback, bool persistent ) ``` Subscribes to events sent only by a specific script. | Parameter | Type | Description | |---|---|---| | `sourceScriptId` | [ScriptId](/scripting/api/sansar.script/scriptid) | Ignore events posted by scripts not matching this id. | | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The event message to listen for. | | `callback` | [Action<ScriptEventData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to call when the event is generated. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Set to false if a one time event is desired. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An IEventSubscription that can be used to Unsubscribe from these script events.
### Terminate
```csharp signature protected void Terminate(string message) ``` Terminates this script immediately. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to write to the log. |
Remarks This method does not return.
### Wait
Added in 32.0.0
```csharp signature protected void Wait(double duration) ``` Delays execution of the current coroutine for the specified time. | Parameter | Type | Description | |---|---|---| | `duration` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The length of time to wait before continuing in seconds. |
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected void Wait(TimeSpan duration) ``` Delays execution of the current coroutine for the specified time. | Parameter | Type | Description | |---|---|---| | `duration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | The length of time to wait before continuing. |
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
### WaitFor
```csharp signature protected void WaitFor(ICoroutine otherCoroutine) ``` Block the current coroutine until otherCoroutine finishes. | Parameter | Type | Description | |---|---|---| | `otherCoroutine` | [ICoroutine](/scripting/api/sansar.script/icoroutine) | The coroutine to wait for. |
Remarks Waiting for the current coroutine, a null coroutine or a coroutine that is not alive will immediately return.
```csharp signature protected OperationCompleteEvent WaitFor( Action> func ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Action<Action<OperationCompleteEvent>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The event-generating API to wait for. | **Returns:** [OperationCompleteEvent](/scripting/api/sansar.script/operationcompleteevent) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func, Action,System.Boolean,Sansar.Script.IEventSubscription> func ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<Action<EventData>, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-4) | The event-generating API to wait for. | **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-3) | The event-generating API to wait for. | **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, Action run ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-3) | The event-generating API to wait for. | | `run` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | An Action to run after subscribing the the event, but before waiting for the event to occurr. | **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func, Action,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, Action<EventData>, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-5) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-4) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, Action run ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-4) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `run` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | An Action to run after subscribing the the event, but before waiting for the event to occurr. | **Type parameters:** `ARG1`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected OperationCompleteEvent WaitFor( Action> func, T1 t1 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Action<T1, Action<OperationCompleteEvent>>](https://learn.microsoft.com/dotnet/api/system.action-2) | The event-generating API to wait for. | | `t1` | T1 | An argument to func. | **Type parameters:** `T1`: The type of the argument to func. **Returns:** [OperationCompleteEvent](/scripting/api/sansar.script/operationcompleteevent) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func, Action,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, Action<EventData>, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-6) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-5) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, Action run ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-5) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `run` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | An Action to run after subscribing the the event, but before waiting for the event to occurr. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected OperationCompleteEvent WaitFor( Action> func, T1 t1, T2 t2 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Action<T1, T2, Action<OperationCompleteEvent>>](https://learn.microsoft.com/dotnet/api/system.action-3) | The event-generating API to wait for. | | `t1` | T1 | An argument to func. | | `t2` | T2 | An argument to func. | **Type parameters:** `T1`: The type of the argument to func.; `T2`: The type of the argument to func. **Returns:** [OperationCompleteEvent](/scripting/api/sansar.script/operationcompleteevent) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func, Action,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, Action<EventData>, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-7) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-6) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, Action run ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-6) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `run` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | An Action to run after subscribing the the event, but before waiting for the event to occurr. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected OperationCompleteEvent WaitFor( Action> func, T1 t1, T2 t2, T3 t3 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Action<T1, T2, T3, Action<OperationCompleteEvent>>](https://learn.microsoft.com/dotnet/api/system.action-4) | The event-generating API to wait for. | | `t1` | T1 | An argument to func. | | `t2` | T2 | An argument to func. | | `t3` | T3 | An argument to func. | **Type parameters:** `T1`: The type of the argument to func.; `T2`: The type of the argument to func.; `T3`: The type of the argument to func. **Returns:** [OperationCompleteEvent](/scripting/api/sansar.script/operationcompleteevent) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func, Action,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, ARG4, Action<EventData>, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-8) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `arg4` | ARG4 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func.; `ARG4`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, ARG4, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-7) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `arg4` | ARG4 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func.; `ARG4`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, Action run ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, ARG4, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-7) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `arg4` | ARG4 | An argument to func. | | `run` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | An Action to run after subscribing the the event, but before waiting for the event to occurr. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func.; `ARG4`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected OperationCompleteEvent WaitFor( Action> func, T1 t1, T2 t2, T3 t3, T4 t4 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Action<T1, T2, T3, T4, Action<OperationCompleteEvent>>](https://learn.microsoft.com/dotnet/api/system.action-5) | The event-generating API to wait for. | | `t1` | T1 | An argument to func. | | `t2` | T2 | An argument to func. | | `t3` | T3 | An argument to func. | | `t4` | T4 | An argument to func. | **Type parameters:** `T1`: The type of the argument to func.; `T2`: The type of the argument to func.; `T3`: The type of the argument to func.; `T4`: The type of the argument to func. **Returns:** [OperationCompleteEvent](/scripting/api/sansar.script/operationcompleteevent) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func, Action,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, ARG4, ARG5, Action<EventData>, Action<Sansar.Script.CancelData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-9) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `arg4` | ARG4 | An argument to func. | | `arg5` | ARG5 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func.; `ARG4`: The type of the argument to func.; `ARG5`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5 ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, ARG4, ARG5, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-8) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `arg4` | ARG4 | An argument to func. | | `arg5` | ARG5 | An argument to func. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func.; `ARG4`: The type of the argument to func.; `ARG5`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
```csharp signature protected EventData WaitFor( Func,System.Boolean,Sansar.Script.IEventSubscription> func, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, Action run ) ``` Use to pause the script until an event happens. | Parameter | Type | Description | |---|---|---| | `func` | [Func<ARG1, ARG2, ARG3, ARG4, ARG5, Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>](https://learn.microsoft.com/dotnet/api/system.func-8) | The event-generating API to wait for. | | `arg1` | ARG1 | An argument to func. | | `arg2` | ARG2 | An argument to func. | | `arg3` | ARG3 | An argument to func. | | `arg4` | ARG4 | An argument to func. | | `arg5` | ARG5 | An argument to func. | | `run` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | An Action to run after subscribing the the event, but before waiting for the event to occurr. | **Type parameters:** `ARG1`: The type of the argument to func.; `ARG2`: The type of the argument to func.; `ARG3`: The type of the argument to func.; `ARG4`: The type of the argument to func.; `ARG5`: The type of the argument to func. **Returns:** [EventData](/scripting/api/sansar.script/eventdata) — An EventData that can be case to type corresponding to the event type of func.
Remarks Throws [`CoroutineException`](/scripting/api/sansar.script/coroutineexception) if called from a script's constructor.
### WaitForLock
```csharp signature protected void WaitForLock(object Token) ``` WaitFor and take a lock on Token | Parameter | Type | Description | |---|---|---| | `Token` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object controlling the lock. Recommended to be a private object member. | **Throws** [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): Thrown if Token is null.
Remarks It is highly recommended to use [`ScriptBase.Lock`](/scripting/api/sansar.script/scriptbase#lock) instead. This is for advanced use only and can easily create deadlocks that stop scripts from working. If not paired with [`ScriptBase.ReleaseLock`](/scripting/api/sansar.script/scriptbase#releaselock) will create a deadlock preventing this code from being entered.
Example ```csharp private object BalanceLock = new Object(); int Balance = 100; bool Spend(int value) { WaitForLock(BalanceLock); bool success = false; if (Balance > value) { Balance -= value; success = true; } ReleaseLock(BalanceLock); // Note that any early exit between WaitForLock and ReleaseLock fail to release the lock, creating a deadlock the next time this method is called. // For this reason it is highly recommended to instead do: using (Lock(BalanceLock)) return success; } ```
### WaitForSignal
```csharp signature protected int WaitForSignal() ``` Wait the current coroutine until at least 1 signal is sent to it through the ICoroutine interface. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The number of signals received while waiting.
### Yield
```csharp signature [Sansar.Script.NonReflective] public void Yield() ``` Yield to let other coroutines or events run.
## Used in examples - [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/scriptbase --- # ScriptBase.OperationComplete Kind: Delegate · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Delegate Namespace Sansar.Script
Used to obtain notification that the operation has completed. ```csharp [System.Obsolete("Deprecated. Use the Actions", false)] public delegate void ScriptBase.OperationComplete( bool success, string failureMessage ) ``` | Parameter | Type | Description | |---|---|---| | `success` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true if the operation completed successfully. | | `failureMessage` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A message describing the failure if success if false. | ## Remarks The failure message is intended to be used for debugging and may change without notice.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/scriptbase.operationcomplete --- # ScriptBase.ScopedLock Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits IDisposable
Returned from [`ScriptBase.Lock`](/scripting/api/sansar.script/scriptbase#lock) for use in using statements. ```csharp public class ScriptBase.ScopedLock : IDisposable ``` ## Remarks Do not save or store a ScopedLock outside of a using statement. ## Members at a glance | Kind | Members | |---|---| | **Methods** | [Dispose](#dispose) · [Finalize](#finalize) | ## Methods ### Dispose
```csharp signature public void Dispose() ``` Releases the lock being held.
### Finalize
```csharp signature void Finalize() ``` Internal use only
Remarks Finalizer will not release any locks still held. Use ScopedLock only in using statements.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/scriptbase.scopedlock --- # ScriptEventData Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits EventData
Result of a [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective) call. ```csharp public class ScriptEventData : EventData ``` ## Remarks Use [`ScriptBase.SubscribeToScriptEvent`](/scripting/api/sansar.script/scriptbase#subscribetoscriptevent-string-action-boolean) to subscribe to events. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Data](#data) · [Message](#message) · [SourceScriptId](#sourcescriptid) | ## Properties ### Data
```csharp signature public Reflective Data { get; } ``` The data passed by [`ScriptBase.PostScriptEvent`](/scripting/api/sansar.script/scriptbase#postscriptevent-scriptid-string-reflective). **Value:** [Reflective](/scripting/api/sansar.script/reflective) — May be null.
### Message
```csharp signature public string Message { get; } ``` The message the event was created with. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — This string should always match the corresponding [`ScriptBase.SubscribeToScriptEvent`](/scripting/api/sansar.script/scriptbase#subscribetoscriptevent-string-action-boolean) call.
### SourceScriptId
```csharp signature public ScriptId SourceScriptId { get; } ``` The id of the script which generated the event.
## Used in examples - [ScriptLibrary/LibraryBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryBase.cs) - [ScriptLibrary/LibraryDebugger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryDebugger.cs) - [ScriptLibrary/Quest/QuestGiver.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiver.cs) - [ScriptLibrary/Quest/QuestGiverBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverBase.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Scene/Animation.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Animation.cs) - [ScriptLibrary/Scene/AudioStream.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/AudioStream.cs) - [ScriptLibrary/Scene/Broadcaster.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Broadcaster.cs) - [ScriptLibrary/Scene/Chat.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Chat.cs) …and 23 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/scripteventdata --- # ScriptHandle Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits IDisposable
A running script in Sansar. ```csharp public class ScriptHandle : IDisposable ``` ## Remarks This is a lightweight handle which is used by some API methods to refer to a script. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ID](#id) · [UnhandledExceptionRecoverable](#unhandledexceptionrecoverable) | | **Methods** | [Dispose](#dispose) | | **Events** | [UnhandledException](#unhandledexception) | ## Properties ### ID
```csharp signature public ScriptId ID { get; } ``` The Sansar Script's unique ID. This ID is unique among all scripts currently running in a scene. It will change every time the script or scene is started. **Value:** [ScriptId](/scripting/api/sansar.script/scriptid) — Returns [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the ScriptHandle is not initialized with a valid script.
Remarks Internal.
### UnhandledExceptionRecoverable
```csharp signature public bool UnhandledExceptionRecoverable { get; } ``` If true a script can keep running if an unhandled exception is processed by [`ScriptHandle.UnhandledException`](/scripting/api/sansar.script/scripthandle#unhandledexception). **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Boolean indicating if the script may continue running after an unhandled exception occurs.
Remarks If this is true and the [`ScriptHandle.UnhandledException`](/scripting/api/sansar.script/scripthandle#unhandledexception) event is set and does not throw and exception the script will continue to be scheduled.
## Methods ### Dispose
```csharp signature public void Dispose() ``` Internal use only
## Events ### UnhandledException
```csharp signature public event Action UnhandledException ``` Run by the script scheduler when the invocation of a script event handler or coroutine throws an exception.
Remarks If [`ScriptHandle.UnhandledExceptionRecoverable`](/scripting/api/sansar.script/scripthandle#unhandledexceptionrecoverable) is true then the script may continue running if the handler does not throw an exception. If the handler needs to stop execution of the script it should throw the passed exception. The first argument is either the [`EventData`](/scripting/api/sansar.script/eventdata) that was being processed, or the Coroutine that was running when the exception occurred.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/scripthandle --- # ScriptId Kind: Struct · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar.Script Inherits IComparable, IComparable<ScriptId>
Encapsulates an Script Id. ```csharp public struct ScriptId : IComparable, IComparable ``` ## Remarks Script Ids are unique per running scene. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [AllScripts](#allscripts) · [Invalid](#invalid) | | **Properties** | [IsValid](#isvalid) | | **Methods** | [CompareTo](#compareto) · [Equals](#equals) · [GetHashCode](#gethashcode) · [ToString](#tostring) | | **Operators** | [op\_Equality](#op_equality) · [op\_Implicit](#op_implicit) · [op\_Inequality](#op_inequality) | ## Fields ### AllScripts
```csharp signature public static readonly ScriptId AllScripts ``` The invalid id script.
Remarks This value is used by certain APIs to represent all scripts.
### Invalid
```csharp signature public static readonly ScriptId Invalid ``` The invalid id script.
Remarks This value is used by certain APIs to represent an invalid ScriptId.
## Properties ### IsValid
```csharp signature public bool IsValid { get; } ``` Gets the valid state for this ScriptId. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this id is a valid ScriptId.
## Methods ### CompareTo
```csharp signature public int CompareTo(ScriptId other) ``` Compares another instance to this scriptId. | Parameter | Type | Description | |---|---|---| | `other` | [ScriptId](/scripting/api/sansar.script/scriptid) | The scriptId to compare with this instance. | **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Returns -1 if this scriptId comes before the specified instance, 1 if this script id comes after the specified instance, 0 otherwise.
```csharp signature public int CompareTo(object other) ``` Compares another instance to this scriptId. | Parameter | Type | Description | |---|---|---| | `other` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The scriptId to compare with this instance. | **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Returns -1 if this scriptId comes before the specified instance, 1 if this script id comes after the specified instance, 0 otherwise. Returns 2 if the object is not a scriptId.
### Equals
```csharp signature public override bool Equals(object obj) ``` Value comparison for ScriptId. | Parameter | Type | Description | |---|---|---| | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The script to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the argument is an ScriptId and has the same value.
Remarks This method overrides [`ValueType.Equals`](https://learn.microsoft.com/dotnet/api/system.valuetype.equals).
### GetHashCode
```csharp signature public override int GetHashCode() ``` Retrieves the hash code for this instance. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The hash code for this instance.
Remarks This method overrides [`ValueType.GetHashCode`](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode).
### ToString
```csharp signature public override string ToString() ``` Converts the id to a hexadecimal string representation. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The hexadecimal string representation.
Remarks This method overrides [`Script.ToString`](https://learn.microsoft.com/dotnet/api/system.script.tostring).
## Operators ### op_Equality
```csharp signature public static bool operator ==(ScriptId a, ScriptId b) ``` ScriptId equality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ScriptId](/scripting/api/sansar.script/scriptid) | First ScriptId to compare. | | `b` | [ScriptId](/scripting/api/sansar.script/scriptid) | Second ScriptId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ScriptIds have the same value.
Remarks This is a value comparison.
### op_Implicit
```csharp signature public static implicit operator uint(ScriptId id) ``` Convert a ScriptId to a uint. | Parameter | Type | Description | |---|---|---| | `id` | [ScriptId](/scripting/api/sansar.script/scriptid) | The Script id to convert. |
### op_Inequality
```csharp signature public static bool operator !=(ScriptId a, ScriptId b) ``` ScriptId inequality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ScriptId](/scripting/api/sansar.script/scriptid) | First ScriptId to compare. | | `b` | [ScriptId](/scripting/api/sansar.script/scriptid) | Second ScriptId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ScriptIds have a different value.
Remarks This is a value comparison.
## Used in examples - [SharedStopwatchExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SharedStopwatchExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/scriptid --- # SessionId Kind: Struct · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar.Script
Encapsulates a Session Id. ```csharp public struct SessionId ``` ## Remarks Session ids are unique per agent session ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Invalid](#invalid) | | **Methods** | [Equals](#equals) · [GetHashCode](#gethashcode) · [ToString](#tostring) | | **Operators** | [op\_Equality](#op_equality) · [op\_Implicit](#op_implicit) · [op\_Inequality](#op_inequality) | ## Fields ### Invalid
```csharp signature public static readonly SessionId Invalid ``` The invalid id session.
Remarks This value is used by certain APIs to represent an invalid SessionId.
## Methods ### Equals
```csharp signature public override bool Equals(object obj) ``` Value comparison for SessionId. | Parameter | Type | Description | |---|---|---| | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The session to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the argument is an SessionId and has the same value.
Remarks This method overrides [`ValueType.Equals`](https://learn.microsoft.com/dotnet/api/system.valuetype.equals).
### GetHashCode
```csharp signature public override int GetHashCode() ``` Retrieves the hash code for this instance. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The hash code for this instance.
Remarks This method overrides [`ValueType.GetHashCode`](https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode).
### ToString
```csharp signature public override string ToString() ``` Converts the id to a hexadecimal string representation. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The hexadecimal string representation.
Remarks This method overrides [`Session.ToString`](https://learn.microsoft.com/dotnet/api/system.session.tostring).
## Operators ### op_Equality
```csharp signature public static bool operator ==(SessionId a, SessionId b) ``` SessionId equality operator. | Parameter | Type | Description | |---|---|---| | `a` | [SessionId](/scripting/api/sansar.script/sessionid) | First SessionId to compare. | | `b` | [SessionId](/scripting/api/sansar.script/sessionid) | Second SessionId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the SessionIds have the same value.
Remarks This is a value comparison.
### op_Implicit
```csharp signature public static implicit operator SessionId(int id) ``` Internal explicit conversion from a int. | Parameter | Type | Description | |---|---|---| | `id` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | A int representation of an SessionId | **Returns:** [SessionId](/scripting/api/sansar.script/sessionid) — A new SessionId initialized with the given int.
Remarks Internal.
### op_Inequality
```csharp signature public static bool operator !=(SessionId a, SessionId b) ``` SessionId inequality operator. | Parameter | Type | Description | |---|---|---| | `a` | [SessionId](/scripting/api/sansar.script/sessionid) | First SessionId to compare. | | `b` | [SessionId](/scripting/api/sansar.script/sessionid) | Second SessionId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the SessionIds have a different value.
Remarks This is a value comparison.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - [CoroutineEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineEventExample.cs) - [CoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestCharacter.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestCharacter.cs) - [ScriptLibrary/Quest/QuestGiver.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiver.cs) …and 28 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/sessionid --- # SimpleScriptEventData Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Reflective

This type is documented in the client, but it is not in the reference assemblies that scripts compile against. Scripts may not be able to use it.

Used by [`ScriptBase.PostSimpleScriptEvent`](/scripting/api/sansar.script/scriptbase#postsimplescriptevent-string-object) to send simple script events. ```csharp public class SimpleScriptEventData : Reflective ``` ## Remarks Supports sending a single Sansar or System type object between scripts, without the overhead of creating a custom Reflective class and Interface pair. Used by PostSimpleScriptEvent and SimpleScript.OnScriptEvent. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [SimpleScriptEventData](#simplescripteventdata) | | **Properties** | [Data](#data) | ## Constructors ### SimpleScriptEventData
```csharp signature public SimpleScriptEventData() ``` Default constructor.
## Properties ### Data
```csharp signature public object Data { get; set; } ``` A single object to pass between scripts.
Remarks To be useful, Data must be a system or Sansar type and not a locally defined type. Locally defined types will not be usable by other scripts.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/simplescripteventdata --- # ThrottleException Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Exception
Thrown when a method is called too often ```csharp public class ThrottleException : Exception ``` ## Remarks The ThrottleException class has information about the throttle rate and how fast the throttle was hit. This exception is thrown before any action is taken by the method. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Elapsed](#elapsed) · [Interval](#interval) · [MaxEvents](#maxevents) | ## Fields ### Elapsed
```csharp signature public readonly TimeSpan Elapsed ``` The timespan during which [`ThrottleException.MaxEvents`](/scripting/api/sansar.script/throttleexception#maxevents) method calls have happened.
Remarks Elapsed is a measure of how fast the throttle was hit. All [`ThrottleException.MaxEvents`](/scripting/api/sansar.script/throttleexception#maxevents) have happened within the last Elapsed time span.
### Interval
```csharp signature public readonly TimeSpan Interval ``` The timespan during which at most [`ThrottleException.MaxEvents`](/scripting/api/sansar.script/throttleexception#maxevents) can happen without hitting the throttle.
Remarks [`ThrottleException`](/scripting/api/sansar.script/throttleexception) is thrown if there have already been [`ThrottleException.MaxEvents`](/scripting/api/sansar.script/throttleexception#maxevents) successful calls to this method during the last Interval timespan.
### MaxEvents
```csharp signature public readonly int MaxEvents ``` The maximum number of method calls allowed per [`ThrottleException.Interval`](/scripting/api/sansar.script/throttleexception#interval)
Remarks Method calls past MaxEvents during [`ThrottleException.Interval`](/scripting/api/sansar.script/throttleexception#interval) will throw an exception and not be counted as events.
## Used in examples - [ScriptLibrary/Scene/AudioStream.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/AudioStream.cs) - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) - [ScriptLibrary/Scene/Media.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Media.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/throttleexception --- # Timer Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script
The Timer class is a static class that manages timer events for a script. ```csharp public static class Timer ``` ## Remarks The time the event is generated is guaranteed to be no less than the given duration, but may be more depending on system load. ## Members at a glance | Kind | Members | |---|---| | **Methods** | [Cancel](#cancel) · [Create](#create) | ## Methods ### Cancel
Deprecated
```csharp signature [System.Obsolete("Named timers are deprecated. Use the IEventSubscription returned from Timer.Create to cancel a timer.", false)] public static void Cancel(string name) ``` Cancels a repeating timer. | Parameter | Type | Description | |---|---|---| | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Name of the timer to cancel. |
Remarks If no timer with the given name exists, a [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception) will be thrown by the invocation.
### Create
Added in 32.0.0
```csharp signature public static IEventSubscription Create( double initialDurationSeconds, Action handler ) ``` Generates a one time event. | Parameter | Type | Description | |---|---|---| | `initialDurationSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The minimum duration to elapse before the event is generated in seconds. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription)
```csharp signature public static IEventSubscription Create( TimeSpan initialDuration, Action handler ) ``` Generates a one time event. | Parameter | Type | Description | |---|---|---| | `initialDuration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | The minimum duration to elapse before the event is generated. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription)
Added in 32.0.0
```csharp signature public static IEventSubscription Create( double initialDurationSeconds, Action handler, bool persistent ) ``` Generates a one time event. | Parameter | Type | Description | |---|---|---| | `initialDurationSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The minimum duration to elapse before the event is generated in seconds. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Set to true to continue generating events, false to stop after the first one | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription)
Added in 32.0.0
```csharp signature public static IEventSubscription Create( double initialDurationSeconds, double repeatDurationSeconds, Action handler ) ``` Generates a repeating event with an initial duration and a repeat duration. | Parameter | Type | Description | |---|---|---| | `initialDurationSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The minimum duration to elapse before the event is generated in seconds. | | `repeatDurationSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | After the initial duration, events will be generated at this interval in seconds. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription)
```csharp signature public static IEventSubscription Create( TimeSpan initialDuration, Action handler, bool persistent ) ``` Generates a one time event. | Parameter | Type | Description | |---|---|---| | `initialDuration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | The minimum duration to elapse before the event is generated. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Set to true to continue generating events, false to stop after the first one | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription)
```csharp signature public static IEventSubscription Create( TimeSpan initialDuration, TimeSpan repeatDuration, Action handler ) ``` Generates a repeating event with an initial duration and a repeat duration. | Parameter | Type | Description | |---|---|---| | `initialDuration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | The minimum duration to elapse before the event is generated. | | `repeatDuration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | After the initial duration, events will be generated at this interval. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | **Returns:** [IEventSubscription](/scripting/api/sansar.script/ieventsubscription)
Deprecated
```csharp signature [System.Obsolete("Named timers are deprecated. Use the IEventSubscription returned from Timer.Create to cancel a timer.", false)] public static void Create( TimeSpan initialDuration, TimeSpan repeatDuration, Action handler, string name ) ``` Generates a repeating event with an initial duration and a repeat duration. The event will continue as long as the script is active or until [`Timer.Cancel`](/scripting/api/sansar.script/timer#cancel) is called. | Parameter | Type | Description | |---|---|---| | `initialDuration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | The minimum duration to elapse before the event is generated. | | `repeatDuration` | [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) | After the initial duration, events will be generated at this interval. | | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | The [`Action`](https://learn.microsoft.com/dotnet/api/system.action) to be called when the time has elapsed. | | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A short string to identify this Timer. |
Remarks At most, one event will be generated per server frame, even if the duration is significantly shorter than the server frame time. Only the first 8 characters of the name are significant. Multiple timers with the same name are allowed. When [`Timer.Cancel`](/scripting/api/sansar.script/timer#cancel) is called the first timer with a matching name is stopped.
## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs) - [ScriptLibrary/Scene/Screenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Screenshot.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs) - [ScriptLibrary/Scene/TimeCountdown.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/TimeCountdown.cs) - [ScriptLibrary/Scene/TimedEvents.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/TimedEvents.cs) - [ScriptLibrary/ScriptWatcher.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/ScriptWatcher.cs) - [SharedStopwatchExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SharedStopwatchExample.cs) - [SharedStopwatchReaderExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SharedStopwatchReaderExample.cs) - [TwitchEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/TwitchEventExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/timer --- # TooltipAttribute Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Script Inherits Attribute
Set a helpful tooltip message to show in the editor. ```csharp [System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Field)] public class TooltipAttribute : Attribute ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [TooltipAttribute](#tooltipattribute) | | **Properties** | [Value](#value) | ## Constructors ### TooltipAttribute
```csharp signature public TooltipAttribute(string tooltip) ``` Set a helpful tooltip message to show in the editor. | Parameter | Type | Description | |---|---|---| | `tooltip` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
Example ```csharp [Tooltip("The position to move the object to, in world space.")] public Vector Destination; ```
## Properties ### Value
```csharp signature public string Value { get; } ``` The string to display
## Used in examples - [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.script/tooltipattribute --- # Sansar.Simulation > Types in the Sansar.Simulation namespace. Scene, object, avatar, physics, animation and interaction APIs. | Type | Kind | Summary | |---|---|---| | [AgentInfo](/scripting/api/sansar.simulation/agentinfo) | Class | The AgentInfo class has basic information and IDs for an agent. | | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Class | The AgentPrivate class is the full interface for interactions with avatars. | | [AgentPublic](/scripting/api/sansar.simulation/agentpublic) | Class | The AgentPublic class is a more limited subset of the [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate) API for use by other scripts in the scene. | | [AgentScript](/scripting/api/sansar.simulation/agentscript) | Class | Extend AgentScript to create a script to be attached directly to an agent. For future use: Sansar does not currently support adding scripts to agents. | | [Animation](/scripting/api/sansar.simulation/animation) | Class | Represents a scriptable Animation node. | | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | Enum | Enumeration for different animation skeleton subsets | | [AnimationComponent](/scripting/api/sansar.simulation/animationcomponent) | Class | The AnimationComponent handles interactions with animations. | | [AnimationComponent.SubscriptionHandler](/scripting/api/sansar.simulation/animationcomponent.subscriptionhandler) | Delegate | Animation events. | | [AnimationData](/scripting/api/sansar.simulation/animationdata) | Class | Animation events. | | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Struct | The AnimationParameters struct contains settings for playing animations. | | [AnimationPlaybackMode](/scripting/api/sansar.simulation/animationplaybackmode) | Enum | Enumeration for the different animation playback modes | | [AudioComponent](/scripting/api/sansar.simulation/audiocomponent) | Class | The AudioComponent handles interactions with audio components. | | [CameraComponent](/scripting/api/sansar.simulation/cameracomponent) | Class | The CameraComponent handles interactions with cameras. | | [CameraControlMode](/scripting/api/sansar.simulation/cameracontrolmode) | Enum | Type of camera mode a user is in. | | [CameraShakeHandle](/scripting/api/sansar.simulation/camerashakehandle) | Class | Stops a shake requested by the creating script; it does not report client playback. | | [CameraShakePattern](/scripting/api/sansar.simulation/camerashakepattern) | Enum | Selects the motion used by a camera shake. | | [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) | Class | Configures a camera shake; changes affect subsequent starts only. | | [CharacterAnimation](/scripting/api/sansar.simulation/characteranimation) | Class | The CharacterAnimation class represents an animation that can be played on a character component. | | [CharacterComponent](/scripting/api/sansar.simulation/charactercomponent) | Class | The CharacterComponent handles character specific operations like playing CharacterAnimations. | | [CharacterTracker](/scripting/api/sansar.simulation/charactertracker) | Class | The CharacterTracker keeps track of the quests associated with a QuestCharacter for a user. | | [CharacterTrackerData](/scripting/api/sansar.simulation/charactertrackerdata) | Class | Handler for Character Tracker update events. | | [Chat](/scripting/api/sansar.simulation/chat) | Class | The Chat class handles chat subscriptions and sending messages to users and other scripts. | | [Chat.SubscriptionHandler](/scripting/api/sansar.simulation/chat.subscriptionhandler) | Delegate | Subscribe to receive events on chat messages from the system, users or scripts. | | [ChatData](/scripting/api/sansar.simulation/chatdata) | Class | Subscribe to receive events on chat messages from the system, users or scripts. | | [Client](/scripting/api/sansar.simulation/client) | Class | The Client class is used for access to the Client connected to a [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate). | | [Cluster](/scripting/api/sansar.simulation/cluster) | Class | The Cluster class handles interactions with in game objects. | | [ClusterId](/scripting/api/sansar.simulation/clusterid) | Struct | Encapsulates an Cluster Id. | | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | Class | The ClusterResource class represents a cluster that could be added to the scene. See `ScenePrivate.CreateCluster`. | | [CollisionData](/scripting/api/sansar.simulation/collisiondata) | Class | Handler for rigid body events. | | [CollisionEventPhase](/scripting/api/sansar.simulation/collisioneventphase) | Enum | Phase for events that encapsulate sequence of occurrences | | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | Enum | Type of collision event. | | [CommandAction](/scripting/api/sansar.simulation/commandaction) | Enum | Specifies a command action. | | [CommandData](/scripting/api/sansar.simulation/commanddata) | Class | Command events are generated by the client when input events occur. | | [ComponentType](/scripting/api/sansar.simulation/componenttype) | Enum | Type of component. See [`ObjectPrivate.GetComponent`](/scripting/api/sansar.simulation/objectprivate#getcomponent) | | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | Enum | Control points are a representation of some spatial inputs, primarily VR controllers. | | [DataStore](/scripting/api/sansar.simulation/datastore) | Class | The [`DataStore`](/scripting/api/sansar.simulation/datastore) class provides access to a persistent data store that can be accessed by scripts from any experience. | | [DataStore.Options](/scripting/api/sansar.simulation/datastore.options) | Struct | Controls how various [`DataStore`](/scripting/api/sansar.simulation/datastore) operations proceed. | | [DataStore.Result<T>](/scripting/api/sansar.simulation/datastore.result-1) | Class | Holds the result of operations on a [`DataStore`](/scripting/api/sansar.simulation/datastore). | | [HeldObjectData](/scripting/api/sansar.simulation/heldobjectdata) | Class | Handler for agent grab events. | | [HeldObjectEventType](/scripting/api/sansar.simulation/heldobjecteventtype) | Enum | Type of held object event. | | [HeldObjectInfo](/scripting/api/sansar.simulation/heldobjectinfo) | Struct | Information about if this HeldObjectInfo is being held by an agent. | | [HttpClient](/scripting/api/sansar.simulation/httpclient) | Class | The Http Client can be used to make HTTP requests to external services. | | [HttpClient.RequestData](/scripting/api/sansar.simulation/httpclient.requestdata) | Class | The result of a [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action) call. | | [HttpRequestMethod](/scripting/api/sansar.simulation/httprequestmethod) | Enum | Enumerates the possible Http Request Methods | | [HttpRequestOptions](/scripting/api/sansar.simulation/httprequestoptions) | Struct | Options used for [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action) | | [HttpResponse](/scripting/api/sansar.simulation/httpresponse) | Struct | Data returned from [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action) | | [Interaction](/scripting/api/sansar.simulation/interaction) | Class | | | [InteractionData](/scripting/api/sansar.simulation/interactiondata) | Class | Handler for Interaction events. | | [InterpolationMode](/scripting/api/sansar.simulation/interpolationmode) | Enum | Type of interpolation to use for various interfaces | | [LightComponent](/scripting/api/sansar.simulation/lightcomponent) | Class | The LightComponent handles interactions with lights. | | [LightType](/scripting/api/sansar.simulation/lighttype) | Enum | Enumeration for the different types of lights | | [MaterialProperties](/scripting/api/sansar.simulation/materialproperties) | Struct | | | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | Enum | Special actions to perform on media surfaces with SetMediaAction | | [MeshComponent](/scripting/api/sansar.simulation/meshcomponent) | Class | The MeshComponent handles interactions with static meshes. | | [MirrorComponent](/scripting/api/sansar.simulation/mirrorcomponent) | Class | The MirrorComponent handles interactions with mirrors. | | [ModalDialog](/scripting/api/sansar.simulation/modaldialog) | Class | Manages a modal dialog which can be presented to the user. | | [MoveMode](/scripting/api/sansar.simulation/movemode) | Enum | Type of interpolation to use for movement | | [Mover](/scripting/api/sansar.simulation/mover) | Class | The Mover handles adding moves to process for an object. | | [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) | Class | Interface to an object in a [`Cluster`](/scripting/api/sansar.simulation/cluster) in the Scene. | | [ObjectPrivate.AddInteractionData](/scripting/api/sansar.simulation/objectprivate.addinteractiondata) | Class | The result of AddInteraction request. | | [ObjectPublic](/scripting/api/sansar.simulation/objectpublic) | Class | The ObjectPublic class is a more limited subset of the [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) API for use by other scripts in the scene. | | [ObjectScript](/scripting/api/sansar.simulation/objectscript) | Class | Extend SceneObjectScript to create a script that can be used on content that is rezzable in a scene. | | [Objective](/scripting/api/sansar.simulation/objective) | Class | The Objective is the interface for a user's Quest Objective | | [ObjectiveData](/scripting/api/sansar.simulation/objectivedata) | Class | Handler for Objective state change events. | | [ObjectiveDefinition](/scripting/api/sansar.simulation/objectivedefinition) | Class | The ObjectiveDefinition stores the data that is used to create quest objective instances for users. | | [ObjectiveDefinition.GetObjectiveData](/scripting/api/sansar.simulation/objectivedefinition.getobjectivedata) | Class | | | [ObjectiveState](/scripting/api/sansar.simulation/objectivestate) | Enum | State of a quest objective for a user. | | [PlayHandle](/scripting/api/sansar.simulation/playhandle) | Class | The PlayHandle represents audio play handles. | | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | Struct | The PlaySettings class contains settings for playing sounds. | | [PlayStatus](/scripting/api/sansar.simulation/playstatus) | Enum | Current status of the PlayStatus. | | [Quest](/scripting/api/sansar.simulation/quest) | Class | The Quest is the interface for a user's progress in a Quest. | | [QuestCharacter](/scripting/api/sansar.simulation/questcharacter) | Class | The QuestCharacter is the interface for a Quest Character | | [QuestData](/scripting/api/sansar.simulation/questdata) | Class | Handler for Quest state change events. | | [QuestDefinition](/scripting/api/sansar.simulation/questdefinition) | Class | The QuestDefinition stores the data that is used to create quest instances for users. | | [QuestDefinition.GetQuestData](/scripting/api/sansar.simulation/questdefinition.getquestdata) | Class | | | [QuestState](/scripting/api/sansar.simulation/queststate) | Enum | State of a quest for a user. | | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | Enum | Flags for targeting specific ragdoll body regions. Combine with bitwise OR. | | [RayCastHit](/scripting/api/sansar.simulation/raycasthit) | Struct | Result of a Raycast. | | [ReactionData](/scripting/api/sansar.simulation/reactiondata) | Class | Subscribe to receive reaction events from users. | | [Reactions](/scripting/api/sansar.simulation/reactions) | Class | The Reactions class subscriptions to user reaction events. | | [RenderMaterial](/scripting/api/sansar.simulation/rendermaterial) | Class | The RenderMaterial handles interactions with render materials. | | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | Class | The RigidBodyComponent handles interactions with rigid body physics. | | [RigidBodyComponent.SubscriptionHandler](/scripting/api/sansar.simulation/rigidbodycomponent.subscriptionhandler) | Delegate | Handler for rigid body events. | | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | Enum | Type of motion that can be applied to a rigid body. | | [SceneInfo](/scripting/api/sansar.simulation/sceneinfo) | Class | Information about a Scene. | | [SceneObjectScript](/scripting/api/sansar.simulation/sceneobjectscript) | Class | Extend SceneObjectScript to create a script that can be used on content that is natively in the scene. This is the primary script type in Sansar. | | [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate) | Class | Interface for Scripts that are part of a Scene. A more complete and less limited API than [`ScenePublic`](/scripting/api/sansar.simulation/scenepublic) | | [ScenePrivate.CreateClusterData](/scripting/api/sansar.simulation/sceneprivate.createclusterdata) | Class | The result of a create cluster request. | | [ScenePrivate.CreateClusterHandler](/scripting/api/sansar.simulation/sceneprivate.createclusterhandler) | Delegate | Handler for CreateCluster | | [ScenePublic](/scripting/api/sansar.simulation/scenepublic) | Class | The Public Scene API, a more limited subset of [`ScenePrivate`](/scripting/api/sansar.simulation/sceneprivate). | | [ScriptCameraControlMode](/scripting/api/sansar.simulation/scriptcameracontrolmode) | Enum | Type of control mode to use for a script camera. | | [SimpleScript](/scripting/api/sansar.simulation/simplescript) | Class | Extend SimpleScript to create a script that can be used on content that is natively in the scene. This is the primary script type in Sansar. | | [SimpleScript.OnAddUserOptionsAttribute](/scripting/api/sansar.simulation/simplescript.onadduseroptionsattribute) Client documentation only | Class | Use to create additional OnAddUser subscriptions | | [SimpleScript.OnChatOptionsAttribute](/scripting/api/sansar.simulation/simplescript.onchatoptionsattribute) | Class | Set options for OnChat() overrides, or use to create more simple chat handlers. | | [SimpleScript.OnCollisionOptionsAttribute](/scripting/api/sansar.simulation/simplescript.oncollisionoptionsattribute) | Class | Set options for OnCollision events, or use to create more simple collision handlers. | | [SimpleScript.OnRemoveUserOptionsAttribute](/scripting/api/sansar.simulation/simplescript.onremoveuseroptionsattribute) Client documentation only | Class | Use to create additional OnRemoveUser subscriptions | | [SimpleScript.OnScriptEventOptionsAttribute](/scripting/api/sansar.simulation/simplescript.onscripteventoptionsattribute) | Class | Set options for OnScriptEvent events. | | [SimpleScript.OnTimerOptionsAttribute](/scripting/api/sansar.simulation/simplescript.ontimeroptionsattribute) | Class | Set options for OnTimer() overrides, or use to create more simple timers. | | [SimpleScript.SimpleScriptOptionsAttribute](/scripting/api/sansar.simulation/simplescript.simplescriptoptionsattribute) | Class | Internal Use Only | | [SitEventType](/scripting/api/sansar.simulation/siteventtype) | Enum | Type of sit event. | | [SitObjectData](/scripting/api/sansar.simulation/sitobjectdata) | Class | Handler for agent sit events. | | [SitObjectInfo](/scripting/api/sansar.simulation/sitobjectinfo) | Struct | Information about if an agent is sitting on this SitObjectInfo. | | [SoundResource](/scripting/api/sansar.simulation/soundresource) | Class | The SoundResource class represents a sound that could be added to the scene. | | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Enum | For playing a stream from the scene. | | [TextureResource](/scripting/api/sansar.simulation/textureresource) | Class | The TextureResource class represents a texture from the inventory, such as a color LUT. See [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). | | [ThumbnailedClusterResource](/scripting/api/sansar.simulation/thumbnailedclusterresource) | Class | The ThumbnailedClusterResource class represents a cluster that has properties to be shown in the UI. | | [TimeOfDayMode](/scripting/api/sansar.simulation/timeofdaymode) | Enum | How a scene's time of day runs. | | [TutorialHint](/scripting/api/sansar.simulation/tutorialhint) | Enum | Tutorial hint types. | | [TwitchData](/scripting/api/sansar.simulation/twitchdata) | Class | Twitch events are generated in response to twitch stream interaction. | | [TwitchEventType](/scripting/api/sansar.simulation/twitcheventtype) | Enum | Enumerates the types of twitch events that scripts can subscribe to. | | [UI](/scripting/api/sansar.simulation/ui) | Class | Manages the client UI. | | [UIMenu](/scripting/api/sansar.simulation/uimenu) | Class | Manages a clickable on-screen menu UI element. | | [UIProgressBar](/scripting/api/sansar.simulation/uiprogressbar) | Class | Manages a progress bar UI element. | | [UIScoreBoard](/scripting/api/sansar.simulation/uiscoreboard) | Class | Manages a score board HUD element. | | [User](/scripting/api/sansar.simulation/user) | Class | The User class handles interactions user logins and logoffs. | | [User.SubscriptionHandler](/scripting/api/sansar.simulation/user.subscriptionhandler) | Delegate | Subscribe to receive events when users enter or leave the experience, or change their chat name. | | [UserData](/scripting/api/sansar.simulation/userdata) | Class | Subscribe to receive events when users enter or leave the experience. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation --- # AgentInfo Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The AgentInfo class has basic information and IDs for an agent. ```csharp public class AgentInfo : Sansar.Script.InstanceInterface ``` ## Remarks Agents may leave at any time. Attempting to use an AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AvatarUuid](#avataruuid) · [Handle](#handle) · [Name](#name) · [ObjectId](#objectid) · [Scale](#scale) · [SessionId](#sessionid) · [Ticket](#ticket) | | **Methods** | [ToString](#tostring) | ## Properties ### AvatarUuid
```csharp signature public Guid AvatarUuid { get; } ``` Returns the persona ID of the AgentInfo. **Value:** [Guid](https://learn.microsoft.com/dotnet/api/system.guid) — The persona ID of the AgentInfo
Remarks Agent persona IDs are unique
### Handle
```csharp signature public string Handle { get; } ``` Returns the handle of the AgentInfo. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The handle of the AgentInfo
Remarks Agent handles are unique.
### Name
```csharp signature public string Name { get; } ``` Returns the name of the AgentInfo. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The name of the AgentInfo
Remarks Agent names may not be unique.
### ObjectId
```csharp signature public Sansar.Script.ObjectId ObjectId { get; } ``` Returns the ObjectId of the AgentInfo. **Value:** [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) — The object ID of the AgentInfo
Remarks The object id can be used to compare agents or look up the [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) associated with the agent.
### Scale
Added in 33.2.0
```csharp signature public float Scale { get; } ``` Returns the scale for the user. **Value:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The scale of the user
Remarks This is the scale setting from the character editor.
### SessionId
```csharp signature public Sansar.Script.SessionId SessionId { get; } ``` Returns the Id of the AgentInfo. **Value:** [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) — The id of the AgentInfo
Remarks The id can be used for quick comparison between Agents.
### Ticket
Added in 31.1.0
```csharp signature public string Ticket { get; } ``` Returns the ticket for the user if they purchased one. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The ticket of the user
Remarks Will be an empty string if no ticket was used to enter the scene or event.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [CoroutineEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineEventExample.cs) - [CoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) …and 41 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/agentinfo --- # AgentPrivate Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The AgentPrivate class is the full interface for interactions with avatars. ```csharp public class AgentPrivate : Sansar.Script.InstanceInterface ``` ## Remarks Use via [`AgentScript.AgentPrivate`](/scripting/api/sansar.simulation/agentscript#agentprivate) to access APIs for the agent the script is on. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentInfo](#agentinfo) · [Client](#client) | | **Methods** | [AddReaction](#addreaction) · [ApplyRagdollImpulse](#applyragdollimpulse) · [ApplyRagdollImpulseToRegions](#applyragdollimpulsetoregions) · [ClearAllowFlightOverride](#clearallowflightoverride) New in 47.10.0 · [ClearColorLutOverride](#clearcolorlutoverride) New in 47.10.0 · [GetAllowFlight](#getallowflight) New in 47.10.0 · [GetControlPointEnabled](#getcontrolpointenabled) · [GetControlPointOrientation](#getcontrolpointorientation) · [GetControlPointPosition](#getcontrolpointposition) · [GetGravityFactor](#getgravityfactor) · [GetHeldRigidBodies](#getheldrigidbodies) · [GetRagdollBounce](#getragdollbounce) · [GetRagdollEnabled](#getragdollenabled) · [GetScaleFactor](#getscalefactor) · [GetSpeedFactor](#getspeedfactor) · [IgnoreCollisionWith](#ignorecollisionwith) · [IsCollisionIgnoredWith](#iscollisionignoredwith) · [OverrideAudioStream](#overrideaudiostream) · [OverrideIndexedMediaSource](#overrideindexedmediasource) · [OverrideMediaSource](#overridemediasource) · [PerformIndexedMediaAction](#performindexedmediaaction) · [PerformMediaAction](#performmediaaction) · [PlaySound](#playsound) · [PlaySoundAtPosition](#playsoundatposition) · [PlaySoundOnComponent](#playsoundoncomponent) · [PlayStream](#playstream) · [PlayStreamAtPosition](#playstreamatposition) · [PlayStreamOnComponent](#playstreamoncomponent) · [RemoveReaction](#removereaction) · [SendChat](#sendchat) · [SetAllowFlight](#setallowflight) New in 47.10.0 · [SetColorLut](#setcolorlut) New in 47.10.0 · [SetGravityFactor](#setgravityfactor) · [SetRagdollBounce](#setragdollbounce) · [SetRagdollEnabled](#setragdollenabled) · [SetScaleFactor](#setscalefactor) · [SetScaleFactorAnimated](#setscalefactoranimated) · [SetSpeedFactor](#setspeedfactor) · [ToString](#tostring) | ## Properties ### AgentInfo
```csharp signature public AgentInfo AgentInfo { get; } ``` Returns the [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance. **Value:** [AgentInfo](/scripting/api/sansar.simulation/agentinfo) — The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance
Remarks The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) holds information about an agent.
### Client
```csharp signature public Client Client { get; } ``` Returns the [`Client`](/scripting/api/sansar.simulation/client) for this instance. **Value:** [Client](/scripting/api/sansar.simulation/client) — The [`Client`](/scripting/api/sansar.simulation/client) for this instance
Remarks The [`Client`](/scripting/api/sansar.simulation/client) manages interactions with a client.
## Methods ### AddReaction
Added in 43.2.1
```csharp signature public void AddReaction( string reactionType, string displayText, ThumbnailedClusterResource resource ) ``` Add a new reaction type to this agent only | Parameter | Type | Description | |---|---|---| | `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback. Should be of a form like 'Developer.Type' to match the default, e.g. 'Sansar.Fire' | | `displayText` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A short string that appears on the emotes panel | | `resource` | [ThumbnailedClusterResource](/scripting/api/sansar.simulation/thumbnailedclusterresource) | A cluster source which has a thumbnail defined in inventory. |
### ApplyRagdollImpulse
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulse(Sansar.Vector impulse) ``` Applies a linear impulse to the entire ragdoll. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
Remarks This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulse( Sansar.Vector impulse, Action handler ) ``` Applies a linear impulse to the entire ragdoll. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulse( Sansar.Vector impulse, float autoRecoverDelaySeconds ) ``` Applies a linear impulse to the entire ragdoll and sets the auto-recovery delay. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |
Remarks This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulse( Sansar.Vector impulse, float autoRecoverDelaySeconds, Action handler ) ``` Applies a linear impulse to the entire ragdoll and sets the auto-recovery delay. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### ApplyRagdollImpulseToRegions
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulseToRegions( Sansar.Vector impulse, RagdollRegion regions ) ``` Applies a linear impulse to specific ragdoll body regions. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). |
Remarks Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulseToRegions( Sansar.Vector impulse, RagdollRegion regions, Action handler ) ``` Applies a linear impulse to specific ragdoll body regions. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulseToRegions( Sansar.Vector impulse, RagdollRegion regions, float autoRecoverDelaySeconds ) ``` Applies a linear impulse to specific ragdoll body regions and sets the auto-recovery delay. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). | | `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |
Remarks Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void ApplyRagdollImpulseToRegions( Sansar.Vector impulse, RagdollRegion regions, float autoRecoverDelaySeconds, Action handler ) ``` Applies a linear impulse to specific ragdoll body regions and sets the auto-recovery delay. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. | | `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). | | `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### ClearAllowFlightOverride
New in 47.10.0
```csharp signature public void ClearAllowFlightOverride() ``` Clears this agent's per-agent flight override.
Remarks The agent will inherit this instance's default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
New in 47.10.0
```csharp signature public void ClearAllowFlightOverride( Action handler ) ``` Clears this agent's per-agent flight override. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The agent will inherit this instance's default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
### ClearColorLutOverride
New in 47.10.0
```csharp signature public void ClearColorLutOverride() ``` Clears this agent's color LUT override.
Remarks The agent goes back to the scene-wide LUT, see [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
New in 47.10.0
```csharp signature public void ClearColorLutOverride( Action handler ) ``` Clears this agent's color LUT override. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The agent goes back to the scene-wide LUT, see [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
### GetAllowFlight
New in 47.10.0
```csharp signature public bool GetAllowFlight() ``` Gets whether flying is available for this agent. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The agent's override, or the instance default if no override is set.
Remarks This is the committed effective permission; control mode and interaction rules still apply.
### GetControlPointEnabled
```csharp signature public bool GetControlPointEnabled(ControlPointType type) ``` Retrieves whether the control point is enabled. | Parameter | Type | Description | |---|---|---| | `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype). | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if the control point is enabled. Control points are enabled when used.
Remarks Control points are a representation of some spatial inputs, primarily VR controllers.
### GetControlPointOrientation
```csharp signature public Sansar.Quaternion GetControlPointOrientation( ControlPointType type ) ``` Retrieves the orientation in character relative space of the specified control point. | Parameter | Type | Description | |---|---|---| | `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype). | **Returns:** [Sansar.Quaternion](/scripting/api/sansar/quaternion) — The orientation of the control point.
Remarks Control points are a representation of some spatial inputs, primarily VR controllers.
### GetControlPointPosition
```csharp signature public Sansar.Vector GetControlPointPosition(ControlPointType type) ``` Retrieves the position in character relative space of the specified control point. | Parameter | Type | Description | |---|---|---| | `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | The control point to get the position of. See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype). | **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The position of the control point.
Remarks Control points are a representation of some spatial inputs, primarily VR controllers.
### GetGravityFactor
Added in 34.2.0
```csharp signature public float GetGravityFactor() ``` Retrieves what factor of the world's gravity is applied to this agent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The gravity factor.
### GetHeldRigidBodies
```csharp signature public IEnumerable GetHeldRigidBodies() ``` Retrieves a list of [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) that this agent is currently holding. **Returns:** [IEnumerable<RigidBodyComponent>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — a list of [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent)
### GetRagdollBounce
Added in 47.1.1
```csharp signature public float GetRagdollBounce() ``` Gets the current ragdoll bounce factor. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The bounce factor (0-1).
### GetRagdollEnabled
Added in 47.1.1
```csharp signature public bool GetRagdollEnabled() ``` Returns whether ragdoll physics is currently active for this agent. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if ragdoll is active.
### GetScaleFactor
Added in 47.1.1
```csharp signature public float GetScaleFactor() ``` Retrieves the runtime scale factor applied to this agent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The scale factor.
### GetSpeedFactor
Added in 36.8.0
```csharp signature public float GetSpeedFactor() ``` Retrieves what factor of the base speed to apply to this agent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The speed factor.
### IgnoreCollisionWith
Added in 36.8.0
```csharp signature public void IgnoreCollisionWith( RigidBodyComponent rigidBodyComponent, bool ignoreBody ) ``` Sets whether this agent will ignore collisions with a specific [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) | Parameter | Type | Description | |---|---|---| | `rigidBodyComponent` | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | The RigidBodyComponent with which to change collision behavior. | | `ignoreBody` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | When true, collision will be added to the ignore list. When false, collision will removed from the ignore list. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 36.8.0
```csharp signature public void IgnoreCollisionWith( RigidBodyComponent rigidBodyComponent, bool ignoreBody, Action handler ) ``` Sets whether this agent will ignore collisions with a specific [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) | Parameter | Type | Description | |---|---|---| | `rigidBodyComponent` | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | The RigidBodyComponent with which to change collision behavior. | | `ignoreBody` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | When true, collision will be added to the ignore list. When false, collision will removed from the ignore list. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### IsCollisionIgnoredWith
Added in 36.8.0
```csharp signature public bool IsCollisionIgnoredWith( RigidBodyComponent rigidBodyComponent ) ``` Checks whether an agent is ignoring collisions with a specific [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent). | Parameter | Type | Description | |---|---|---| | `rigidBodyComponent` | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | The RigidBodyComponent that could possibly be ignored. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
### OverrideAudioStream
```csharp signature public void OverrideAudioStream(string url) ``` Overrides source of web audio streams. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
Remarks Applies to this agent only. NOTE: this may cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
```csharp signature public void OverrideAudioStream( string url, Action handler ) ``` Overrides source of web audio streams. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to this agent only. NOTE: this may cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
### OverrideIndexedMediaSource
Added in 46.5.0
```csharp signature public void OverrideIndexedMediaSource( string url, int mediaIndex, int mediaWidth, int mediaHeight, Action handler ) ``` Overrides source of indexed media surfaces. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `mediaIndex` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source index. | | `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. | | `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to this agent only. NOTE: this will cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
### OverrideMediaSource
```csharp signature public void OverrideMediaSource(string url) ``` Sets stream channel source. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
```csharp signature public void OverrideMediaSource( string url, int mediaWidth, int mediaHeight ) ``` Overrides source of media surfaces. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. | | `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. |
Remarks Applies to this agent only. NOTE: this will cause a few seconds of silence while restarting starting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
```csharp signature public void OverrideMediaSource( string url, int mediaWidth, int mediaHeight, Action handler ) ``` Overrides source of media surfaces. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. | | `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to this agent only. NOTE: this will cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
### PerformIndexedMediaAction
Added in 46.5.0
```csharp signature public void PerformIndexedMediaAction( MediaAction action, int mediaIndex, Action handler ) ``` Performs a specific action on the current media surface. | Parameter | Type | Description | |---|---|---| | `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. | | `mediaIndex` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source index. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to this agent only.
### PerformMediaAction
```csharp signature public void PerformMediaAction(MediaAction action) ``` Performs a specific action on the current media surface. | Parameter | Type | Description | |---|---|---| | `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. |
Remarks Applies to this agent only.
```csharp signature public void PerformMediaAction( MediaAction action, Action handler ) ``` Performs a specific action on the current media surface index. | Parameter | Type | Description | |---|---|---| | `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to this agent only.
### PlaySound
```csharp signature public PlayHandle PlaySound( SoundResource soundResource, PlaySettings playSettings ) ``` Play sound to direct output. | Parameter | Type | Description | |---|---|---| | `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. | | `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for this agent only.
### PlaySoundAtPosition
```csharp signature public PlayHandle PlaySoundAtPosition( SoundResource soundResource, Sansar.Vector position, PlaySettings playSettings ) ``` Play sound at specified position. | Parameter | Type | Description | |---|---|---| | `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The absolute position. | | `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for this agent only. By setting an absolute position, the location of this sound will be static. If you want the sound to move, you must play the sound on an audio component and move the audio component.
### PlaySoundOnComponent
```csharp signature public PlayHandle PlaySoundOnComponent( SoundResource soundResource, AudioComponent audioComponent, PlaySettings playSettings ) ``` Play sound on a component (and follows its position). | Parameter | Type | Description | |---|---|---| | `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. | | `audioComponent` | [AudioComponent](/scripting/api/sansar.simulation/audiocomponent) | The audio component to play this on. | | `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for this agent only. As the component moves, this sound will follow the component's location.
### PlayStream
```csharp signature public PlayHandle PlayStream( StreamChannel streamChannel, float loudness ) ``` Play audio stream to direct output. | Parameter | Type | Description | |---|---|---| | `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. | | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for this agent only.
### PlayStreamAtPosition
```csharp signature public PlayHandle PlayStreamAtPosition( StreamChannel streamChannel, Sansar.Vector position, float loudness ) ``` Play web audio stream at specified position. | Parameter | Type | Description | |---|---|---| | `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The absolute position. | | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for this agent only. By setting an absolute position, the location of this sound will be static. If you want the sound to move, you must play the sound on an audio component and move the audio component.
### PlayStreamOnComponent
```csharp signature public PlayHandle PlayStreamOnComponent( StreamChannel streamChannel, AudioComponent audioComponent, float loudness ) ``` Play web audio stream on this component (and follow its position). | Parameter | Type | Description | |---|---|---| | `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. | | `audioComponent` | [AudioComponent](/scripting/api/sansar.simulation/audiocomponent) | The audio component to play this on. | | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for this agent only. As the component moves, this sound will follow the component's location.
### RemoveReaction
Added in 43.2.1
```csharp signature public void RemoveReaction(string reactionType) ``` Remove the specified reaction from this agent. | Parameter | Type | Description | |---|---|---| | `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback. Should be of a form like 'Developer.Type' to match the default, e.g. 'Sansar.Fire' |
### SendChat
```csharp signature public void SendChat(string message) ``` Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the $className$. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | **Throws** [`NullReferenceException`](https://learn.microsoft.com/dotnet/api/system.nullreferenceexception): If the user is no longer online. **Throws** [`ThrottleException`](/scripting/api/sansar.script/throttleexception): If the throttle rate is exceeded.
Remarks eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat
```csharp signature public void SendChat( string message, Action handler ) ``` Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the AgentPrivate. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Messages may be throttled and ignored.
### SetAllowFlight
New in 47.10.0
```csharp signature public void SetAllowFlight(bool allowFlight) ``` Sets whether flying is available for this agent. | Parameter | Type | Description | |---|---|---| | `allowFlight` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to allow this agent to fly, false to prevent it. |
Remarks The explicit override persists until cleared or the agent leaves, even when the instance default changes. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
New in 47.10.0
```csharp signature public void SetAllowFlight( bool allowFlight, Action handler ) ``` Sets whether flying is available for this agent. | Parameter | Type | Description | |---|---|---| | `allowFlight` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to allow this agent to fly, false to prevent it. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The explicit override persists until cleared or the agent leaves, even when the instance default changes. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
### SetColorLut
New in 47.10.0
```csharp signature public void SetColorLut(TextureResource lut) ``` Overrides the color LUT for this agent alone. | Parameter | Type | Description | |---|---|---| | `lut` | [TextureResource](/scripting/api/sansar.simulation/textureresource) | The LUT texture to grade this agent's view with, or null to clear the override. |
Remarks Takes precedence over the LUT chosen in the scene settings and over [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). A PostFX volume with its own LUT still takes over while this agent's camera is inside it. The override persists until cleared or the agent leaves. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
New in 47.10.0
```csharp signature public void SetColorLut( TextureResource lut, Action handler ) ``` Overrides the color LUT for this agent alone. | Parameter | Type | Description | |---|---|---| | `lut` | [TextureResource](/scripting/api/sansar.simulation/textureresource) | The LUT texture to grade this agent's view with, or null to clear the override. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Takes precedence over the LUT chosen in the scene settings and over [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). A PostFX volume with its own LUT still takes over while this agent's camera is inside it. The override persists until cleared or the agent leaves. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
### SetGravityFactor
Added in 34.2.0
```csharp signature public void SetGravityFactor(float gravityFactor) ``` Sets what factor of the world's gravity is applied to this agent. | Parameter | Type | Description | |---|---|---| | `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is clamped between -2 to 2 |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 34.2.0
```csharp signature public void SetGravityFactor( float gravityFactor, Action handler ) ``` Sets what factor of the world's gravity is applied to this agent. | Parameter | Type | Description | |---|---|---| | `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is clamped between -2 to 2 | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetRagdollBounce
Added in 47.1.1
```csharp signature public void SetRagdollBounce(float bounce) ``` Sets the bounciness of the ragdoll body. | Parameter | Type | Description | |---|---|---| | `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Bounce factor from 0 (no bounce) to 1 (maximum bounce). Default is 0. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void SetRagdollBounce( float bounce, Action handler ) ``` Sets the bounciness of the ragdoll body. | Parameter | Type | Description | |---|---|---| | `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Bounce factor from 0 (no bounce) to 1 (maximum bounce). Default is 0. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetRagdollEnabled
Added in 47.1.1
```csharp signature public void SetRagdollEnabled(bool enabled) ``` Enables or disables ragdoll physics on this agent. | Parameter | Type | Description | |---|---|---| | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. |
Remarks Enabling ragdoll through this overload uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void SetRagdollEnabled( bool enabled, Action handler ) ``` Enables or disables ragdoll physics on this agent. | Parameter | Type | Description | |---|---|---| | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Enabling ragdoll through this overload uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void SetRagdollEnabled( bool enabled, float autoRecoverDelaySeconds ) ``` Enables or disables ragdoll physics on this agent and sets the auto-recovery delay. | Parameter | Type | Description | |---|---|---| | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. | | `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void SetRagdollEnabled( bool enabled, float autoRecoverDelaySeconds, Action handler ) ``` Enables or disables ragdoll physics on this agent and sets the auto-recovery delay. | Parameter | Type | Description | |---|---|---| | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. | | `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetScaleFactor
Added in 47.1.1
```csharp signature public void SetScaleFactor(float scaleFactor) ``` Sets a runtime scale factor for this agent. | Parameter | Type | Description | |---|---|---| | `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scaleFactor. Default value is 1, range is clamped between 0.01 to 100 |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void SetScaleFactor( float scaleFactor, Action handler ) ``` Sets a runtime scale factor for this agent. | Parameter | Type | Description | |---|---|---| | `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scaleFactor. Default value is 1, range is clamped between 0.01 to 100 | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetScaleFactorAnimated
Added in 47.1.1
```csharp signature public void SetScaleFactorAnimated(float scaleFactor, float seconds) ``` Sets a runtime scale factor for this agent, interpolating smoothly over the given duration. | Parameter | Type | Description | |---|---|---| | `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The target scaleFactor. Range is clamped between 0.01 to 100 | | `seconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The duration in seconds over which to interpolate. If 0 or negative, the change is instant. |
Remarks This asynchronous method queues the write then returns. The scale will smoothly transition from the current value to the target over the specified duration using a smooth ease curve. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.1.1
```csharp signature public void SetScaleFactorAnimated( float scaleFactor, float seconds, Action handler ) ``` Sets a runtime scale factor for this agent, interpolating smoothly over the given duration. | Parameter | Type | Description | |---|---|---| | `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The target scaleFactor. Range is clamped between 0.01 to 100 | | `seconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The duration in seconds over which to interpolate. If 0 or negative, the change is instant. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. The scale will smoothly transition from the current value to the target over the specified duration using a smooth ease curve. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetSpeedFactor
Added in 36.8.0
```csharp signature public void SetSpeedFactor(float speedFactor) ``` Sets what factor of the base speed to apply to this agent. | Parameter | Type | Description | |---|---|---| | `speedFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The speedFactor. Default value is 1, range is clamped between 0.1 to 4 |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 36.8.0
```csharp signature public void SetSpeedFactor( float speedFactor, Action handler ) ``` Sets what factor of the base speed to apply to this agent. | Parameter | Type | Description | |---|---|---| | `speedFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The speedFactor. Default value is 1, range is clamped between 0.1 to 4 | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - `ColorLutExample.cs` - [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs) …and 29 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/agentprivate --- # AgentPublic Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The AgentPublic class is a more limited subset of the [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate) API for use by other scripts in the scene. ```csharp public class AgentPublic : Sansar.Script.InstanceInterface ``` ## Remarks AgentPublic has a more limited API than [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate). Agents may leave the scene at any time. Attempting to use an AgentPublic interface for an agent no longer in the scene will throw a NullReferenceException. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentInfo](#agentinfo) | | **Methods** | [SendChat](#sendchat) · [ToString](#tostring) | ## Properties ### AgentInfo
```csharp signature public AgentInfo AgentInfo { get; } ``` Returns the [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance. **Value:** [AgentInfo](/scripting/api/sansar.simulation/agentinfo) — The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance
Remarks The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) holds information about an agent.
## Methods ### SendChat
```csharp signature public void SendChat(string message) ``` Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the $className$. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | **Throws** [`NullReferenceException`](https://learn.microsoft.com/dotnet/api/system.nullreferenceexception): If the user is no longer online. **Throws** [`ThrottleException`](/scripting/api/sansar.script/throttleexception): If the throttle rate is exceeded.
Remarks eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat
```csharp signature public void SendChat( string message, Action handler ) ``` Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the AgentPublic. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Messages may be throttled and ignored.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/agentpublic --- # AgentScript Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.ScriptBase
Extend AgentScript to create a script to be attached directly to an agent. For future use: Sansar does not currently support adding scripts to agents. ```csharp public abstract class AgentScript : Sansar.Script.ScriptBase ``` ## Remarks Override [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) for script initialization, primarily event subscriptions. Use [`AgentScript.ObjectPrivate`](/scripting/api/sansar.simulation/agentscript#objectprivate) to access the ObjectPrivate the object that represents the Agent. Use [`AgentScript.ScenePublic`](/scripting/api/sansar.simulation/agentscript#scenepublic) to access the a limited API for the Scene the agent is in. Use [`AgentScript.AgentPrivate`](/scripting/api/sansar.simulation/agentscript#agentprivate) to access the Agent the object is attached to. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [AgentScript](#agentscript) | | **Properties** | [AgentPrivate](#agentprivate) · [ObjectPrivate](#objectprivate) · [ScenePublic](#scenepublic) | ## Constructors ### AgentScript
```csharp signature protected AgentScript() ``` This constructor is called before any properties have been set. Override [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) to initialize the script after properties have been set.
## Properties ### AgentPrivate
```csharp signature [Sansar.Script.NonReflective] public AgentPrivate AgentPrivate { protected get; set; } ``` The Agent API for the agent this script is attached to. **Value:** [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) — The Agent this script is attached to if the script is on an avatar, null otherwise.
Remarks The Agent will be set before [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) is called.
### ObjectPrivate
```csharp signature [Sansar.Script.NonReflective] public ObjectPrivate ObjectPrivate { protected get; set; } ``` The ObjectPrivate this script is attached to if it is attached to an object. **Value:** [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) — The scene object this script is attached to if it is attached to an object, null otherwise.
Remarks For AgentScripts this is the Agent's ObjectPrivate of their avatar.
### ScenePublic
```csharp signature [Sansar.Script.NonReflective] public ScenePublic ScenePublic { protected get; set; } ``` Basic scene information for the current scene. **Value:** [ScenePublic](/scripting/api/sansar.simulation/scenepublic) — The Scene this object is in.
Remarks This value will be set before Init is called.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/agentscript --- # Animation Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Represents a scriptable Animation node. ```csharp public class Animation : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [GetFrameCount](#getframecount) · [GetName](#getname) · [GetParameters](#getparameters) · [IsPaused](#ispaused) · [JumpToFrame](#jumptoframe) · [Pause](#pause) · [Play](#play) · [Reset](#reset) · [SetParameters](#setparameters) | ## Methods ### GetFrameCount
```csharp signature public int GetFrameCount() ``` Gets the frame count of the animation **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Returns the total number of frames in the animation.
### GetName
```csharp signature public string GetName() ``` Gets the name of the animation **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — Returns the name of the animation.
### GetParameters
```csharp signature public AnimationParameters GetParameters() ``` Gets the last applied parameters for the animation **Returns:** [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) — Returns the current parameters.
### IsPaused
```csharp signature public bool IsPaused() ``` Gets whether or not the animation is paused. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — A bool value indicating the pause state.
### JumpToFrame
```csharp signature public void JumpToFrame(int frame) ``` Jump to frame. The animation will be set to the specified frame, and paused. | Parameter | Type | Description | |---|---|---| | `frame` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Frame to jump to. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong JumpToFrame( int frame, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Jump to frame. The animation will be set to the specified frame, and paused. | Parameter | Type | Description | |---|---|---| | `frame` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Frame to jump to. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void JumpToFrame( int frame, Action handler ) ``` Jump to frame. The animation will be set to the specified frame, and paused. | Parameter | Type | Description | |---|---|---| | `frame` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Frame to jump to. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
### Pause
```csharp signature public void Pause() ``` Pauses the animation.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Pause(Sansar.Script.ScriptBase.OperationComplete handler) ``` Pauses the animation. | Parameter | Type | Description | |---|---|---| | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Pause( Action handler ) ``` Pauses the animation. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
### Play
```csharp signature public void Play() ``` Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
Remarks If the animation has PlaybackMode.PlayOnce and has finished playing, this will have no effect, the animation will have to be reset with Reset() first. To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Play(Sansar.Script.ScriptBase.OperationComplete handler) ``` Plays the animation, without changing the current animation frame. | Parameter | Type | Description | |---|---|---| | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks If the animation has PlaybackMode.PlayOnce and has finished playing, this will have no effect, the animation will have to be reset with Reset() first. To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Play(AnimationParameters parameters) ``` Plays the animation and applies the provided parameters. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Play(Action handler) ``` Plays the animation. It will become the active animation for this object, and resume playing if it is paused. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks If the animation has PlaybackMode.PlayOnce and has finished playing, this will have no effect, the animation will have to be reset with Reset() first. To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Play( AnimationParameters parameters, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Plays the animation and applies the provided parameters. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Play( AnimationParameters parameters, Action handler ) ``` Plays the animation and applies the provided parameters. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
### Reset
```csharp signature public void Reset() ``` Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Reset(Sansar.Script.ScriptBase.OperationComplete handler) ``` Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled). | Parameter | Type | Description | |---|---|---| | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Reset(AnimationParameters parameters) ``` Resets the animation and applies the provided parameters. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Reset( Action handler ) ``` Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled). | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Reset( AnimationParameters parameters, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Resets the animation and applies the provided parameters. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void Reset( AnimationParameters parameters, Action handler ) ``` Resets the animation and applies the provided parameters. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
### SetParameters
```csharp signature public void SetParameters(AnimationParameters parameters) ``` Sets the parameters for the animation. The parameters are applied immediately. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. |
Remarks The range start frame will be clamped to the length of the animation, and the range end frame will be clamped between the range start frame and the end of the animation. To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetParameters( AnimationParameters parameters, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the parameters for the animation. The parameters are applied immediately. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks The range start frame will be clamped to the length of the animation, and the range end frame will be clamped between the range start frame and the end of the animation. To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void SetParameters( AnimationParameters parameters, Action handler ) ``` Sets the parameters for the animation. The parameters are applied immediately. | Parameter | Type | Description | |---|---|---| | `parameters` | [AnimationParameters](/scripting/api/sansar.simulation/animationparameters) | Animation parameters to apply. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The range start frame will be clamped to the length of the animation, and the range end frame will be clamped between the range start frame and the end of the animation. To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
## Used in examples - [AnimationExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AnimationExample.cs) - [ScriptLibrary/Scene/Animation.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Animation.cs) - [ScriptLibrary/Scene/Emote.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Emote.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animation --- # AnimationBoneSubset Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 39.1.0
Enumeration for different animation skeleton subsets ```csharp public enum AnimationBoneSubset ``` ## Values | Value | Description | |---|---| | `Full` Added in 39.1.0 | The full set of bones in the skeleton. | | `Subset1` Added in 39.1.0 | The first bone subset. This may not be defined for all animations. For agent animations this represents the upper body subset of bones. | ## Used in examples - [ScriptLibrary/Scene/Emote.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Emote.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animationbonesubset --- # AnimationComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The AnimationComponent handles interactions with animations. ```csharp public class AnimationComponent : Sansar.Script.InstanceInterface ``` ## Remarks Animated objects should be manipulated through this interface. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [DefaultAnimation](#defaultanimation) · [Name](#name) | | **Methods** | [EnqueueEvent](#enqueueevent) · [GetAnimation](#getanimation) · [GetAnimations](#getanimations) · [GetEventId](#geteventid) · [GetVectorAnimationVariable](#getvectoranimationvariable) · [HasEvent](#hasevent) · [SetPosition](#setposition) · [Subscribe](#subscribe) · [ToString](#tostring) | ## Fields ### ComponentType
```csharp signature public static readonly ComponentType ComponentType ``` The [`AnimationComponent.ComponentType`](/scripting/api/sansar.simulation/animationcomponent#componenttype) of this component
## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this AnimationComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
Remarks This id will be unique among all components.
### DefaultAnimation
```csharp signature public Animation DefaultAnimation { get; } ``` Gets the default scriptable animation. **Value:** [Animation](/scripting/api/sansar.simulation/animation) — An Animation object.
### Name
Added in 33.2.0
```csharp signature public string Name { get; } ``` This AnimationComponent name, as specified in the editor.
## Methods ### EnqueueEvent
```csharp signature public void EnqueueEvent(int internalId) ``` Enqueues an event for this component. | Parameter | Type | Description | |---|---|---| | `internalId` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The id of the animation event, may be looked up by name from [`AnimationComponent.GetEventId`](/scripting/api/sansar.simulation/animationcomponent#geteventid) |
Remarks Ids can be retrieved with [`AnimationComponent.GetEventId`](/scripting/api/sansar.simulation/animationcomponent#geteventid).
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong EnqueueEvent( int internalId, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Enqueues an event for this component. | Parameter | Type | Description | |---|---|---| | `internalId` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The id of the animation event, may be looked up by name from [`AnimationComponent.GetEventId`](/scripting/api/sansar.simulation/animationcomponent#geteventid) | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The internal event id for the completion event.
Remarks Ids can be retrieved with [`AnimationComponent.GetEventId`](/scripting/api/sansar.simulation/animationcomponent#geteventid).
```csharp signature public void EnqueueEvent( int internalId, Action handler ) ``` Enqueues an event for this component. | Parameter | Type | Description | |---|---|---| | `internalId` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The id of the animation event, may be looked up by name from [`AnimationComponent.GetEventId`](/scripting/api/sansar.simulation/animationcomponent#geteventid) | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Ids can be retrieved with [`AnimationComponent.GetEventId`](/scripting/api/sansar.simulation/animationcomponent#geteventid).
### GetAnimation
```csharp signature public Animation GetAnimation(string animationName) ``` Finds a scriptable animations by name. | Parameter | Type | Description | |---|---|---| | `animationName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the animation. | **Returns:** [Animation](/scripting/api/sansar.simulation/animation) — An Animation, or null if no animation was found with the correct name.
### GetAnimations
```csharp signature public IEnumerable GetAnimations() ``` Gets the scriptable animations for this object. **Returns:** [IEnumerable<Animation>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumarable collection of animation objects.
### GetEventId
```csharp signature public int GetEventId(string eventName) ``` Lookup the event id for the named event. | Parameter | Type | Description | |---|---|---| | `eventName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the event to query. | **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The id of the named event or -1 if the name is not valid.
Remarks This can be used to trigger animations with [`AnimationComponent.EnqueueEvent`](/scripting/api/sansar.simulation/animationcomponent#enqueueevent-int32).
### GetVectorAnimationVariable
```csharp signature public Sansar.Vector GetVectorAnimationVariable(string variableName) ``` Get a Vector type variable from the animation by name | Parameter | Type | Description | |---|---|---| | `variableName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the animation variable | **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — A Mono.Simd.Vector4f of the value of the named variable **Throws** [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): Thrown when attempting to get a variable that doesn't exist or is of the wrong type **Throws** [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): If variableName is null
Remarks Characters have an 'LLCameraForward' variable which can be queried with GetVectorAnimationVariable to determine the forward vector of the camera.
### HasEvent
```csharp signature public bool HasEvent(string eventName) ``` Check this component for the existence of the named event. | Parameter | Type | Description | |---|---|---| | `eventName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the event to query. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the event exits.
Remarks Can be used to check if an event exists.
### SetPosition
```csharp signature public void SetPosition(Sansar.Vector position) ``` Asynchronously set the position for this object. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The Mono.Simd.Vector4f position desired. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetPosition( Sansar.Vector position, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Asynchronously set the position for this object. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The Mono.Simd.Vector4f position desired. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — Returns an internal event id.
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
```csharp signature public void SetPosition( Sansar.Vector position, Action handler ) ``` Asynchronously set the position for this object. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The Mono.Simd.Vector4f position desired. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks To block until the method returns pass this to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-func-2) in a coroutine.
### Subscribe
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", true)] public void Subscribe( string BehaviorName, AnimationComponent.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Animation Events. | Parameter | Type | Description | |---|---|---| | `BehaviorName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The behavior name of the Animation. This name will match the subscribed event. | | `callback` | [AnimationComponent.SubscriptionHandler](/scripting/api/sansar.simulation/animationcomponent.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( string BehaviorName, Action callback, bool persistent ) ``` Subscribes to Animation Events. | Parameter | Type | Description | |---|---|---| | `BehaviorName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The behavior name of the Animation. This name will match the subscribed event. | | `callback` | [Action<AnimationData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [AnimationExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AnimationExample.cs) - [ScriptLibrary/Scene/Animation.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Animation.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animationcomponent --- # AnimationComponent.SubscriptionHandler Kind: Delegate · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Delegate Namespace Sansar.Simulation
Animation events. ```csharp [System.Obsolete("Use subscription callbacks of type Action", false)] public delegate void AnimationComponent.SubscriptionHandler( string BehaviorName, Sansar.Script.ComponentId ComponentId ) ``` | Parameter | Type | Description | |---|---|---| | `BehaviorName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The behavior name of the Animation. This name will match the subscribed event. | | `ComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the animation component. | ## Remarks See [`AnimationComponent`](/scripting/api/sansar.simulation/animationcomponent).

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animationcomponent.subscriptionhandler --- # AnimationData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Animation events. ```csharp public class AnimationData : Sansar.Script.EventData ``` ## Remarks See [`AnimationComponent`](/scripting/api/sansar.simulation/animationcomponent). For input bindings see [`CommandData`](/scripting/api/sansar.simulation/commanddata) ## Members at a glance | Kind | Members | |---|---| | **Properties** | [BehaviorName](#behaviorname) · [ComponentId](#componentid) | | **Methods** | [ToString](#tostring) | ## Properties ### BehaviorName
```csharp signature public string BehaviorName { get; } ``` The behavior name of the Animation. This name will match the subscribed event.
### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` The id of the animation component.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animationdata --- # AnimationParameters Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
The AnimationParameters struct contains settings for playing animations. ```csharp public struct AnimationParameters ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [BlendDuration](#blendduration) · [ClampToRange](#clamptorange) · [PlaybackMode](#playbackmode) · [PlaybackSpeed](#playbackspeed) · [RangeEndFrame](#rangeendframe) · [RangeStartFrame](#rangestartframe) | ## Fields ### BlendDuration
```csharp signature public float BlendDuration ``` Time in seconds taken to blend to this animation.
Remarks The default value is 0.
### ClampToRange
```csharp signature public bool ClampToRange ``` If true, clamp the animation frames to the range specified by rangeStartFrame and rangeLength. If false, play the whole animation.
Remarks The default is false.
### PlaybackMode
```csharp signature public AnimationPlaybackMode PlaybackMode ``` Animation playback mode.
Remarks Default is Looping.
### PlaybackSpeed
```csharp signature public float PlaybackSpeed ``` Animation playback speed. Negative values will play the animation backwards.
Remarks The default is 1.0.
### RangeEndFrame
```csharp signature public int RangeEndFrame ``` End frame to use when clamping animation range. This should always be greater or equal to the range start frame.
Remarks The default value is 0.
### RangeStartFrame
```csharp signature public int RangeStartFrame ``` Start frame to use when clamping animation range.
Remarks The default value is 0.
## Used in examples - [AnimationExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AnimationExample.cs) - [ScriptLibrary/Scene/Animation.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Animation.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animationparameters --- # AnimationPlaybackMode Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Enumeration for the different animation playback modes ```csharp public enum AnimationPlaybackMode ``` ## Values | Value | Description | |---|---| | `Loop` | Loop indefinitely. | | `PingPong` | Play indefinitely, alternating between forwards and backwards. | | `PlayOnce` | Play once then stop. | ## Used in examples - [AnimationExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AnimationExample.cs) - [ScriptLibrary/Scene/Emote.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Emote.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/animationplaybackmode --- # AudioComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The AudioComponent handles interactions with audio components. ```csharp public class AudioComponent : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [Name](#name) | | **Methods** | [PlaySoundOnComponent](#playsoundoncomponent) · [PlayStreamOnComponent](#playstreamoncomponent) · [ToString](#tostring) | ## Fields ### ComponentType
```csharp signature public static readonly ComponentType ComponentType ``` The [`AudioComponent.ComponentType`](/scripting/api/sansar.simulation/audiocomponent#componenttype) of this component
## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this AudioComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### Name
Added in 33.2.0
```csharp signature public string Name { get; } ``` This AudioComponent name, as specified in the editor.
## Methods ### PlaySoundOnComponent
```csharp signature public PlayHandle PlaySoundOnComponent( SoundResource soundResource, PlaySettings playSettings ) ``` Play sound on this component (and follow its position). | Parameter | Type | Description | |---|---|---| | `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. | | `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for all agents in this scene. As the component moves, this sound will follow the component's location.
### PlayStreamOnComponent
```csharp signature public PlayHandle PlayStreamOnComponent( StreamChannel streamChannel, float loudness ) ``` Play web audio stream on this component (and follow its position). | Parameter | Type | Description | |---|---|---| | `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. | | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for all agents in this scene. As the component moves, this stream will follow the component's location.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Scene/AudioStream.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/AudioStream.cs) - [ScriptLibrary/Scene/Sound.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Sound.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/audiocomponent --- # CameraComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 37.0.0
The CameraComponent handles interactions with cameras. ```csharp public class CameraComponent : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [Name](#name) | | **Methods** | [ToString](#tostring) | ## Fields ### ComponentType
Added in 37.0.0
```csharp signature public static readonly ComponentType ComponentType ``` The [`CameraComponent.ComponentType`](/scripting/api/sansar.simulation/cameracomponent#componenttype) of this component
## Properties ### ComponentId
Added in 37.0.0
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this CameraComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### Name
Added in 37.0.0
```csharp signature public string Name { get; } ``` This CameraComponent name, as specified in the editor.
## Methods ### ToString
Added in 37.0.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - `CameraShakeExample.cs` - [InteractionScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionScreenshot.cs) - [ScriptLibrary/Scene/Screenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Screenshot.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/cameracomponent --- # CameraControlMode Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Type of camera mode a user is in. ```csharp public enum CameraControlMode ``` ## Values | Value | Description | |---|---| | `FirstPerson` | First person camera mode, looking out from your avatar's position. | | `FlyCam` | A camera mode detached from the avatar. Also referred to as Free Cam. | | `None` | Invalid camera control mode. | | `Script` Added in 37.0.0 | Camera is being set by a script. | | `ThirdPerson` | Over the shoulder 3rd person camera mode. | ## Used in examples - [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/cameracontrolmode --- # CameraShakeHandle Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation New in 47.10.0
Stops a shake requested by the creating script; it does not report client playback. ```csharp public sealed class CameraShakeHandle ``` ## Remarks Player comfort settings, VR limits, distance, expiry or capacity can reduce or suppress playback. A shake ends when the player leaves the world. Passing a handle to another script does not grant control. Garbage collection does not stop the shake. ## Members at a glance | Kind | Members | |---|---| | **Methods** | [Stop](#stop) New in 47.10.0 | ## Methods ### Stop
New in 47.10.0
```csharp signature public void Stop(float fadeOut) ``` Stops this shake with a fade in seconds; 0 stops immediately. | Parameter | Type | Description | |---|---|---| | `fadeOut` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Ending fade in seconds, clamped to 0 through 5; defaults to 0.1. |
Remarks Only the creating script can stop this request. Repeated calls have no effect and do not prolong a fade. Stopping an inert or expired request has no visual effect.
## Used in examples - `CameraShakeExample.cs`

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/camerashakehandle --- # CameraShakePattern Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation New in 47.10.0
Selects the motion used by a camera shake. ```csharp public enum CameraShakePattern ``` ## Values | Value | Description | |---|---| | `Impact` New in 47.10.0 | A directional kick followed by a damped return and wobble. | | `Jitter` New in 47.10.0 | Sharp random motion that changes at the selected frequency. | | `Rumble` New in 47.10.0 | Smooth, independently varying random motion. | | `Sway` New in 47.10.0 | Smooth back-and-forth motion along the selected direction. | ## Used in examples - `CameraShakeExample.cs`

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/camerashakepattern --- # CameraShakeSettings Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation New in 47.10.0
Configures a camera shake; changes affect subsequent starts only. ```csharp public sealed class CameraShakeSettings ``` ## Remarks Starts snapshot these settings and apply the documented bounds. Player comfort settings and VR limits can reduce or suppress any shake. A shake ends when the player leaves the world. ```csharp title="CameraShakeExample.cs" /* This example is licensed under the Creative Commons Attribution 4.0 International License. * Copyright 2026 Sansar, Inc. https://creativecommons.org/licenses/by/4.0/ */ using System; using System.Collections.Generic; using Sansar; using Sansar.Script; using Sansar.Simulation; /// Demonstrates camera shake with chat commands on the default channel. /// Use /shake rumble, jitter, sway, impact, near, engine or stop. /// Engine toggles a continuous rumble for the sender; stop clears this script's shakes for everyone. /// An optional CameraComponent on this object fixes the view for current and future users. /// Player comfort settings and VR limits can reduce or suppress the motion. public class CameraShakeExample : SceneObjectScript { private CameraComponent camera; private readonly Dictionary engines = new Dictionary(); /// Sets up chat commands and the optional fixed camera. public override void Init() { ObjectPrivate.TryGetFirstComponent(out camera); ScenePrivate.User.Subscribe(User.AddUser, OnUserAdded); ScenePrivate.User.Subscribe(User.RemoveUser, OnUserRemoved); ScenePrivate.Chat.Subscribe(Chat.DefaultChannel, OnChat, true); // Script reloads also need to set up users who are already in the world. foreach (AgentPrivate agent in ScenePrivate.GetAgents()) { SetCamera(agent); } // The Debug local-source live test requires this marker from the real body. Log.Write("CameraShakeExample ready (real shake body): /shake rumble, jitter, sway, impact, near, engine, stop"); } private void SetCamera(AgentPrivate agent) { if (camera != null && agent != null && agent.IsValid) { agent.Client.SetActiveCamera(camera, ScriptCameraControlMode.AgentControlOnly); } } private void OnUserAdded(UserData data) { SetCamera(ScenePrivate.FindAgent(data.User)); } private void OnUserRemoved(UserData data) { // Leaving the world ends that player's shake; discard the old session's handle. engines.Remove(data.User); } private bool StopEngine(SessionId sessionId) { CameraShakeHandle engine; if (!engines.TryGetValue(sessionId, out engine)) { return false; } engine.Stop(0.25f); engines.Remove(sessionId); return true; } private void OnChat(ChatData data) { string[] words = data.Message.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (words.Length != 2 || !words[0].Equals("/shake", StringComparison.OrdinalIgnoreCase)) { return; } // SourceId identifies the sender, rather than the object running this script. AgentPrivate agent = ScenePrivate.FindAgent(data.SourceId); if (agent == null || !agent.IsValid) { return; } SessionId sessionId = agent.AgentInfo.SessionId; switch (words[1].ToLowerInvariant()) { case "rumble": // Presets are mutable: edit before starting. Starts snapshot the settings. CameraShakeSettings rumble = CameraShakeSettings.Earthquake(); rumble.Direction = new Vector(1, 0.5f, 0); agent.Client.ShakeCamera(rumble); break; case "jitter": agent.Client.ShakeCamera(new CameraShakeSettings { Pattern = CameraShakePattern.Jitter, Magnitude = 0.25f, Duration = 1.0f // Frequency 0 uses Jitter's default of 20 Hz. }); break; case "sway": // Long side-to-side motion for the fixed-camera pixel-displacement test. agent.Client.ShakeCamera(new CameraShakeSettings { Pattern = CameraShakePattern.Sway, Magnitude = 0.6f, Frequency = 2.0f, Duration = 6.0f, Direction = new Vector(1, 0, 0), FadeOut = 0.3f }); break; case "impact": // Landing: one downward kick. Duration 0 would still give just one kick. agent.Client.ShakeCamera(CameraShakeSettings.Impact(new Vector(0, -1, 0))); break; case "near": // Only players present now receive this explosion. Their camera distance // from this object's world position controls falloff to zero at 20 meters. ScenePrivate.ShakeCameraAtPosition(ObjectPrivate.Position, 20.0f, CameraShakeSettings.Explosion()); break; case "engine": // Send again to stop; separate sessions retain separate handles. if (!StopEngine(sessionId)) { engines[sessionId] = agent.Client.ShakeCamera(CameraShakeSettings.EngineRumble()); } break; case "stop": StopEngine(sessionId); // Both stop-all scopes affect only shakes requested by this script. agent.Client.StopAllCameraShakes(); ScenePrivate.StopAllCameraShakes(); engines.Clear(); break; } } } ```

Source: Examples/CameraShakeExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Constructors** | [CameraShakeSettings](#camerashakesettings) New in 47.10.0 | | **Properties** | [Direction](#direction) New in 47.10.0 · [Duration](#duration) New in 47.10.0 · [FadeOut](#fadeout) New in 47.10.0 · [Frequency](#frequency) New in 47.10.0 · [Magnitude](#magnitude) New in 47.10.0 · [Pattern](#pattern) New in 47.10.0 | | **Methods** | [Earthquake](#earthquake) New in 47.10.0 · [EngineRumble](#enginerumble) New in 47.10.0 · [Explosion](#explosion) New in 47.10.0 · [Impact](#impact) New in 47.10.0 | ## Constructors ### CameraShakeSettings
New in 47.10.0
```csharp signature public CameraShakeSettings() ``` Creates a one-second rumble with moderate magnitude.
Remarks Frequency 0 selects 6 Hz; magnitude is 0.35, direction is (1,1,1) and fade-out is 0.15 seconds.
## Properties ### Direction
New in 47.10.0
```csharp signature public Sansar.Vector Direction { get; set; } ``` Gets or sets camera-space right/up/forward weights; the default is (1,1,1).
Remarks X is right, Y is up and Z is forward; W is ignored. Weights are clamped to \[-1,1\] and vectors longer than 1 are normalized. Zero gives no motion. Signs select the first kick or half-cycle for Impact or Sway.
### Duration
New in 47.10.0
```csharp signature public float Duration { get; set; } ``` Gets or sets duration in seconds; 0 means until stopped.
Remarks The default is 1 second. Values are clamped to 0 through 600; positive values below 0.05 become 0.05. Retain the handle for continuous effects. Impact with Duration 0 is still one decaying kick.
### FadeOut
New in 47.10.0
```csharp signature public float FadeOut { get; set; } ``` Gets or sets the ending fade in seconds; the default is 0.15.
Remarks Clamped to 0 through 5 seconds and shortened to fit Duration. The fade is included in Duration. For Duration 0, Stop specifies the fade.
### Frequency
New in 47.10.0
```csharp signature public float Frequency { get; set; } ``` Gets or sets frequency in Hz; 0 selects the pattern default.
Remarks Defaults are 6 Hz for Rumble, 20 for Jitter, 1.5 for Sway and 5 for Impact. Other values are clamped to 0.1 through 30 Hz.
### Magnitude
New in 47.10.0
```csharp signature public float Magnitude { get; set; } ``` Gets or sets relative strength from 0 to 1; the default is 0.35.
Remarks Values are clamped to this range. This is a relative amount, not a physical impulse.
### Pattern
New in 47.10.0
```csharp signature public CameraShakePattern Pattern { get; set; } ``` Gets or sets the motion pattern; the default is Rumble.
Remarks Choose Rumble, Jitter, Sway or Impact.
## Methods ### Earthquake
New in 47.10.0
```csharp signature public static CameraShakeSettings Earthquake( float magnitude, float duration ) ``` Creates a slow rumble suitable for an earthquake. | Parameter | Type | Description | |---|---|---| | `magnitude` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative strength from 0 to 1; defaults to 0.35. | | `duration` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Duration in seconds; defaults to 5. Use 0 for until stopped. | **Returns:** [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) — A fresh, mutable settings object.
Remarks Uses 3 Hz and fade-out 0.8 seconds. Edit settings before starting.
### EngineRumble
New in 47.10.0
```csharp signature public static CameraShakeSettings EngineRumble(float magnitude) ``` Creates a subtle continuous rumble; retain its handle to stop it. | Parameter | Type | Description | |---|---|---| | `magnitude` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative strength from 0 to 1; defaults to 0.12. | **Returns:** [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) — A fresh, mutable settings object.
Remarks Uses 16 Hz and Duration 0, until stopped. Edit settings before starting.
### Explosion
New in 47.10.0
```csharp signature public static CameraShakeSettings Explosion(float magnitude) ``` Creates a short, strong rumble suitable for an explosion. | Parameter | Type | Description | |---|---|---| | `magnitude` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative strength from 0 to 1; defaults to 0.7. | **Returns:** [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) — A fresh, mutable settings object.
Remarks Uses 12 Hz, duration 0.65 seconds and fade-out 0.55 seconds. Edit settings before starting.
### Impact
New in 47.10.0
```csharp signature public static CameraShakeSettings Impact( Sansar.Vector direction, float magnitude ) ``` Creates one kick in the given camera-space right/up/forward direction. | Parameter | Type | Description | |---|---|---| | `direction` | [Sansar.Vector](/scripting/api/sansar/vector) | Camera-space right/up/forward weights; W is ignored. | | `magnitude` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative strength from 0 to 1; defaults to 0.5. | **Returns:** [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) — A fresh, mutable settings object.
Remarks Uses 5 Hz and duration 0.45 seconds. Changing Duration to 0 still gives only one decaying kick.
## Used in examples - `CameraShakeExample.cs`

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/camerashakesettings --- # CharacterAnimation Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The CharacterAnimation class represents an animation that can be played on a character component. ```csharp public class CharacterAnimation : Sansar.Script.InstanceInterface ``` ## Used in examples - [ScriptLibrary/Scene/Emote.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Emote.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/characteranimation --- # CharacterComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 39.1.0
The CharacterComponent handles character specific operations like playing CharacterAnimations. ```csharp public class CharacterComponent : Sansar.Script.InstanceInterface ``` ## Remarks Allows for doing operations specific to characters using the Sansar skeleton types ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [UsingFemaleSkeleton](#usingfemaleskeleton) · [UsingMaleSkeleton](#usingmaleskeleton) | | **Methods** | [PlayAnimation](#playanimation) · [StopAnimations](#stopanimations) · [ToString](#tostring) | ## Fields ### ComponentType
Added in 39.1.0
```csharp signature public static readonly ComponentType ComponentType ``` The [`CharacterComponent.ComponentType`](/scripting/api/sansar.simulation/charactercomponent#componenttype) of this component
## Properties ### ComponentId
Added in 39.1.0
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this CharacterComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### UsingFemaleSkeleton
Added in 39.1.0
```csharp signature public bool UsingFemaleSkeleton { get; } ``` Retrieves whether or not the avatar is using the female skeleton for this CharacterComponent. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not the avatar is using the female skeleton
### UsingMaleSkeleton
Added in 39.1.0
```csharp signature public bool UsingMaleSkeleton { get; } ``` Retrieves whether or not the avatar is using the male skeleton for this CharacterComponent. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not the avatar is using the male skeleton
## Methods ### PlayAnimation
Added in 39.1.0
```csharp signature public void PlayAnimation( CharacterAnimation animation, AnimationPlaybackMode playbackMode, AnimationBoneSubset skeletonSubset ) ``` Plays an animation in server time synchronously for this CharacterComponent. If you want multiple agent's to play an animation together, use this function | Parameter | Type | Description | |---|---|---| | `animation` | [CharacterAnimation](/scripting/api/sansar.simulation/characteranimation) | The animation to play on the agent. | | `playbackMode` | [AnimationPlaybackMode](/scripting/api/sansar.simulation/animationplaybackmode) | How to play the animation. Only PlayOnce and Loop supported. | | `skeletonSubset` | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | Which subset of the skeleton to play the animation on. |
Remarks This asynchronous method queues the write then returns.
Added in 39.1.0
```csharp signature public void PlayAnimation( CharacterAnimation animation, AnimationPlaybackMode playbackMode, AnimationBoneSubset skeletonSubset, Action handler ) ``` Plays an animation in server time synchronously for this CharacterComponent. If you want multiple agent's to play an animation together, use this function | Parameter | Type | Description | |---|---|---| | `animation` | [CharacterAnimation](/scripting/api/sansar.simulation/characteranimation) | The animation to play on the agent. | | `playbackMode` | [AnimationPlaybackMode](/scripting/api/sansar.simulation/animationplaybackmode) | How to play the animation. Only PlayOnce and Loop supported. | | `skeletonSubset` | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | Which subset of the skeleton to play the animation on. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns.
Added in 39.1.0
```csharp signature public void PlayAnimation( CharacterAnimation animation, AnimationPlaybackMode playbackMode, AnimationBoneSubset skeletonSubset, float playbackSpeed ) ``` Plays an animation in server time synchronously for this CharacterComponent. If you want multiple agent's to play an animation together, use this function | Parameter | Type | Description | |---|---|---| | `animation` | [CharacterAnimation](/scripting/api/sansar.simulation/characteranimation) | The animation to play on the agent. | | `playbackMode` | [AnimationPlaybackMode](/scripting/api/sansar.simulation/animationplaybackmode) | How to play the animation. Only PlayOnce and Loop supported. | | `skeletonSubset` | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | Which subset of the skeleton to play the animation on. | | `playbackSpeed` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Animation playback speed. Must be betweeen 0.1 and 10. |
Remarks This asynchronous method queues the write then returns.
Added in 39.1.0
```csharp signature public void PlayAnimation( CharacterAnimation animation, AnimationPlaybackMode playbackMode, AnimationBoneSubset skeletonSubset, float playbackSpeed, Action handler ) ``` Plays an animation in server time synchronously for this CharacterComponent. If you want multiple agent's to play an animation together, use this function | Parameter | Type | Description | |---|---|---| | `animation` | [CharacterAnimation](/scripting/api/sansar.simulation/characteranimation) | The animation to play on the agent. | | `playbackMode` | [AnimationPlaybackMode](/scripting/api/sansar.simulation/animationplaybackmode) | How to play the animation. Only PlayOnce and Loop supported. | | `skeletonSubset` | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | Which subset of the skeleton to play the animation on. | | `playbackSpeed` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Animation playback speed. Must be betweeen 0.1 and 10. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns.
### StopAnimations
Added in 39.1.0
```csharp signature public void StopAnimations() ``` Stops all animations in server time synchronously for this CharacterComponent. If you want multiple agent's to stop animations together, use this function
Remarks This asynchronous method queues the write then returns.
Added in 39.1.0
```csharp signature public void StopAnimations(AnimationBoneSubset skeletonSubset) ``` Stops all animations in server time synchronously for this CharacterComponent. If you want multiple agent's to stop animations together, use this function | Parameter | Type | Description | |---|---|---| | `skeletonSubset` | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | All Animations for this skeleton subset will be stopped. |
Remarks This asynchronous method queues the write then returns.
Added in 39.1.0
```csharp signature public void StopAnimations( Action handler ) ``` Stops all animations in server time synchronously for this CharacterComponent. If you want multiple agent's to stop animations together, use this function | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns.
Added in 39.1.0
```csharp signature public void StopAnimations( AnimationBoneSubset skeletonSubset, Action handler ) ``` Stops all animations in server time synchronously for this CharacterComponent. If you want multiple agent's to stop animations together, use this function | Parameter | Type | Description | |---|---|---| | `skeletonSubset` | [AnimationBoneSubset](/scripting/api/sansar.simulation/animationbonesubset) | All Animations for this skeleton subset will be stopped. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns.
### ToString
Added in 39.1.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Scene/Emote.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Emote.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/charactercomponent --- # CharacterTracker Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 36.0.1
The CharacterTracker keeps track of the quests associated with a QuestCharacter for a user. ```csharp public class CharacterTracker : Sansar.Script.InstanceInterface ``` ## Remarks There is as yet no way to create Quest Characters, but this functionality is coming soon. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ActiveQuestCount](#activequestcount) · [ActiveQuestDefinitions](#activequestdefinitions) · [AvailableQuestCount](#availablequestcount) · [AvailableQuestDefinitions](#availablequestdefinitions) · [CanTurnInQuestCount](#canturninquestcount) · [CanTurnInQuestDefinitions](#canturninquestdefinitions) · [SessionId](#sessionid) | | **Methods** | [Subscribe](#subscribe) · [ToString](#tostring) · [Update](#update) | ## Properties ### ActiveQuestCount
Added in 36.7.0
```csharp signature public int ActiveQuestCount { get; } ``` Number of this character's quests currently active for this user.
### ActiveQuestDefinitions
Added in 36.5.0
```csharp signature public QuestDefinition[] ActiveQuestDefinitions { get; } ``` Currently active quests.
### AvailableQuestCount
Added in 36.7.0
```csharp signature public int AvailableQuestCount { get; } ``` umber of this character's quests currently available for this user.
### AvailableQuestDefinitions
Added in 36.5.0
```csharp signature public QuestDefinition[] AvailableQuestDefinitions { get; } ``` Quests that are available to be offered.
### CanTurnInQuestCount
Added in 36.7.0
```csharp signature public int CanTurnInQuestCount { get; } ``` umber of this character's quests ready to be turned in for this user.
### CanTurnInQuestDefinitions
Added in 36.5.0
```csharp signature public QuestDefinition[] CanTurnInQuestDefinitions { get; } ``` Quests that are ready to be turned in to this character.
### SessionId
Added in 36.0.1
```csharp signature public Sansar.Script.SessionId SessionId { get; } ``` The session Id for the user being tracked.
## Methods ### Subscribe
Added in 36.0.1
```csharp signature public Sansar.Script.IEventSubscription Subscribe( Action callback, bool persistent ) ``` Subscribes to CharacterTracker Events. | Parameter | Type | Description | |---|---|---| | `callback` | [Action<CharacterTrackerData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### ToString
Added in 36.0.1
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### Update
Added in 36.0.1
```csharp signature public void Update() ``` Update the CharacterTracker data.
Remarks Use in a WaitFor to wait for the data for the CharacterTracker to be ready. Once data is retrieved and Ready is true it will never again be false.
Added in 36.0.1
```csharp signature public void Update( Action handler ) ``` Update the CharacterTracker data. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Use in a WaitFor to wait for the data for the CharacterTracker to be ready. Once data is retrieved and Ready is true it will never again be false.
## Used in examples - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/charactertracker --- # CharacterTrackerData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData Added in 36.0.1
Handler for Character Tracker update events. ```csharp public class CharacterTrackerData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [SessionId](#sessionid) | | **Methods** | [ToString](#tostring) | ## Properties ### SessionId
Added in 36.0.1
```csharp signature public Sansar.Script.SessionId SessionId { get; } ``` The SessionId of the agent on the quest.
## Methods ### ToString
Added in 36.0.1
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/charactertrackerdata --- # Chat Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The Chat class handles chat subscriptions and sending messages to users and other scripts. ```csharp public class Chat : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [AllChannels](#allchannels) · [DefaultChannel](#defaultchannel) · [Script](#script) · [Server](#server) · [User](#user) | | **Methods** | [MessageAllUsers](#messageallusers) · [MessageScript](#messagescript) · [Subscribe](#subscribe) | ## Fields ### AllChannels
Deprecated
```csharp signature [System.Obsolete("All channel subscription no longer allowed", false)] public static readonly int AllChannels ``` Use as the channel argument for [`Chat.Subscribe`](/scripting/api/sansar.simulation/chat#subscribe-int32-string-action-boolean) to subscribe to all channels.
Remarks No longer in use, now the same behavior as DefaultChannel
### DefaultChannel
```csharp signature public static readonly int DefaultChannel ``` Use as the channel argument for [`Chat.Subscribe`](/scripting/api/sansar.simulation/chat#subscribe-int32-string-action-boolean) to subscribe to the default channel
### Script
```csharp signature public static readonly string Script ``` Indicates that the chat message originated from a script.
### Server
```csharp signature public static readonly string Server ``` Indicates that the chat message originated from the server.
### User
```csharp signature public static readonly string User ``` Indicates that the chat message originated from a user.
## Methods ### MessageAllUsers
```csharp signature public void MessageAllUsers(string message) ``` Send a chat message to every user in the Experience. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. |
Remarks Messages may be throttled.
```csharp signature public void MessageAllUsers( string message, Action handler ) ``` Send a chat message to every user in the Experience. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Messages may be throttled.
### MessageScript
```csharp signature public void MessageScript( string message, Sansar.Script.ScriptId scriptId, int channel ) ``` Send a string message to a specific script. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | | `scriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | The id of the script to send the message to. | | `channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | The channel to send the message on. |
Remarks Only the script with the matching id will receive the message.
### Subscribe
```csharp signature public Sansar.Script.IEventSubscription Subscribe( Sansar.Script.ScriptId SourceScriptId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( Sansar.Script.SessionId SourceId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( string Source, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, Sansar.Script.ScriptId SourceScriptId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, Sansar.Script.SessionId SourceId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( int Channel, string Source, Chat.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `callback` | [Chat.SubscriptionHandler](/scripting/api/sansar.simulation/chat.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, string Source, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( string Source, Sansar.Script.ScriptId SourceScriptId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription Subscribe( string Source, Sansar.Script.SessionId SourceId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( int Channel, string Source, Sansar.Script.ScriptId SourceScriptId, Chat.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Chat.SubscriptionHandler](/scripting/api/sansar.simulation/chat.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, string Source, Sansar.Script.ScriptId SourceScriptId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( int Channel, string Source, Sansar.Script.SessionId SourceId, Chat.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `callback` | [Chat.SubscriptionHandler](/scripting/api/sansar.simulation/chat.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, string Source, Sansar.Script.SessionId SourceId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( int Channel, string Source, Sansar.Script.SessionId SourceId, Sansar.Script.ScriptId SourceScriptId, Chat.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Chat.SubscriptionHandler](/scripting/api/sansar.simulation/chat.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( int Channel, string Source, Sansar.Script.SessionId SourceId, Sansar.Script.ScriptId SourceScriptId, Action callback, bool persistent ) ``` Subscribes to Chat Events. | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `callback` | [Action<ChatData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - `ColorLutExample.cs` - [CoroutineEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineEventExample.cs) - [CoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineExample.cs) - [GravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/GravityExample.cs) - [MediaOverrideExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MediaOverrideExample.cs) - [MemoryExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MemoryExample.cs) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) …and 5 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/chat --- # Chat.SubscriptionHandler Kind: Delegate · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Delegate Namespace Sansar.Simulation
Subscribe to receive events on chat messages from the system, users or scripts. ```csharp [System.Obsolete("Use subscription callbacks of type Action", false)] public delegate void Chat.SubscriptionHandler( int Channel, string Source, Sansar.Script.SessionId SourceId, Sansar.Script.ScriptId SourceScriptId, string Message ) ``` | Parameter | Type | Description | |---|---|---| | `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. | | `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. | | `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. | | `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. | | `Message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string message of the chat event. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/chat.subscriptionhandler --- # ChatData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Subscribe to receive events on chat messages from the system, users or scripts. ```csharp public class ChatData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Channel](#channel) · [Message](#message) · [Source](#source) · [SourceId](#sourceid) · [SourceScriptId](#sourcescriptid) | | **Methods** | [ToString](#tostring) | ## Properties ### Channel
```csharp signature public int Channel { get; } ``` int channel which the chat occurs on.
### Message
```csharp signature public string Message { get; } ``` string message of the chat event.
### Source
```csharp signature public string Source { get; } ``` string source of the chat: system, user or script.
### SourceId
```csharp signature public Sansar.Script.SessionId SourceId { get; } ``` Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent.
### SourceScriptId
```csharp signature public Sansar.Script.ScriptId SourceScriptId { get; } ``` Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - `CameraShakeExample.cs` - `ColorLutExample.cs` - [GravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/GravityExample.cs) - [MediaOverrideExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MediaOverrideExample.cs) - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Scene/ChatCommand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/ChatCommand.cs) - `TimeOfDayExample.cs`

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/chatdata --- # Client Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The Client class is used for access to the Client connected to a [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate). ```csharp public class Client : Sansar.Script.InstanceInterface ``` ## Remarks This class is also used for receiving input events from a client. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentInfo](#agentinfo) · [InVrAndHandsActive](#invrandhandsactive) · [UI](#ui) | | **Methods** | [CaptureImage](#captureimage) · [ClearTutorialHint](#cleartutorialhint) · [EnableAutomaticTutorialHints](#enableautomatictutorialhints) · [GetActiveCamera](#getactivecamera) · [OpenQuestCharacterDialog](#openquestcharacterdialog) · [OpenStoreListing](#openstorelisting) · [OpenUserStore](#openuserstore) · [ResetCamera](#resetcamera) · [SendChat](#sendchat) · [SetActiveCamera](#setactivecamera) · [ShakeCamera](#shakecamera) New in 47.10.0 · [ShowTutorialHint](#showtutorialhint) · [StopAllCameraShakes](#stopallcamerashakes) New in 47.10.0 · [SubscribeToCommand](#subscribetocommand) · [SubscribeToTwitch](#subscribetotwitch) · [TeleportTo](#teleportto) · [TeleportToCharacterEditor](#teleporttocharactereditor) · [TeleportToLocation](#teleporttolocation) · [TeleportToLookbook](#teleporttolookbook) · [TeleportToUri](#teleporttouri) · [ToString](#tostring) · [VibrationPulse](#vibrationpulse) | ## Properties ### AgentInfo
```csharp signature public AgentInfo AgentInfo { get; } ``` Returns the [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance. **Value:** [AgentInfo](/scripting/api/sansar.simulation/agentinfo) — The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance
Remarks The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) holds information about an agent.
### InVrAndHandsActive
Added in 39.1.0
```csharp signature public bool InVrAndHandsActive { get; } ``` Retrieves whether or not this Client is using a VR headset and using hand tracking controllers currently. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not this Client is using a VR headset and using hand tracking controllers currently.
### UI
```csharp signature public UI UI { get; } ``` Returns the [`UI`](/scripting/api/sansar.simulation/ui) for this instance. **Value:** [UI](/scripting/api/sansar.simulation/ui) — The [`UI`](/scripting/api/sansar.simulation/ui) for this instance
Remarks The [`UI`](/scripting/api/sansar.simulation/ui) for this instance.
## Methods ### CaptureImage
Added in 43.2.1
```csharp signature public void CaptureImage(CameraComponent component) ``` Take a image from the camera point of view | Parameter | Type | Description | |---|---|---| | `component` | [CameraComponent](/scripting/api/sansar.simulation/cameracomponent) | |
### ClearTutorialHint
Added in 32.0.0
```csharp signature public void ClearTutorialHint() ``` Clears any scripted tutorial hint being shown to the player
Added in 32.0.0
```csharp signature public void ClearTutorialHint( Action handler ) ``` Clears any scripted tutorial hint being shown to the player | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### EnableAutomaticTutorialHints
Added in 32.0.0
```csharp signature public void EnableAutomaticTutorialHints(bool enabled) ``` Enables / Disables automatic (non-scripted) tutorial hints. | Parameter | Type | Description | |---|---|---| | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Enabled state of automatic hints. |
Remarks If the user has disabled hints in the settings menu, enabling them from script will have no effect.
Added in 32.0.0
```csharp signature public void EnableAutomaticTutorialHints( bool enabled, Action handler ) ``` Enables / Disables automatic (non-scripted) tutorial hints. | Parameter | Type | Description | |---|---|---| | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Enabled state of automatic hints. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks If the user has disabled hints in the settings menu, enabling them from script will have no effect.
### GetActiveCamera
Added in 37.0.0
```csharp signature public CameraComponent GetActiveCamera() ``` Returns the active camera for this instance. **Returns:** [CameraComponent](/scripting/api/sansar.simulation/cameracomponent) — The active camera for this instance
### OpenQuestCharacterDialog
Added in 35.1.0
```csharp signature public void OpenQuestCharacterDialog(QuestCharacter character) ``` Opens the quest dialog for a character. | Parameter | Type | Description | |---|---|---| | `character` | [QuestCharacter](/scripting/api/sansar.simulation/questcharacter) | The character to open the quest dialog for. |
### OpenStoreListing
```csharp signature public void OpenStoreListing(Guid productId) ``` Opens the product's Store page. | Parameter | Type | Description | |---|---|---| | `productId` | [Guid](https://learn.microsoft.com/dotnet/api/system.guid) | A product ID from a Sansar store listing. |
### OpenUserStore
Added in 37.0.0
```csharp signature public void OpenUserStore(string creatorHandle) ``` Opens the user's Store page. | Parameter | Type | Description | |---|---|---| | `creatorHandle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Creator handle: Creator's handle Sansar store. |
### ResetCamera
Added in 37.0.0
```csharp signature public void ResetCamera() ``` Resets the active camera for this Client to the system default
### SendChat
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat", false)] public void SendChat(string message) ``` Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the $className$. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. | **Throws** [`NullReferenceException`](https://learn.microsoft.com/dotnet/api/system.nullreferenceexception): If the user is no longer online. **Throws** [`ThrottleException`](/scripting/api/sansar.script/throttleexception): If the throttle rate is exceeded.
Remarks eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat
### SetActiveCamera
Added in 37.0.0
```csharp signature public void SetActiveCamera(CameraComponent component) ``` Sets the active camera for this Client. | Parameter | Type | Description | |---|---|---| | `component` | [CameraComponent](/scripting/api/sansar.simulation/cameracomponent) | The camera component to set |
Added in 37.0.0
```csharp signature public void SetActiveCamera( CameraComponent component, ScriptCameraControlMode controlMode ) ``` Sets the active camera for this Client. | Parameter | Type | Description | |---|---|---| | `component` | [CameraComponent](/scripting/api/sansar.simulation/cameracomponent) | The camera component to set | | `controlMode` | [ScriptCameraControlMode](/scripting/api/sansar.simulation/scriptcameracontrolmode) | The script camera control mode to set |
### ShakeCamera
New in 47.10.0
```csharp signature public CameraShakeHandle ShakeCamera(CameraShakeSettings settings) ``` Shakes this player's rendered camera, subject to player comfort settings. | Parameter | Type | Description | |---|---|---| | `settings` | [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) | Settings to snapshot, or null for fresh default settings. | **Returns:** [CameraShakeHandle](/scripting/api/sansar.simulation/camerashakehandle) — A non-null handle for this script's request, including inert requests.
Remarks Only the rendered view changes; camera transforms, audio and targeting are unaffected. Player comfort settings and VR limits can reduce or suppress any shake. Leaving the world ends it. ```csharp title="CameraShakeExample.cs" /* This example is licensed under the Creative Commons Attribution 4.0 International License. * Copyright 2026 Sansar, Inc. https://creativecommons.org/licenses/by/4.0/ */ using System; using System.Collections.Generic; using Sansar; using Sansar.Script; using Sansar.Simulation; /// Demonstrates camera shake with chat commands on the default channel. /// Use /shake rumble, jitter, sway, impact, near, engine or stop. /// Engine toggles a continuous rumble for the sender; stop clears this script's shakes for everyone. /// An optional CameraComponent on this object fixes the view for current and future users. /// Player comfort settings and VR limits can reduce or suppress the motion. public class CameraShakeExample : SceneObjectScript { private CameraComponent camera; private readonly Dictionary engines = new Dictionary(); /// Sets up chat commands and the optional fixed camera. public override void Init() { ObjectPrivate.TryGetFirstComponent(out camera); ScenePrivate.User.Subscribe(User.AddUser, OnUserAdded); ScenePrivate.User.Subscribe(User.RemoveUser, OnUserRemoved); ScenePrivate.Chat.Subscribe(Chat.DefaultChannel, OnChat, true); // Script reloads also need to set up users who are already in the world. foreach (AgentPrivate agent in ScenePrivate.GetAgents()) { SetCamera(agent); } // The Debug local-source live test requires this marker from the real body. Log.Write("CameraShakeExample ready (real shake body): /shake rumble, jitter, sway, impact, near, engine, stop"); } private void SetCamera(AgentPrivate agent) { if (camera != null && agent != null && agent.IsValid) { agent.Client.SetActiveCamera(camera, ScriptCameraControlMode.AgentControlOnly); } } private void OnUserAdded(UserData data) { SetCamera(ScenePrivate.FindAgent(data.User)); } private void OnUserRemoved(UserData data) { // Leaving the world ends that player's shake; discard the old session's handle. engines.Remove(data.User); } private bool StopEngine(SessionId sessionId) { CameraShakeHandle engine; if (!engines.TryGetValue(sessionId, out engine)) { return false; } engine.Stop(0.25f); engines.Remove(sessionId); return true; } private void OnChat(ChatData data) { string[] words = data.Message.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (words.Length != 2 || !words[0].Equals("/shake", StringComparison.OrdinalIgnoreCase)) { return; } // SourceId identifies the sender, rather than the object running this script. AgentPrivate agent = ScenePrivate.FindAgent(data.SourceId); if (agent == null || !agent.IsValid) { return; } SessionId sessionId = agent.AgentInfo.SessionId; switch (words[1].ToLowerInvariant()) { case "rumble": // Presets are mutable: edit before starting. Starts snapshot the settings. CameraShakeSettings rumble = CameraShakeSettings.Earthquake(); rumble.Direction = new Vector(1, 0.5f, 0); agent.Client.ShakeCamera(rumble); break; case "jitter": agent.Client.ShakeCamera(new CameraShakeSettings { Pattern = CameraShakePattern.Jitter, Magnitude = 0.25f, Duration = 1.0f // Frequency 0 uses Jitter's default of 20 Hz. }); break; case "sway": // Long side-to-side motion for the fixed-camera pixel-displacement test. agent.Client.ShakeCamera(new CameraShakeSettings { Pattern = CameraShakePattern.Sway, Magnitude = 0.6f, Frequency = 2.0f, Duration = 6.0f, Direction = new Vector(1, 0, 0), FadeOut = 0.3f }); break; case "impact": // Landing: one downward kick. Duration 0 would still give just one kick. agent.Client.ShakeCamera(CameraShakeSettings.Impact(new Vector(0, -1, 0))); break; case "near": // Only players present now receive this explosion. Their camera distance // from this object's world position controls falloff to zero at 20 meters. ScenePrivate.ShakeCameraAtPosition(ObjectPrivate.Position, 20.0f, CameraShakeSettings.Explosion()); break; case "engine": // Send again to stop; separate sessions retain separate handles. if (!StopEngine(sessionId)) { engines[sessionId] = agent.Client.ShakeCamera(CameraShakeSettings.EngineRumble()); } break; case "stop": StopEngine(sessionId); // Both stop-all scopes affect only shakes requested by this script. agent.Client.StopAllCameraShakes(); ScenePrivate.StopAllCameraShakes(); engines.Clear(); break; } } } ```

Source: Examples/CameraShakeExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

### ShowTutorialHint
Added in 32.0.0
```csharp signature public void ShowTutorialHint(TutorialHint hint) ``` Show a tutorial hint to the player | Parameter | Type | Description | |---|---|---| | `hint` | [TutorialHint](/scripting/api/sansar.simulation/tutorialhint) | The hint to show. |
Added in 32.0.0
```csharp signature public void ShowTutorialHint( TutorialHint hint, Action handler ) ``` Show a tutorial hint to the player | Parameter | Type | Description | |---|---|---| | `hint` | [TutorialHint](/scripting/api/sansar.simulation/tutorialhint) | The hint to show. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Added in 36.9.0
```csharp signature public void ShowTutorialHint(TutorialHint hint, int variant) ``` Show a tutorial hint to the player | Parameter | Type | Description | |---|---|---| | `hint` | [TutorialHint](/scripting/api/sansar.simulation/tutorialhint) | The hint to show. | | `variant` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Optional variant of the hint to show. |
Added in 36.9.0
```csharp signature public void ShowTutorialHint( TutorialHint hint, int variant, Action handler ) ``` Show a tutorial hint to the player | Parameter | Type | Description | |---|---|---| | `hint` | [TutorialHint](/scripting/api/sansar.simulation/tutorialhint) | The hint to show. | | `variant` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Optional variant of the hint to show. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### StopAllCameraShakes
New in 47.10.0
```csharp signature public void StopAllCameraShakes(float fadeOut) ``` Stops all shakes from the calling script on this player, including area shakes. | Parameter | Type | Description | |---|---|---| | `fadeOut` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Ending fade in seconds, clamped to 0 through 5; defaults to 0.1. |
Remarks 0 stops immediately. Shakes from other scripts are unaffected.
### SubscribeToCommand
```csharp signature public Sansar.Script.IEventSubscription SubscribeToCommand( string Command, Action callback, Action canceled, bool persistent ) ``` Subscribes to Command Events. | Parameter | Type | Description | |---|---|---| | `Command` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The command which occurred. | | `callback` | [Action<CommandData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `canceled` | [Action<Sansar.Script.CancelData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the subscription is canceled. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
```csharp signature public Sansar.Script.IEventSubscription SubscribeToCommand( string Command, CommandAction Action, Action callback, Action canceled, bool persistent ) ``` Subscribes to Command Events. | Parameter | Type | Description | |---|---|---| | `Command` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The command which occurred. | | `Action` | [CommandAction](/scripting/api/sansar.simulation/commandaction) | The action which occurred. | | `callback` | [Action<CommandData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `canceled` | [Action<Sansar.Script.CancelData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the subscription is canceled. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### SubscribeToTwitch
Added in 38.1.0
```csharp signature public Sansar.Script.IEventSubscription SubscribeToTwitch( Action callback, bool persistent ) ``` Subscribes to Twitch Events. | Parameter | Type | Description | |---|---|---| | `callback` | [Action<TwitchData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Added in 38.1.0
```csharp signature public Sansar.Script.IEventSubscription SubscribeToTwitch( TwitchEventType EventType, Action callback, bool persistent ) ``` Subscribes to Twitch Events. | Parameter | Type | Description | |---|---|---| | `EventType` | [TwitchEventType](/scripting/api/sansar.simulation/twitcheventtype) | The event which occurred | | `callback` | [Action<TwitchData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### TeleportTo
Added in 39.0.0
```csharp signature public void TeleportTo(string spawnPointName) ``` Teleports to a spawn point in the scene | Parameter | Type | Description | |---|---|---| | `spawnPointName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the target spawn point in the destination. |
Remarks Teleports may be throttled.
```csharp signature public void TeleportTo(Sansar.Vector position, Sansar.Vector forward) ``` Teleports to the position facing the specified direction | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The teleport destination position. | | `forward` | [Sansar.Vector](/scripting/api/sansar/vector) | The teleport destination forward direction. |
Remarks The agent will be set to the specified position facing the given forward direction. Note that avatars always remain upright so the Z component of the forward vector will be ignored.
### TeleportToCharacterEditor
Added in 37.1.0
```csharp signature public void TeleportToCharacterEditor() ``` Teleports to the Character Editor
Remarks Teleports may be throttled.
Added in 37.1.0
```csharp signature public void TeleportToCharacterEditor(string returnSpawnPointName) ``` Teleports to the Character Editor | Parameter | Type | Description | |---|---|---| | `returnSpawnPointName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | When returning to the world from the character editor, this spawn point will be used |
Remarks Teleports may be throttled.
### TeleportToLocation
```csharp signature public void TeleportToLocation(string avatarId, string locationHandle) ``` Teleports the personaHandle to the locationHandle. | Parameter | Type | Description | |---|---|---| | `avatarId` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The [`SceneInfo.AvatarId`](/scripting/api/sansar.simulation/sceneinfo#avatarid) of the destination creator. | | `locationHandle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The [`SceneInfo.LocationHandle`](/scripting/api/sansar.simulation/sceneinfo#locationhandle) of the destination. |
Remarks Teleports may be throttled.
Added in 37.0.0
```csharp signature public void TeleportToLocation( string avatarId, string locationHandle, string spawnPointName ) ``` Teleports the personaHandle to the locationHandle. | Parameter | Type | Description | |---|---|---| | `avatarId` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The [`SceneInfo.AvatarId`](/scripting/api/sansar.simulation/sceneinfo#avatarid) of the destination creator. | | `locationHandle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The [`SceneInfo.LocationHandle`](/scripting/api/sansar.simulation/sceneinfo#locationhandle) of the destination. | | `spawnPointName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the target spawn point in the destination. |
Remarks Teleports may be throttled.
### TeleportToLookbook
Added in 37.1.0
```csharp signature public void TeleportToLookbook() ``` Teleports to the Lookbook
Remarks Teleports may be throttled.
Added in 37.1.0
```csharp signature public void TeleportToLookbook(string returnSpawnPointName) ``` Teleports to the Lookbook | Parameter | Type | Description | |---|---|---| | `returnSpawnPointName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | When returning to the world from the lookbook, this spawn point will be used |
Remarks Teleports may be throttled.
### TeleportToUri
```csharp signature public void TeleportToUri(string sansarUri) ``` Teleports to the specified URI | Parameter | Type | Description | |---|---|---| | `sansarUri` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The URI to teleport to. |
Remarks Teleports may be throttled.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### VibrationPulse
```csharp signature public void VibrationPulse( ControlPointType type, float intensity, float duration ) ``` Pulses the vibration haptic motor for a control point. | Parameter | Type | Description | |---|---|---| | `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype) | | `intensity` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Intensity of vibration. Intensity will be clamped to the range \[0, 1\]. | | `duration` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Duration of the pulse in milliseconds. Will be clamped to the range \[0, 1000\]. |
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs) - [InteractionScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionScreenshot.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) …and 13 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/client --- # Cluster Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The Cluster class handles interactions with in game objects. ```csharp public class Cluster : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ClusterId](#clusterid) · [ObjectPrivateCount](#objectprivatecount) | | **Methods** | [Destroy](#destroy) · [GetObjectPrivate](#getobjectprivate) · [GetObjectPrivates](#getobjectprivates) · [ToString](#tostring) | ## Properties ### ClusterId
```csharp signature public ClusterId ClusterId { get; } ``` Returns the Id of this cluster.
### ObjectPrivateCount
```csharp signature public uint ObjectPrivateCount { get; } ``` The current number of objects in this cluster.
## Methods ### Destroy
```csharp signature public void Destroy() ``` Destroys this cluster.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Destroy( Sansar.Script.ScriptBase.OperationComplete handler ) ``` Destroys this cluster. | Parameter | Type | Description | |---|---|---| | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The internal event id for the completion event.
```csharp signature public void Destroy( Action handler ) ``` Destroys this cluster. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### GetObjectPrivate
```csharp signature public ObjectPrivate GetObjectPrivate(uint index) ``` Retrieves a Sansar.Simulation.ObjectPrivate by index. | Parameter | Type | Description | |---|---|---| | `index` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | Index of the Sansar.Simulation.ObjectPrivate to retrieve. | **Returns:** [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) — The Sansar.Simulation.ObjectPrivate at that index or null.
### GetObjectPrivates
```csharp signature public IEnumerable GetObjectPrivates() ``` Enumerable for GetObjectPrivate **Returns:** [IEnumerable<ObjectPrivate>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — Enumerable for GetObjectPrivate
Remarks The resulting enumerable may be invalidated if the underlying collection changes.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/cluster --- # ClusterId Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
Encapsulates an Cluster Id. ```csharp public struct ClusterId ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Invalid](#invalid) | | **Methods** | [Equals](#equals) · [GetHashCode](#gethashcode) · [ToString](#tostring) | | **Operators** | [op\_Equality](#op_equality) · [op\_Implicit](#op_implicit) · [op\_Inequality](#op_inequality) | ## Fields ### Invalid
```csharp signature public static readonly ClusterId Invalid ``` The invalid id object.
## Methods ### Equals
```csharp signature public override bool Equals(object obj) ``` Value comparison for ClusterId. | Parameter | Type | Description | |---|---|---| | `obj` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The object to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the argument is an ClusterId and has the same value.
### GetHashCode
```csharp signature public override int GetHashCode() ``` Retrieves the hash code for this instance. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The hash code for this instance.
### ToString
```csharp signature public override string ToString() ``` Converts the id to a hexadecimal string representation. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The hexadecimal string representation.
## Operators ### op_Equality
```csharp signature public static bool operator ==(ClusterId a, ClusterId b) ``` ClusterId equality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ClusterId](/scripting/api/sansar.simulation/clusterid) | First ClusterId to compare. | | `b` | [ClusterId](/scripting/api/sansar.simulation/clusterid) | Second ClusterId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ClusterIds have the same value.
### op_Implicit
```csharp signature public static implicit operator ClusterId(uint id) ``` Internal explicit conversion from a uint. | Parameter | Type | Description | |---|---|---| | `id` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | A uint representation of an ClusterId |
### op_Inequality
```csharp signature public static bool operator !=(ClusterId a, ClusterId b) ``` ClusterId inequality operator. | Parameter | Type | Description | |---|---|---| | `a` | [ClusterId](/scripting/api/sansar.simulation/clusterid) | First ClusterId to compare. | | `b` | [ClusterId](/scripting/api/sansar.simulation/clusterid) | Second ClusterId to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the ClusterIds have a different value.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/clusterid --- # ClusterResource Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The ClusterResource class represents a cluster that could be added to the scene. See `ScenePrivate.CreateCluster`. ```csharp public class ClusterResource : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ResourceId](#resourceid) | | **Methods** | [ToString](#tostring) | ## Properties ### ResourceId
```csharp signature public string ResourceId { get; } ``` Returns the resource Id of this ClusterResource.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ReactionsExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ReactionsExample.cs) - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) - [ScriptLibrary/Scene/Reaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Reaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/clusterresource --- # CollisionData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Handler for rigid body events. ```csharp public class CollisionData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ComponentId](#componentid) · [EventType](#eventtype) · [HitComponentId](#hitcomponentid) · [HitControlPoint](#hitcontrolpoint) · [HitObject](#hitobject) · [Phase](#phase) | | **Methods** | [ToString](#tostring) | ## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` The id of the rigid body component.
### EventType
```csharp signature public CollisionEventType EventType { get; } ``` The type of collision which occurred.
### HitComponentId
```csharp signature public Sansar.Script.ComponentId HitComponentId { get; } ``` The id of the rigid body component or character that was hit.
### HitControlPoint
```csharp signature public ControlPointType HitControlPoint { get; } ``` The specific control point hit, if any
### HitObject
```csharp signature public ObjectPublic HitObject { get; } ``` The [`ObjectPublic`](/scripting/api/sansar.simulation/objectpublic) that was hit.
### Phase
```csharp signature public CollisionEventPhase Phase { get; } ``` used by trigger events to determine if trigger enter or exit occurred
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [RandomMovement.cs](/scripting/examples/random-movement) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs) …and 2 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/collisiondata --- # CollisionEventPhase Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Phase for events that encapsulate sequence of occurrences ```csharp public enum CollisionEventPhase ``` ## Values | Value | Description | |---|---| | `cInvalid` | No phase specified | | `cTriggerEnter` | Trigger volume was entered by a detected object | | `cTriggerExit` | Detected object has exited the trigger volume | | `Invalid` | No phase specified | | `TriggerEnter` | Trigger volume was entered by a detected object | | `TriggerExit` | Detected object has exited the trigger volume | ## Used in examples - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/collisioneventphase --- # CollisionEventType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Type of collision event. ```csharp [System.Flags] public enum CollisionEventType ``` ## Values | Value | Description | |---|---| | `AllCollisions` | Combination of all flags. | | `cAllCollisions` | Combination of all flags. | | `cCharacterContact` | A character collision | | `CharacterContact` | A character collision | | `cRigidBodyContact` | 0 or more collision events may appear between a sequence start and end. | | `cTrigger` | A trigger volume has been entered or exited | | `RigidBodyContact` | 0 or more collision events may appear between a sequence start and end. | | `Trigger` | A trigger volume has been entered or exited | ## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [RandomMovement.cs](/scripting/examples/random-movement) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs) …and 2 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/collisioneventtype --- # CommandAction Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Specifies a command action. ```csharp [System.Flags] public enum CommandAction ``` ## Remarks See [`Client.SubscribeToCommand`](/scripting/api/sansar.simulation/client#subscribetocommand-string-commandaction-action-action-boolean). ## Values | Value | Description | |---|---| | `All` | A combination of all other values. | | `Invalid` | An invalid command action. | | `Pressed` | Fired when the command is pressed. | | `Released` | Fired when the command is released. | ## Used in examples - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [ScriptLibrary/Scene/Hotkey.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Hotkey.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/commandaction --- # CommandData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Command events are generated by the client when input events occur. ```csharp public class CommandData : Sansar.Script.EventData ``` ## Remarks | Command | Default Key Binding | |---|---| | Trigger | Left Mouse Button | | PrimaryAction | F | | SecondaryAction | R | | Modifier | Shift | | Action1 to Action0 | Number keys 1 to 0 | | Confirm | Enter | | Cancel | Escape | | SelectLeft | Left arrow | | SelectRight | Right arrow | | SelectUp | Up arrow | | SelectDown | Down arrow | | Keypad0 to Keypad9 | Numberpad keys 0 to 9 | | KeypadEnter | Numberpad Enter | While the agent is seated, the movement controls also generate keypad commands for vehicle driving: W/A/S/D and the VR or gamepad left analog stick map to Keypad8 (forward), Keypad4 (left), Keypad6 (right), and Keypad2 plus Keypad5 (back/brake). These aliases are only delivered while seated; when standing, the movement controls move the avatar without generating commands. Stick axes generate digital press/release events at half deflection, not continuous analog values. Sources holding the same keypad command are combined: the first source sends Pressed and the last source to release sends Released, retaining the first source's ControlPoint. An example script for handling client commands: ## Example ```csharp title="CommandExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ using Sansar.Script; using Sansar.Simulation; public class CommandExample : SceneObjectScript { #region ScriptParameters [Tooltip(@"The command to enable listening for the Action Command. Default: Confirm (Enter)")] [DefaultValue("Confirm")] [DisplayName("Subscribe Command")] public readonly string SubscribeCommand; [Tooltip(@"The command to disable listening for the Action Command. Default: Cancel (Escape)")] [DefaultValue("Cancel")] [DisplayName("Unsubscribe Command")] public readonly string UnsubscribeCommand; [Tooltip(@"If the command has been subscribed to by the 'Subscribe Command', this will log the action to the script console.")] [DefaultValue("Trigger")] [DisplayName("Action Command")] public readonly string ActionCommand; #endregion ScriptParameters public override void Init() { // Subscribe to new user events; ScenePrivate.User.Subscribe(User.AddUser, NewUser); } IEventSubscription subscription = null; void NewUser(UserData newUser) { Client client = ScenePrivate.FindAgent(newUser.User).Client; // CommandReceived will be called every time the command it triggered on the client // CommandCanceled will be called if the subscription fails if (SubscribeCommand != "") { client.SubscribeToCommand(SubscribeCommand, CommandAction.Pressed, (data) => { if (subscription == null) { Log.Write(GetType().Name, $"[{SubscribeCommand}] Subscribing to {ActionCommand}."); subscription = client.SubscribeToCommand(ActionCommand, CommandAction.All, CommandReceived, CommandCanceled); } }, CommandCanceled); } if (UnsubscribeCommand != "") { client.SubscribeToCommand(UnsubscribeCommand, CommandAction.Pressed, (data) => { if (subscription != null) { Log.Write(GetType().Name, $"[{UnsubscribeCommand}] Unsubscribing to {ActionCommand}."); subscription.Unsubscribe(); subscription = null; } }, CommandCanceled); } } void CommandReceived(CommandData command) { Log.Write(GetType().Name, $"Received command {command.Command}: {command.Action}. Targeting Info: {command.TargetingComponent}, Origin:{command.TargetingOrigin}, Position:{command.TargetingPosition}, Normal{command.TargetingNormal}"); } void CommandCanceled(CancelData data) { Log.Write(GetType().Name, "Subscription canceled: "+data.Message); } } ```

Source: Examples/CommandExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Properties** | [Action](#action) · [CameraControlMode](#cameracontrolmode) · [Command](#command) · [ControlPoint](#controlpoint) · [IsAimTarget](#isaimtarget) · [MouseLookMode](#mouselookmode) · [SessionId](#sessionid) · [SimulationFrame](#simulationframe) · [TargetingComponent](#targetingcomponent) · [TargetingNormal](#targetingnormal) · [TargetingOrigin](#targetingorigin) · [TargetingPosition](#targetingposition) | | **Methods** | [ToString](#tostring) | ## Properties ### Action
```csharp signature public CommandAction Action { get; } ``` The action which occurred.
### CameraControlMode
```csharp signature public CameraControlMode CameraControlMode { get; } ```
### Command
```csharp signature public string Command { get; } ``` The command which occurred.
### ControlPoint
```csharp signature public ControlPointType ControlPoint { get; } ```
### IsAimTarget
Added in 37.0.0
```csharp signature public bool IsAimTarget { get; } ```
### MouseLookMode
```csharp signature public bool MouseLookMode { get; } ```
### SessionId
```csharp signature public Sansar.Script.SessionId SessionId { get; } ``` The client which generated the event.
### SimulationFrame
```csharp signature public ulong SimulationFrame { get; } ```
### TargetingComponent
```csharp signature public Sansar.Script.ComponentId TargetingComponent { get; } ```
### TargetingNormal
```csharp signature public Sansar.Vector TargetingNormal { get; } ```
### TargetingOrigin
```csharp signature public Sansar.Vector TargetingOrigin { get; } ```
### TargetingPosition
```csharp signature public Sansar.Vector TargetingPosition { get; } ```
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/Hotkey.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Hotkey.cs) - [ScriptLibrary/Scene/Screenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Screenshot.cs) - [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs) - [ScriptLibrary/Scene/Target.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Target.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/commanddata --- # ComponentType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Type of component. See [`ObjectPrivate.GetComponent`](/scripting/api/sansar.simulation/objectprivate#getcomponent) ```csharp public enum ComponentType ``` ## Values | Value | Description | |---|---| | `AnimationComponent` | [`AnimationComponent`](/scripting/api/sansar.simulation/animationcomponent) | | `AudioComponent` | [`AudioComponent`](/scripting/api/sansar.simulation/audiocomponent) | | `CameraComponent` Added in 37.0.0 | [`CameraComponent`](/scripting/api/sansar.simulation/cameracomponent) | | `CharacterComponent` Added in 39.1.0 | [`CameraComponent`](/scripting/api/sansar.simulation/cameracomponent) | | `LightComponent` | [`LightComponent`](/scripting/api/sansar.simulation/lightcomponent) | | `MeshComponent` Added in 34.0.0 | [`MeshComponent`](/scripting/api/sansar.simulation/meshcomponent) | | `MirrorComponent` Added in 47.1.1 | [`MirrorComponent`](/scripting/api/sansar.simulation/mirrorcomponent) | | `RigidBodyComponent` | [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) | ## Used in examples - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs) - [ScriptLibrary/Scene/Light.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Light.cs) - [ScriptLibrary/Scene/LightOnOff.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/LightOnOff.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/componenttype --- # ControlPointType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Control points are a representation of some spatial inputs, primarily VR controllers. ```csharp public enum ControlPointType ``` ## Remarks See: [`AgentPrivate.GetControlPointPosition`](/scripting/api/sansar.simulation/agentprivate#getcontrolpointposition) to get a control point's position. [`AgentPrivate.GetControlPointOrientation`](/scripting/api/sansar.simulation/agentprivate#getcontrolpointorientation) to get a control point's orientation [`AgentPrivate.GetControlPointEnabled`](/scripting/api/sansar.simulation/agentprivate#getcontrolpointenabled) to see if a control point is enabled. ## Values | Value | Description | |---|---| | `Count` | Count of total possible control point types. Control points from 0 to (cCount - 1) are valid, however not all have meaningful data on the server for scripts. | | `DesktopGrab` | Used when grabbing objects in desktop mode, follows the characters right hand | | `GazeTarget` | A VR head mounted display (HMD) control point, for the position and direction of the HMD. | | `Invalid` | An invalid control point. | | `LeftTool` | Left hand VR controller. | | `RightTool` | Right hand VR controller. | ## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs) - [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs) - [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/controlpointtype --- # DataStore Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Added in 37.1.0
The [`DataStore`](/scripting/api/sansar.simulation/datastore) class provides access to a persistent data store that can be accessed by scripts from any experience. ```csharp public class DataStore ``` ## Remarks All [`DataStore`](/scripting/api/sansar.simulation/datastore) objects with a given [`DataStore.Id`](/scripting/api/sansar.simulation/datastore#id) share the same database. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Id](#id) | | **Methods** | [Delete](#delete) · [Restore](#restore) · [Store](#store) | ## Properties ### Id
Added in 37.1.0
```csharp signature public Guid Id { get; } ``` The Id of this [`DataStore`](/scripting/api/sansar.simulation/datastore).
Remarks All [`DataStore`](/scripting/api/sansar.simulation/datastore) objects with a given [`DataStore.Id`](/scripting/api/sansar.simulation/datastore#id) share the same database.
## Methods ### Delete
Added in 37.1.0
```csharp signature public void Delete( string key, Action done ) ``` Deletes the value associated with the given key | Parameter | Type | Description | |---|---|---| | `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | They key the data is stored under. | | `done` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the delete is complete. |
Remarks Unconditionally deletes the value associated with the given key. For a conditional delete, use [`DataStore.Delete`](/scripting/api/sansar.simulation/datastore#delete-string-options-action).
Added in 37.1.0
```csharp signature public void Delete( string key, DataStore.Options options, Action> done ) ``` Deletes the value associated with the given key | Parameter | Type | Description | |---|---|---| | `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | They key the data is stored under. | | `options` | [DataStore.Options](/scripting/api/sansar.simulation/datastore.options) | Controls how the operation proceeds. | | `done` | [Action<DataStore.Result<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the delete is complete. | **Type parameters:** `T`: The type of the data stored.
Remarks [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) can be specified to conditionally delete only if the version matches. If the version number does not match, [`DataStore.Result`](/scripting/api/sansar.simulation/datastore.result-1) will have Success == false and the current value in the Version and Object fields.
### Restore
Added in 37.1.0
```csharp signature public void Restore(string key, Action> done) ``` Retrieves the value associated with the given key. | Parameter | Type | Description | |---|---|---| | `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | They key the data is stored under. | | `done` | [Action<DataStore.Result<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the restore is complete. | **Type parameters:** `T`: The type of the data stored.
Remarks If the done action is null, this method will fail without making a call to the data store.
### Store
Added in 37.1.0
```csharp signature public void Store( string key, T value, Action> done ) ``` Serializes the given object to the data store | Parameter | Type | Description | |---|---|---| | `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The key to store the data under. | | `value` | T | The object to be converted | | `done` | [Action<DataStore.Result<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the store is complete. |
Remarks The specified key and value will always overwrite any existing data in the store. For a conditional store, use [`DataStore.Store`](/scripting/api/sansar.simulation/datastore#store-string-t-options-action) with [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) set to a value from a previous operation.
Added in 37.1.0
```csharp signature public void Store( string key, T value, DataStore.Options options, Action> done ) ``` Serializes the given object to the data store | Parameter | Type | Description | |---|---|---| | `key` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The key to save the data under. | | `value` | T | The object to be converted. | | `options` | [DataStore.Options](/scripting/api/sansar.simulation/datastore.options) | Controls how the operation proceeds. | | `done` | [Action<DataStore.Result<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the conversion is complete. |
Remarks [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) can be specified to conditionally store only if the version matches. If the version number does not match, [`DataStore.Result`](/scripting/api/sansar.simulation/datastore.result-1) will have Success == false and the current value in the Version and Object fields. If [`Options.RetrieveData`](/scripting/api/sansar.simulation/datastore.options#retrievedata) false and the write is successful, the response will not include the value written to the store and will simply pass back the value parameter.
## Used in examples - [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/datastore --- # DataStore.Options Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation Added in 37.1.0
Controls how various [`DataStore`](/scripting/api/sansar.simulation/datastore) operations proceed. ```csharp public struct DataStore.Options ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [RetrieveData](#retrievedata) · [SerializerOptions](#serializeroptions) · [Version](#version) | ## Fields ### RetrieveData
Added in 37.1.0
```csharp signature public bool RetrieveData ``` DataStore.Store and DataStore.Delete will retrieve the existing data if this value is true, or if [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) is set and is not matched. Leaving this false will provide quicker responses and the value does not need to be returned or parsed.
### SerializerOptions
Added in 37.1.0
```csharp signature public Sansar.Utility.JsonSerializerOptions SerializerOptions ``` Options to control json serialization
### Version
Added in 37.1.0
```csharp signature public Nullable Version ``` When set, DataStore.Store and DataStore.Delete will only proceed if the version of the data in the store matches this value. If the version does not match then the existing value and version will be returned.
## Used in examples - [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/datastore.options --- # DataStore.Result Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Utility.JsonSerializationData<T> Added in 37.1.0
Holds the result of operations on a [`DataStore`](/scripting/api/sansar.simulation/datastore). ```csharp public class DataStore.Result : Sansar.Utility.JsonSerializationData ``` **Type parameters:** `T`: The type of the result. ## Remarks Properties used my depend on the method called and options. The type used must be able to be serialized with the [`JsonSerializer`](/scripting/api/sansar.utility/jsonserializer). ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Version](#version) | | **Methods** | [ToString](#tostring) | ## Properties ### Version
Added in 37.1.0
```csharp signature public int Version { get; } ``` Version of the value for the key used for this operation. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — An integer version number for the data in the store.
Remarks Each write to a given key will update this value, even if the same value is written. To ensure that one script is not clobbering writes by another script the [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) can verify that the data has not changed.
## Methods ### ToString
Added in 37.1.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/datastore.result-1 --- # HeldObjectData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Handler for agent grab events. ```csharp public class HeldObjectData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ComponentId](#componentid) · [HeldObjectEvent](#heldobjectevent) · [HeldObjectInfo](#heldobjectinfo) · [ObjectId](#objectid) | | **Methods** | [ToString](#tostring) | ## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` The ComponentId of the held object's [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent).
### HeldObjectEvent
```csharp signature public HeldObjectEventType HeldObjectEvent { get; } ``` The type of held object event which occurred.
### HeldObjectInfo
```csharp signature public HeldObjectInfo HeldObjectInfo { get; } ``` information about the held object
### ObjectId
```csharp signature public Sansar.Script.ObjectId ObjectId { get; } ``` The ObjectId of the held object.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs) - [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/heldobjectdata --- # HeldObjectEventType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Type of held object event. ```csharp [System.Flags] public enum HeldObjectEventType ``` ## Values | Value | Description | |---|---| | `Grab` | Grabbed by a player avatar. | | `Release` | Released by a player avatar. | ## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs) - [ScriptLibrary/Scene/PositionReset.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/PositionReset.cs) - [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/heldobjecteventtype --- # HeldObjectInfo Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
Information about if this HeldObjectInfo is being held by an agent. ```csharp public struct HeldObjectInfo ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ControlPoint](#controlpoint) · [IsHeld](#isheld) · [LocalPosition](#localposition) · [SessionId](#sessionid) | ## Fields ### ControlPoint
```csharp signature public ControlPointType ControlPoint ``` The [`HeldObjectInfo.ControlPoint`](/scripting/api/sansar.simulation/heldobjectinfo#controlpoint) that was used to grab the object.
### IsHeld
```csharp signature public bool IsHeld ``` Is the object being held by an agent
### LocalPosition
```csharp signature public Sansar.Vector LocalPosition ``` The local space point on the object that is held.
### SessionId
```csharp signature public Sansar.Script.SessionId SessionId ``` The SessionId of the agent that is holding the object.
## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs) - [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs) - [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/heldobjectinfo --- # HttpClient Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The Http Client can be used to make HTTP requests to external services. ```csharp public class HttpClient : Sansar.Script.InstanceInterface ``` ## Remarks A simple script to get some external data might be: ## Example ```csharp title="HttpClientExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2022 Sansar, Inc." Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ using Sansar.Script; using Sansar.Simulation; using System; using System.Collections.Generic; using System.Text; public class HttpClientExample : SceneObjectScript { public override void Init() { HttpRequestOptions options = new HttpRequestOptions(); options.Parameters = new Dictionary() { { "num" , "1" }, { "min" , "100000000" }, { "max" , "999999999" }, { "base" , "10" }, { "format" , "plain" }, { "col" , "1" }, }; ScenePrivate.User.Subscribe(User.AddUser, userData=>NewUser(userData, options)); } void NewUser(UserData userData, HttpRequestOptions options) { AgentPrivate agent = ScenePrivate.FindAgent(userData.User); if (agent != null) { var result = WaitFor(ScenePrivate.HttpClient.Request, "https://www.random.org/integers/", options) as HttpClient.RequestData; if (result.Success) { agent.SendChat("Your lucky number is " + result.Response.Body); } } } } ```

Source: Examples/HttpClientExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Methods** | [Request](#request) | ## Methods ### Request
```csharp signature public void Request( string url, Action handler ) ``` Performs a HTTP request. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The url. It may include parameters, but they must be url-encoded. | | `handler` | [Action<HttpClient.RequestData>](https://learn.microsoft.com/dotnet/api/system.action-1) | The event handler to be called when the request is complete |
Remarks Currently only text content types are supported.
```csharp signature public void Request( string url, HttpRequestOptions requestOptions, Action handler ) ``` Performs a HTTP request. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The url. It may include parameters, but they must be url-encoded. | | `requestOptions` | [HttpRequestOptions](/scripting/api/sansar.simulation/httprequestoptions) | The request options struct | | `handler` | [Action<HttpClient.RequestData>](https://learn.microsoft.com/dotnet/api/system.action-1) | The event handler to be called when the request is complete |
Remarks Currently only text content types are supported.
## Used in examples - [HttpClientExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/HttpClientExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/httpclient --- # HttpClient.RequestData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The result of a [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action) call. ```csharp public class HttpClient.RequestData : Sansar.Script.OperationCompleteEvent ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Response](#response) | | **Methods** | [ToString](#tostring) | ## Properties ### Response
```csharp signature public HttpResponse Response { get; } ``` The contents of a [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action). **Value:** [HttpResponse](/scripting/api/sansar.simulation/httpresponse) — Only valid if [`OperationCompleteEvent.Success`](/scripting/api/sansar.script/operationcompleteevent#success) is true.
Remarks The information in the response is only valid if `Success` is true.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [HttpClientExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/HttpClientExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/httpclient.requestdata --- # HttpRequestMethod Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Enumerates the possible Http Request Methods ```csharp public enum HttpRequestMethod ``` ## Values | Value | Description | |---|---| | `DELETE` | Perform a DELETE request | | `GET` | Perform a GET request | | `HEAD` | Perform a HEAD request | | `PATCH` | Perform a PATCH request | | `POST` | Perform a POST request | | `PUT` | Perform a PUT request |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/httprequestmethod --- # HttpRequestOptions Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
Options used for [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action) ```csharp public struct HttpRequestOptions ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Body](#body) · [DisableRedirect](#disableredirect) · [Headers](#headers) · [Method](#method) · [Parameters](#parameters) · [RetrieveAllHeaders](#retrieveallheaders) | ## Fields ### Body
```csharp signature public string Body ``` Body for [`HttpRequestMethod`](/scripting/api/sansar.simulation/httprequestmethod)s which use one.
Remarks May be null.
### DisableRedirect
```csharp signature public bool DisableRedirect ``` Disable automatic redirects.
Remarks The maximum number of redirects is determined by the server
### Headers
```csharp signature public Dictionary Headers ``` Http headers.
Remarks May be null.
### Method
```csharp signature public HttpRequestMethod Method ``` The [`HttpRequestMethod`](/scripting/api/sansar.simulation/httprequestmethod) to use for this request.
Remarks Defaults to [`HttpRequestMethod.GET`](/scripting/api/sansar.simulation/httprequestmethod#F:Sansar.Simulation.HttpRequestMethod.GET)
### Parameters
```csharp signature public Dictionary Parameters ``` Request parameters.
Remarks May be null. If non-null, the values will be url-encoded.
### RetrieveAllHeaders
```csharp signature public bool RetrieveAllHeaders ``` If false, minimal or no response headers will be returned.
## Used in examples - [HttpClientExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/HttpClientExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/httprequestoptions --- # HttpResponse Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
Data returned from [`HttpClient.Request`](/scripting/api/sansar.simulation/httpclient#request-string-httprequestoptions-action) ```csharp public struct HttpResponse ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Body](#body) · [Headers](#headers) · [Status](#status) | ## Fields ### Body
```csharp signature public string Body ``` The response body.
### Headers
```csharp signature public Dictionary Headers ``` The headers from the response
Remarks May be null if [`HttpRequestOptions.RetrieveAllHeaders`](/scripting/api/sansar.simulation/httprequestoptions#retrieveallheaders) is false or if no headers are returned.
### Status
```csharp signature public int Status ``` The status code returned by the remote server.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/httpresponse --- # Interaction Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 ```csharp public class Interaction : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [GetEnabled](#getenabled) · [GetPrompt](#getprompt) · [SetEnabled](#setenabled) · [SetPrompt](#setprompt) · [Subscribe](#subscribe) | ## Methods ### GetEnabled
```csharp signature public bool GetEnabled() ``` Returns true if the interaction is enabled. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the interaction is enabled.
Remarks Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.
### GetPrompt
```csharp signature public string GetPrompt() ``` Get the current Interaction prompt. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The current prompt string.
Remarks The prompt text shows when hovering over the object the script is on.
### SetEnabled
```csharp signature public void SetEnabled(bool value) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. |
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.
```csharp signature public void SetEnabled(Sansar.Script.SessionId sessionId, bool value) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The SessionId of the agent to disable or enable the interaction for.. | | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. |
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'. This method will only change the enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setEnabled calls.
```csharp signature public void SetEnabled(AgentPrivate agent, bool value) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to disable or enable the interaction for. | | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. |
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'. This method will only change the enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setEnabled calls.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetEnabled( bool value, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — A legacy eventId
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.
```csharp signature public void SetEnabled( bool value, Action handler ) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'.
```csharp signature public void SetEnabled( Sansar.Script.SessionId sessionId, bool value, Action handler ) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The SessionId of the agent to disable or enable the interaction for.. | | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'. This method will only change the enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setEnabled calls.
```csharp signature public void SetEnabled( AgentPrivate agent, bool value, Action handler ) ``` Change an Interaction state to disabled or enabled. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to disable or enable the interaction for. | | `value` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true to enable the Interaction, false to disable it. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks All Interactions start off enabled. Disabled interactions do not highlight, do not show their prompt and cannot be 'clicked'. This method will only change the enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setEnabled calls.
### SetPrompt
```csharp signature public void SetPrompt(string prompt) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. |
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Use [`DefaultValueAttribute`](/scripting/api/sansar.script/defaultvalueattribute) to set a default prompt.
```csharp signature public void SetPrompt( Sansar.Script.SessionId sessionId, string prompt ) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change the prompt for. | | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. |
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Will only change the prompt for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setPrompt calls.
```csharp signature public void SetPrompt(AgentPrivate agent, string prompt) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change the prompt for. | | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. |
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Will only change the prompt for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setPrompt calls.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetPrompt( string prompt, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — A legacy eventId
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Use [`DefaultValueAttribute`](/scripting/api/sansar.script/defaultvalueattribute) to set a default prompt.
```csharp signature public void SetPrompt( string prompt, Action handler ) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Use [`DefaultValueAttribute`](/scripting/api/sansar.script/defaultvalueattribute) to set a default prompt.
```csharp signature public void SetPrompt( Sansar.Script.SessionId sessionId, string prompt, Action handler ) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change the prompt for. | | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Will only change the prompt for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setPrompt calls.
```csharp signature public void SetPrompt( AgentPrivate agent, string prompt, Action handler ) ``` Set the Interaction prompt string. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change the prompt for. | | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string to set the prompt to. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The prompt text shows when hovering over the object the script is on. The prompt must be 128 characters or less and 4 lines or less. Will only change the prompt for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars). It will also be overriden by any global setPrompt calls.
### Subscribe
```csharp signature public Sansar.Script.IEventSubscription Subscribe( Action callback, bool persistent ) ``` Subscribes to Interaction Events. | Parameter | Type | Description | |---|---|---| | `callback` | [Action<InteractionData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [InteractionExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionExample.cs) - [InteractionScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionScreenshot.cs) - [MyScripts/HelloWorld.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MyScripts/HelloWorld.cs) - [ScriptLibrary/Quest/QuestCharacter.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestCharacter.cs) - [ScriptLibrary/Quest/QuestGiver.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiver.cs) - [ScriptLibrary/Quest/QuestGiverInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverInteraction.cs) - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs) - [ScriptLibrary/Scene/Interaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Interaction.cs) …and 1 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/interaction --- # InteractionData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Handler for Interaction events. ```csharp public class InteractionData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentId](#agentid) · [ControlPoint](#controlpoint) · [HitNormal](#hitnormal) · [HitPosition](#hitposition) · [Origin](#origin) | | **Methods** | [ToString](#tostring) | ## Properties ### AgentId
```csharp signature public Sansar.Script.SessionId AgentId { get; } ``` The SessionId of the agent who clicked the Interaction.
### ControlPoint
Added in 33.2.0
```csharp signature public ControlPointType ControlPoint { get; } ``` The ControlPoint that triggered the Interaction.
### HitNormal
```csharp signature public Sansar.Vector HitNormal { get; } ``` The normal direction at the position of the Interaction.
### HitPosition
```csharp signature public Sansar.Vector HitPosition { get; } ``` The position of the Interaction.
### Origin
```csharp signature public Sansar.Vector Origin { get; } ``` The position of the start of the ray that triggered the Interaction.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [InteractionExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionExample.cs) - [InteractionScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/InteractionScreenshot.cs) - [MyScripts/HelloWorld.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MyScripts/HelloWorld.cs) - [ScriptLibrary/Quest/QuestCharacter.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestCharacter.cs) - [ScriptLibrary/Quest/QuestGiverInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverInteraction.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Scene/Interaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Interaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/interactiondata --- # InterpolationMode Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 37.0.0
Type of interpolation to use for various interfaces ```csharp public enum InterpolationMode ``` ## Remarks The output value is computed according to the interpolation type with a parametric parameter 't' that varies from zero to one. - Linear is directly proportional to 't'. - Ease-in is proportional to 't^2'. - Ease-out is computed with 't\*(2-t)'. - Smoothstep interpolation uses '(3-2t)\*t^2'. - Step interpolation uses '0' for 't<0.5' and '1' for 't>=0.5'. ## Values | Value | Description | |---|---| | `EaseIn` Added in 37.0.0 | Ease In. The value will gradually speed up and continue quickly at the end. | | `EaseOut` Added in 37.0.0 | Ease Out. The value will change quickly at first and slow down to smoothly reach the goal. | | `Linear` Added in 37.0.0 | Linear Interpolation. The value will change at a constant rate. | | `Smoothstep` Added in 37.0.0 | Smoothstep Interpolation. The value will speed up gradually and slow down to smoothly reach the goal. | | `Step` Added in 37.0.0 | Step. The value will step abruptly from the initial value to the final value half-way through. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/interpolationmode --- # LightComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The LightComponent handles interactions with lights. ```csharp public class LightComponent : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [IsScriptable](#isscriptable) · [LightType](#lighttype) · [Name](#name) | | **Methods** | [GetAngle](#getangle) · [GetAngularFalloff](#getangularfalloff) · [GetCastsShadows](#getcastsshadows) · [GetNearClip](#getnearclip) · [GetNormalizedColor](#getnormalizedcolor) · [GetRange](#getrange) · [GetRelativeIntensity](#getrelativeintensity) · [GetShadowPriority](#getshadowpriority) · [SetAngle](#setangle) · [SetAngularFalloff](#setangularfalloff) · [SetCastsShadows](#setcastsshadows) · [SetColorAndIntensity](#setcolorandintensity) · [SetNearClip](#setnearclip) · [SetRange](#setrange) · [SetShadowPriority](#setshadowpriority) · [ToString](#tostring) | ## Fields ### ComponentType
```csharp signature public static readonly ComponentType ComponentType ``` The [`LightComponent.ComponentType`](/scripting/api/sansar.simulation/lightcomponent#componenttype) of this component
## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this LightComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### IsScriptable
```csharp signature public bool IsScriptable { get; } ``` The scriptable flag for this LightComponent. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not this light can have properties changed by script.
### LightType
```csharp signature public LightType LightType { get; } ``` The light type for this LightComponent. **Value:** [LightType](/scripting/api/sansar.simulation/lighttype) — Light type enum for the light component.
### Name
Added in 33.2.0
```csharp signature public string Name { get; } ``` This LightComponent name, as specified in the editor.
## Methods ### GetAngle
```csharp signature public float GetAngle() ``` Retrieves the cone angle of this LightComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The angle in degrees.
### GetAngularFalloff
```csharp signature public float GetAngularFalloff() ``` Retrieves the angular falloff of this LightComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The angular falloff.
### GetCastsShadows
```csharp signature public bool GetCastsShadows() ``` Retrieves whether this LightComponent casts shadows. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The shadow cast state.
### GetNearClip
```csharp signature public float GetNearClip() ``` Retrieves the near clip distance of this LightComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The near clip distance.
### GetNormalizedColor
```csharp signature public Sansar.Color GetNormalizedColor() ``` Retrieves the normalized color of this LightComponent. **Returns:** [Sansar.Color](/scripting/api/sansar/color) — The normalized color.
Remarks This might not match values set via script or in the editor since the color of a light is internally multiplied by its intensity before being applied to the scene.
### GetRange
```csharp signature public float GetRange() ``` Retrieves the current range of this LightComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The range.
### GetRelativeIntensity
```csharp signature public float GetRelativeIntensity() ``` Retrieves the intensity of this LightComponent based on its normalized color. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The intensity based on a normalized color.
Remarks This might not match values set via script or in the editor since the color of a light is internally multiplied by its intensity before being applied to the scene.
### GetShadowPriority
```csharp signature public uint GetShadowPriority() ``` Retrieves the shadow priority of this LightComponent. **Returns:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — The shadow priority.
### SetAngle
```csharp signature public void SetAngle(float angle) ``` Sets the cone angle for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `angle` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angle in degrees, 1 to 160. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetAngle( float angle, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the cone angle for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `angle` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angle in degrees, 1 to 160. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetAngle( float angle, Action handler ) ``` Sets the cone angle for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `angle` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angle in degrees, 1 to 160. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetAngularFalloff
```csharp signature public void SetAngularFalloff(float angularFalloff) ``` Sets the angular falloff for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `angularFalloff` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular falloff, 0.01 to 1. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetAngularFalloff( float angularFalloff, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the angular falloff for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `angularFalloff` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular falloff, 0.01 to 1. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetAngularFalloff( float angularFalloff, Action handler ) ``` Sets the angular falloff for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `angularFalloff` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular falloff, 0.01 to 1. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetCastsShadows
```csharp signature public void SetCastsShadows(bool castsShadows) ``` Sets whether shadows are cast from this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `castsShadows` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to cast shadows. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetCastsShadows( bool castsShadows, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets whether shadows are cast from this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `castsShadows` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to cast shadows. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetCastsShadows( bool castsShadows, Action handler ) ``` Sets whether shadows are cast from this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `castsShadows` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to cast shadows. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetColorAndIntensity
```csharp signature public void SetColorAndIntensity(Sansar.Color color, float intensity) ``` Sets the color for this LightComponent. | Parameter | Type | Description | |---|---|---| | `color` | [Sansar.Color](/scripting/api/sansar/color) | The color. | | `intensity` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The intensity, 0 to 100. |
Remarks The intensity is multiplied by the color and then applied to the light. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetColorAndIntensity( Sansar.Color color, float intensity, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the color for this LightComponent. | Parameter | Type | Description | |---|---|---| | `color` | [Sansar.Color](/scripting/api/sansar/color) | The color. | | `intensity` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The intensity, 0 to 100. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks The intensity is multiplied by the color and then applied to the light. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetColorAndIntensity( Sansar.Color color, float intensity, Action handler ) ``` Sets the color for this LightComponent. | Parameter | Type | Description | |---|---|---| | `color` | [Sansar.Color](/scripting/api/sansar/color) | The color. | | `intensity` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The intensity, 0 to 100. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The intensity is multiplied by the color and then applied to the light. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetNearClip
```csharp signature public void SetNearClip(float nearClip) ``` Sets the near clip plane distance for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `nearClip` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The near clip distance, 0 to 500. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetNearClip( float nearClip, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the near clip plane distance for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `nearClip` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The near clip distance, 0 to 500. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetNearClip( float nearClip, Action handler ) ``` Sets the near clip plane distance for this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `nearClip` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The near clip distance, 0 to 500. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This method only affects spot lights. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetRange
```csharp signature public void SetRange(float range) ``` Sets the range for this LightComponent. | Parameter | Type | Description | |---|---|---| | `range` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The range, 1 to 500. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetRange( float range, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the range for this LightComponent. | Parameter | Type | Description | |---|---|---| | `range` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The range, 1 to 500. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetRange( float range, Action handler ) ``` Sets the range for this LightComponent. | Parameter | Type | Description | |---|---|---| | `range` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The range, 1 to 500. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetShadowPriority
```csharp signature public void SetShadowPriority(uint shadowPriority) ``` Sets the shadow priority of this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `shadowPriority` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | Shadow priority. |
Remarks Set this to zero to turn off shadows. This method only affects spot lights. The renderer prioritizes shadows cast from higher priority lights first. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetShadowPriority( uint shadowPriority, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the shadow priority of this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `shadowPriority` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | Shadow priority. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks Set this to zero to turn off shadows. This method only affects spot lights. The renderer prioritizes shadows cast from higher priority lights first. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetShadowPriority( uint shadowPriority, Action handler ) ``` Sets the shadow priority of this LightComponent of type LightType.SpotLight. | Parameter | Type | Description | |---|---|---| | `shadowPriority` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | Shadow priority. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Set this to zero to turn off shadows. This method only affects spot lights. The renderer prioritizes shadows cast from higher priority lights first. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Scene/Light.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Light.cs) - [ScriptLibrary/Scene/LightOnOff.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/LightOnOff.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/lightcomponent --- # LightType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Enumeration for the different types of lights ```csharp public enum LightType ``` ## Values | Value | Description | |---|---| | `Directional` | Lights that illuminate in a single direction across the entire scene. | | `Point` | Lights that illuminate from a point outward in all directions. | | `Spot` | Lights that illuminate from a point outward in a cone shape. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/lighttype --- # MaterialProperties Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation Added in 37.0.0
```csharp public struct MaterialProperties ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [Absorption](#absorption) · [ApplyGlobalWind](#applyglobalwind) New in 47.10.0 · [ApplyUvOffsetToAo](#applyuvoffsettoao) · [ApplyUvOffsetToDiffuse](#applyuvoffsettodiffuse) · [ApplyUvOffsetToEmissive](#applyuvoffsettoemissive) · [AudioReactAdaptiveDisplacement](#audioreactadaptivedisplacement) · [AudioReactAdaptiveFlashEmissive](#audioreactadaptiveflashemissive) · [AudioReactDisplacementOnHigh](#audioreactdisplacementonhigh) · [AudioReactDisplacementOnLow](#audioreactdisplacementonlow) · [AudioReactDisplacementOnMid](#audioreactdisplacementonmid) · [AudioReactEmissiveBrightness](#audioreactemissivebrightness) · [AudioReactEmissiveColor](#audioreactemissivecolor) · [AudioReactFlashEmissiveOnHigh](#audioreactflashemissiveonhigh) · [AudioReactFlashEmissiveOnLow](#audioreactflashemissiveonlow) · [AudioReactFlashEmissiveOnMid](#audioreactflashemissiveonmid) · [AudioReactFlipbookFrame](#audioreactflipbookframe) · [BladeDensity](#bladedensity) New in 47.10.0 · [BladeHeight](#bladeheight) New in 47.10.0 · [BladeWidth](#bladewidth) New in 47.10.0 · [BlendDisplacementFlipbook](#blenddisplacementflipbook) · [BlendOnDisplacementLoop](#blendondisplacementloop) · [Brightness](#brightness) · [DirtRoughness](#dirtroughness) New in 47.10.0 · [DrawAfterimages](#drawafterimages) · [EmissiveIntensity](#emissiveintensity) · [FlipbookFrame](#flipbookframe) · [FlipbookIndex](#flipbookindex) · [FurDensity](#furdensity) New in 47.10.0 · [FurLength](#furlength) New in 47.10.0 · [FurRootColor](#furrootcolor) New in 47.10.0 · [FurThickness](#furthickness) New in 47.10.0 · [FurTipColor](#furtipcolor) New in 47.10.0 · [GrassDensity](#grassdensity) New in 47.10.0 · [GrassDirtColor](#grassdirtcolor) New in 47.10.0 · [GrassLength](#grasslength) New in 47.10.0 · [GrassRootColor](#grassrootcolor) New in 47.10.0 · [GrassThickness](#grassthickness) New in 47.10.0 · [GrassTipColor](#grasstipcolor) New in 47.10.0 · [GravityStrength](#gravitystrength) New in 47.10.0 · [LoopDisplacementFlipbook](#loopdisplacementflipbook) · [LoopFlipbook](#loopflipbook) · [PingPongDisplacementFlipbook](#pingpongdisplacementflipbook) · [ReceiveReflection](#receivereflection) · [RenderBlades](#renderblades) New in 47.10.0 · [RenderFins](#renderfins) New in 47.10.0 · [RenderShells](#rendershells) New in 47.10.0 · [Roughness](#roughness) New in 47.10.0 · [ScrollAlbedo](#scrollalbedo) · [ScrollAo](#scrollao) · [ScrollDisplacement](#scrolldisplacement) · [ScrollDisplacementFactor](#scrolldisplacementfactor) · [ScrollEmissive](#scrollemissive) · [ScrollMask](#scrollmask) · [ScrollMetalness](#scrollmetalness) · [ScrollNormalRoughness](#scrollnormalroughness) · [SelfShadowStrength](#selfshadowstrength) New in 47.10.0 · [ShadowCasting](#shadowcasting) · [ShellHeight](#shellheight) New in 47.10.0 · [Tint](#tint) · [UseCustomBladeShape](#usecustombladeshape) New in 47.10.0 · [VatBlendAnimLoop](#vatblendanimloop) · [VatFrame](#vatframe) · [VatLoopAnim](#vatloopanim) · [VatLoopRunLength](#vatlooprunlength) · [VatLoopStartFrame](#vatloopstartframe) · [VatPingPongAnim](#vatpingponganim) · [VatStepRate](#vatsteprate) · [WindFlowScale](#windflowscale) New in 47.10.0 · [WindStrength](#windstrength) New in 47.10.0 | ## Fields ### Absorption
Added in 37.0.0
```csharp signature public float Absorption ```
### ApplyGlobalWind
New in 47.10.0
```csharp signature public bool ApplyGlobalWind ```
### ApplyUvOffsetToAo
Added in 46.5.0
```csharp signature public bool ApplyUvOffsetToAo ```
### ApplyUvOffsetToDiffuse
Added in 46.5.0
```csharp signature public bool ApplyUvOffsetToDiffuse ```
### ApplyUvOffsetToEmissive
Added in 46.5.0
```csharp signature public bool ApplyUvOffsetToEmissive ```
### AudioReactAdaptiveDisplacement
Added in 46.5.0
```csharp signature public bool AudioReactAdaptiveDisplacement ```
### AudioReactAdaptiveFlashEmissive
Added in 46.5.0
```csharp signature public bool AudioReactAdaptiveFlashEmissive ```
### AudioReactDisplacementOnHigh
Added in 46.5.0
```csharp signature public bool AudioReactDisplacementOnHigh ```
### AudioReactDisplacementOnLow
Added in 46.5.0
```csharp signature public bool AudioReactDisplacementOnLow ```
### AudioReactDisplacementOnMid
Added in 46.5.0
```csharp signature public bool AudioReactDisplacementOnMid ```
### AudioReactEmissiveBrightness
Added in 46.5.0
```csharp signature public bool AudioReactEmissiveBrightness ```
### AudioReactEmissiveColor
Added in 46.5.0
```csharp signature public bool AudioReactEmissiveColor ```
### AudioReactFlashEmissiveOnHigh
Added in 46.5.0
```csharp signature public bool AudioReactFlashEmissiveOnHigh ```
### AudioReactFlashEmissiveOnLow
Added in 46.5.0
```csharp signature public bool AudioReactFlashEmissiveOnLow ```
### AudioReactFlashEmissiveOnMid
Added in 46.5.0
```csharp signature public bool AudioReactFlashEmissiveOnMid ```
### AudioReactFlipbookFrame
Added in 46.5.0
```csharp signature public bool AudioReactFlipbookFrame ```
### BladeDensity
New in 47.10.0
```csharp signature public float BladeDensity ```
### BladeHeight
New in 47.10.0
```csharp signature public float BladeHeight ```
### BladeWidth
New in 47.10.0
```csharp signature public float BladeWidth ```
### BlendDisplacementFlipbook
Added in 46.5.0
```csharp signature public bool BlendDisplacementFlipbook ```
### BlendOnDisplacementLoop
Added in 46.5.0
```csharp signature public bool BlendOnDisplacementLoop ```
### Brightness
Added in 37.0.0
```csharp signature public float Brightness ```
### DirtRoughness
New in 47.10.0
```csharp signature public float DirtRoughness ```
### DrawAfterimages
Added in 46.5.0
```csharp signature public bool DrawAfterimages ```
### EmissiveIntensity
Added in 37.0.0
```csharp signature public float EmissiveIntensity ```
### FlipbookFrame
Added in 37.0.0
```csharp signature public float FlipbookFrame ```
### FlipbookIndex
Added in 46.5.0
```csharp signature public float FlipbookIndex ```
### FurDensity
New in 47.10.0
```csharp signature public float FurDensity ```
### FurLength
New in 47.10.0
```csharp signature public float FurLength ```
### FurRootColor
New in 47.10.0
```csharp signature public Sansar.Color FurRootColor ```
### FurThickness
New in 47.10.0
```csharp signature public float FurThickness ```
### FurTipColor
New in 47.10.0
```csharp signature public Sansar.Color FurTipColor ```
### GrassDensity
New in 47.10.0
```csharp signature public float GrassDensity ```
### GrassDirtColor
New in 47.10.0
```csharp signature public Sansar.Color GrassDirtColor ```
### GrassLength
New in 47.10.0
```csharp signature public float GrassLength ```
### GrassRootColor
New in 47.10.0
```csharp signature public Sansar.Color GrassRootColor ```
### GrassThickness
New in 47.10.0
```csharp signature public float GrassThickness ```
### GrassTipColor
New in 47.10.0
```csharp signature public Sansar.Color GrassTipColor ```
### GravityStrength
New in 47.10.0
```csharp signature public float GravityStrength ```
### LoopDisplacementFlipbook
Added in 46.5.0
```csharp signature public bool LoopDisplacementFlipbook ```
### LoopFlipbook
Added in 46.5.0
```csharp signature public bool LoopFlipbook ```
### PingPongDisplacementFlipbook
Added in 46.5.0
```csharp signature public bool PingPongDisplacementFlipbook ```
### ReceiveReflection
Added in 46.5.0
```csharp signature public bool ReceiveReflection ```
### RenderBlades
New in 47.10.0
```csharp signature public bool RenderBlades ```
### RenderFins
New in 47.10.0
```csharp signature public bool RenderFins ```
### RenderShells
New in 47.10.0
```csharp signature public bool RenderShells ```
### Roughness
New in 47.10.0
```csharp signature public float Roughness ```
### ScrollAlbedo
Added in 46.5.0
```csharp signature public bool ScrollAlbedo ```
### ScrollAo
Added in 46.5.0
```csharp signature public bool ScrollAo ```
### ScrollDisplacement
Added in 46.5.0
```csharp signature public bool ScrollDisplacement ```
### ScrollDisplacementFactor
Added in 46.5.0
```csharp signature public bool ScrollDisplacementFactor ```
### ScrollEmissive
Added in 46.5.0
```csharp signature public bool ScrollEmissive ```
### ScrollMask
Added in 46.5.0
```csharp signature public bool ScrollMask ```
### ScrollMetalness
Added in 46.5.0
```csharp signature public bool ScrollMetalness ```
### ScrollNormalRoughness
Added in 46.5.0
```csharp signature public bool ScrollNormalRoughness ```
### SelfShadowStrength
New in 47.10.0
```csharp signature public float SelfShadowStrength ```
### ShadowCasting
Added in 46.5.0
```csharp signature public bool ShadowCasting ```
### ShellHeight
New in 47.10.0
```csharp signature public float ShellHeight ```
### Tint
Added in 37.0.0
```csharp signature public Sansar.Color Tint ```
### UseCustomBladeShape
New in 47.10.0
```csharp signature public bool UseCustomBladeShape ```
### VatBlendAnimLoop
Added in 46.5.0
```csharp signature public bool VatBlendAnimLoop ```
### VatFrame
Added in 46.5.0
```csharp signature public float VatFrame ```
### VatLoopAnim
Added in 46.5.0
```csharp signature public bool VatLoopAnim ```
### VatLoopRunLength
Added in 46.5.0
```csharp signature public float VatLoopRunLength ```
### VatLoopStartFrame
Added in 46.5.0
```csharp signature public float VatLoopStartFrame ```
### VatPingPongAnim
Added in 46.5.0
```csharp signature public bool VatPingPongAnim ```
### VatStepRate
Added in 46.5.0
```csharp signature public float VatStepRate ```
### WindFlowScale
New in 47.10.0
```csharp signature public float WindFlowScale ```
### WindStrength
New in 47.10.0
```csharp signature public float WindStrength ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/materialproperties --- # MediaAction Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Special actions to perform on media surfaces with SetMediaAction ```csharp public enum MediaAction ``` ## Values | Value | Description | |---|---| | `Invalid` | Invalid action. | | `TwitchMaturityClick` | Click the maturity link on twitch streams. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/mediaaction --- # MeshComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 34.0.0
The MeshComponent handles interactions with static meshes. ```csharp public class MeshComponent : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [IsScriptable](#isscriptable) · [Name](#name) | | **Methods** | [GetIsVisible](#getisvisible) · [GetRenderMaterial](#getrendermaterial) · [GetRenderMaterials](#getrendermaterials) · [SetIsVisible](#setisvisible) · [ToString](#tostring) | ## Fields ### ComponentType
Added in 34.0.0
```csharp signature public static readonly ComponentType ComponentType ``` The [`MeshComponent.ComponentType`](/scripting/api/sansar.simulation/meshcomponent#componenttype) of this component
## Properties ### ComponentId
Added in 34.0.0
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this MeshComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### IsScriptable
Added in 34.0.0
```csharp signature public bool IsScriptable { get; } ``` The scriptable flag for this MeshComponent. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not this mesh can have properties changed by script.
### Name
Added in 34.0.0
```csharp signature public string Name { get; } ``` This MeshComponent name, as specified in the editor.
## Methods ### GetIsVisible
Added in 34.0.0
```csharp signature public bool GetIsVisible() ``` Retrieves the visibility state of this MeshComponent. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The visibility state.
### GetRenderMaterial
Added in 37.0.0
```csharp signature public RenderMaterial GetRenderMaterial(string renderMaterialName) ``` Gets a specific RenderMaterial or null if there is no RenderMaterial of that name. | Parameter | Type | Description | |---|---|---| | `renderMaterialName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | renderMaterialName | **Returns:** [RenderMaterial](/scripting/api/sansar.simulation/rendermaterial)
### GetRenderMaterials
Added in 37.0.0
```csharp signature public IEnumerable GetRenderMaterials() ``` Gets the array of all RenderMaterials for this MeshComponent. **Returns:** [IEnumerable<RenderMaterial>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)
### SetIsVisible
Added in 34.0.0
```csharp signature public void SetIsVisible(bool isVisible) ``` Sets the visibility state of this MeshComponent. | Parameter | Type | Description | |---|---|---| | `isVisible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The visibility state to set. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 34.0.0
```csharp signature public void SetIsVisible( Sansar.Script.SessionId sessionId, bool isVisible ) ``` Sets the visibility state of this MeshComponent. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change static mesh visibility for. | | `isVisible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The visibility state to set. |
Remarks It will only change static mesh visibility for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars).
Added in 34.0.0
```csharp signature public void SetIsVisible(AgentPrivate agent, bool isVisible) ``` Sets the visibility state of this MeshComponent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change static mesh visibility for. | | `isVisible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The visibility state to set. |
Remarks It will only change static mesh visibility for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars).
Added in 34.0.0
```csharp signature public void SetIsVisible( bool isVisible, Action handler ) ``` Sets the visibility state of this MeshComponent. | Parameter | Type | Description | |---|---|---| | `isVisible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The visibility state to set. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 34.0.0
```csharp signature public void SetIsVisible( Sansar.Script.SessionId sessionId, bool isVisible, Action handler ) ``` Sets the visibility state of this MeshComponent. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change static mesh visibility for. | | `isVisible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The visibility state to set. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks It will only change static mesh visibility for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars).
Added in 34.0.0
```csharp signature public void SetIsVisible( AgentPrivate agent, bool isVisible, Action handler ) ``` Sets the visibility state of this MeshComponent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change static mesh visibility for. | | `isVisible` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The visibility state to set. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks It will only change static mesh visibility for a single user and will not persist across client restarts, server restarts, or leaving the scene (even for changing avatars).
### ToString
Added in 34.0.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MeshVisibilityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/MeshVisibilityExample.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs) - [ScriptLibrary/Scene/Visibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Visibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/meshcomponent --- # MirrorComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 47.3.0
The MirrorComponent handles interactions with mirrors. ```csharp public class MirrorComponent : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [IsScriptable](#isscriptable) · [Name](#name) | | **Methods** | [GetIsEnabled](#getisenabled) · [SetIsEnabled](#setisenabled) · [ToString](#tostring) | ## Fields ### ComponentType
Added in 47.3.0
```csharp signature public static readonly ComponentType ComponentType ``` The [`MirrorComponent.ComponentType`](/scripting/api/sansar.simulation/mirrorcomponent#componenttype) of this component
## Properties ### ComponentId
Added in 47.3.0
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this MirrorComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### IsScriptable
Added in 47.3.0
```csharp signature public bool IsScriptable { get; } ``` The scriptable flag for this MirrorComponent. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not this mirror can have properties changed by script.
### Name
Added in 47.3.0
```csharp signature public string Name { get; } ``` This MirrorComponent name, as specified in the editor.
## Methods ### GetIsEnabled
Added in 47.3.0
```csharp signature public bool GetIsEnabled() ``` Retrieves the enabled state of this MirrorComponent. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The enabled state.
### SetIsEnabled
Added in 47.3.0
```csharp signature public void SetIsEnabled(bool isEnabled) ``` Sets the enabled state of this MirrorComponent. | Parameter | Type | Description | |---|---|---| | `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.3.0
```csharp signature public void SetIsEnabled( Sansar.Script.SessionId sessionId, bool isEnabled ) ``` Sets the enabled state of this MirrorComponent for a single user. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change mirror state for. | | `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |
Remarks It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
Added in 47.3.0
```csharp signature public void SetIsEnabled(AgentPrivate agent, bool isEnabled) ``` Sets the enabled state of this MirrorComponent for a single user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change mirror state for. | | `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |
Remarks It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
Added in 47.3.0
```csharp signature public void SetIsEnabled( bool isEnabled, Action handler ) ``` Sets the enabled state of this MirrorComponent. | Parameter | Type | Description | |---|---|---| | `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 47.3.0
```csharp signature public void SetIsEnabled( Sansar.Script.SessionId sessionId, bool isEnabled, Action handler ) ``` Sets the enabled state of this MirrorComponent for a single user. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change mirror state for. | | `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
Added in 47.3.0
```csharp signature public void SetIsEnabled( AgentPrivate agent, bool isEnabled, Action handler ) ``` Sets the enabled state of this MirrorComponent for a single user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change mirror state for. | | `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
### ToString
Added in 47.3.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/mirrorcomponent --- # ModalDialog Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Manages a modal dialog which can be presented to the user. ```csharp public class ModalDialog : Sansar.Script.InstanceInterface ``` ## Remarks Set the message and the button text. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Message](#message) · [Response](#response) | | **Methods** | [Cancel](#cancel) · [Show](#show) · [ToString](#tostring) | ## Properties ### Message
```csharp signature public string Message { get; } ``` The message displayed on the dialog. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The string displayed on the dialog.
Remarks This is set by the [`ModalDialog.Show`](/scripting/api/sansar.simulation/modaldialog#show-string-string-string-operationcomplete) method upon creation.
### Response
```csharp signature public string Response { get; } ``` The response from the last [`ModalDialog.Show`](/scripting/api/sansar.simulation/modaldialog#show-string-string-string-operationcomplete) call. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String response from the last show call.
Remarks This value will be valid after the event occurs.
## Methods ### Cancel
```csharp signature public void Cancel() ``` Cancels any existing dialog.
Remarks Does not generate an event.
### Show
```csharp signature public void Show( string message, string leftButton, string rightButton ) ``` Shows a Modal Dialog on the screen. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the dialog. | | `leftButton` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the left button. | | `rightButton` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the right button. |
Remarks Call this with [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-action-t-t-t) in a coroutine to block until the event is generated.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Show( string message, string leftButton, string rightButton, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Shows a Modal Dialog on the screen. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the dialog. | | `leftButton` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the left button. | | `rightButton` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the right button. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The internal event id for the completion event.
Remarks Call this with [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-action-t-t-t) in a coroutine to block until the event is generated.
```csharp signature public void Show( string message, string leftButton, string rightButton, Action handler ) ``` Shows a Modal Dialog on the screen. | Parameter | Type | Description | |---|---|---| | `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the dialog. | | `leftButton` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the left button. | | `rightButton` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the right button. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Call this with [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-action-t-t-t) in a coroutine to block until the event is generated.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [StatsExample.cs](/scripting/examples/stats-example) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [ScriptLibrary/Scene/Prompt.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Prompt.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/modaldialog --- # MoveMode Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 32.0.0
Type of interpolation to use for movement ```csharp public enum MoveMode ``` ## Remarks Movement is computed according to the movement type with a parametric parameter 't' that varies from zero to one. - Linear movement is directly proportional to 't'. - Ease-in movement is proportional to 't^2'. - Ease-out movement is computed with 't\*(2-t)'. - Smoothstep interpolation uses '(3-2t)\*t^2'. ## Values | Value | Description | |---|---| | `EaseIn` Added in 32.0.0 | Ease In. The object with move slowly at first and quickly at the end. | | `EaseOut` Added in 32.0.0 | Ease Out. The object with move quickly at first and slow down at the end. | | `Linear` Added in 32.0.0 | Linear Interpolation. The object will move at a constant velocity. | | `Smoothstep` Added in 32.0.0 | Smoothstep Interpolation. The object with speed up and slow down smoothly when moving. | ## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample2.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - `MoverExample4.cs` - [ScriptLibrary/Scene/Mover.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Mover.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/movemode --- # Mover Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 32.0.0
The Mover handles adding moves to process for an object. ```csharp public class Mover : Sansar.Script.InstanceInterface ``` ## Remarks The Movable From Script flag must be set to true in the editor to use the Mover. Additionally, player characters and rigid bodies with Static or Dynamic motion types cannot be moved using the Mover. Unlike the RigidBodyComponent movement functions, the Mover can be applied to objects that do not contain Volumes. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [IsMoving](#ismoving) · [MoveCount](#movecount) | | **Methods** | [AddMove](#addmove) New in 47.10.0 · [AddMoveOffset](#addmoveoffset) New in 47.10.0 · [AddPause](#addpause) · [AddRotate](#addrotate) · [AddRotateOffset](#addrotateoffset) · [AddTranslate](#addtranslate) · [AddTranslateOffset](#addtranslateoffset) · [StopAndClear](#stopandclear) · [ToString](#tostring) | ## Properties ### IsMoving
Added in 32.0.0
```csharp signature public bool IsMoving { get; } ``` Property to check if a move command is currently executing for this Mover. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not this object is currently executing a move (includes pauses).
### MoveCount
Added in 32.0.0
```csharp signature public int MoveCount { get; } ``` The number of move commands waiting to be excuted and currently executing for this Mover. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The number of enqueued move commands. Includes the current active move and any pause commands.
## Methods ### AddMove
Added in 32.0.0
```csharp signature public void AddMove( Sansar.Vector position, Sansar.Quaternion rotation ) ``` Sets the transform of this Mover to a target World Space position and rotation. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddMove( Sansar.Vector position, Sansar.Quaternion rotation, Action handler ) ``` Sets the transform of this Mover to a target World Space position and rotation. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddMove( Sansar.Vector targetPosition, Sansar.Quaternion targetRotation, double timeInSeconds, MoveMode interpolationMode ) ``` Translate and rotate the Mover to the target World Space position and rotation over time. | Parameter | Type | Description | |---|---|---| | `targetPosition` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `targetRotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
New in 47.10.0
```csharp signature public void AddMove( Sansar.Vector targetPosition, Sansar.Quaternion targetRotation, double timeInSeconds, MoveMode translationMode, MoveMode rotationMode ) ``` Translate and rotate the Mover to the target World Space position and rotation over time, using separate interpolation modes. | Parameter | Type | Description | |---|---|---| | `targetPosition` | [Sansar.Vector](/scripting/api/sansar/vector) | The target world space position. | | `targetRotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target world space rotation. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The shared duration in seconds for translation and rotation. | | `translationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to translation only. | | `rotationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to rotation only. |
Remarks This asynchronous method queues one combined move command then returns. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddMove( Sansar.Vector targetPosition, Sansar.Quaternion targetRotation, double timeInSeconds, MoveMode interpolationMode, Action handler ) ``` Translate and rotate the Mover to the target World Space position and rotation over time. | Parameter | Type | Description | |---|---|---| | `targetPosition` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `targetRotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
New in 47.10.0
```csharp signature public void AddMove( Sansar.Vector targetPosition, Sansar.Quaternion targetRotation, double timeInSeconds, MoveMode translationMode, MoveMode rotationMode, Action handler ) ``` Translate and rotate the Mover to the target World Space position and rotation over time, using separate interpolation modes. | Parameter | Type | Description | |---|---|---| | `targetPosition` | [Sansar.Vector](/scripting/api/sansar/vector) | The target world space position. | | `targetRotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target world space rotation. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The shared duration in seconds for translation and rotation. | | `translationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to translation only. | | `rotationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to rotation only. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues one combined move command then returns. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddMoveOffset
Added in 33.2.0
```csharp signature public void AddMoveOffset( Sansar.Vector positionOffset, Sansar.Quaternion rotationOffset ) ``` Sets the transform of this Mover to a target Local Space position and rotation. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddMoveOffset( Sansar.Vector positionOffset, Sansar.Quaternion rotationOffset, Action handler ) ``` Sets the transform of this Mover to a target Local Space position and rotation. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddMoveOffset( Sansar.Vector positionOffset, Sansar.Quaternion rotationOffset, double timeInSeconds, MoveMode interpolationMode ) ``` Translate and rotate the Mover to the target Local Space position and rotation over time. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
New in 47.10.0
```csharp signature public void AddMoveOffset( Sansar.Vector positionOffset, Sansar.Quaternion rotationOffset, double timeInSeconds, MoveMode translationMode, MoveMode rotationMode ) ``` Translate and rotate the Mover by Local Space offsets over time, using separate interpolation modes. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset from the final queued target transform. | | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset from the final queued target transform. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The shared duration in seconds for translation and rotation. | | `translationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to translation only. | | `rotationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to rotation only. |
Remarks This asynchronous method queues one combined move command then returns. Translation is applied in local space before the rotation offset, relative to the final queued target transform. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddMoveOffset( Sansar.Vector positionOffset, Sansar.Quaternion rotationOffset, double timeInSeconds, MoveMode interpolationMode, Action handler ) ``` Translate and rotate the Mover to the target Local Space position and rotation over time. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
New in 47.10.0
```csharp signature public void AddMoveOffset( Sansar.Vector positionOffset, Sansar.Quaternion rotationOffset, double timeInSeconds, MoveMode translationMode, MoveMode rotationMode, Action handler ) ``` Translate and rotate the Mover by Local Space offsets over time, using separate interpolation modes. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset from the final queued target transform. | | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset from the final queued target transform. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The shared duration in seconds for translation and rotation. | | `translationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to translation only. | | `rotationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The interpolation mode applied to rotation only. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues one combined move command then returns. Translation is applied in local space before the rotation offset, relative to the final queued target transform. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddPause
Added in 32.0.0
```csharp signature public void AddPause(double timeInSeconds) ``` Adds a pause of the given length for this Mover. | Parameter | Type | Description | |---|---|---| | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The amount of time in seconds that the movement should be paused. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddPause( double timeInSeconds, Action handler ) ``` Adds a pause of the given length for this Mover. | Parameter | Type | Description | |---|---|---| | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The amount of time in seconds that the movement should be paused. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddRotate
Added in 32.0.0
```csharp signature public void AddRotate(Sansar.Quaternion rotation) ``` Sets the rotation of this Mover to a target World Space rotation. | Parameter | Type | Description | |---|---|---| | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddRotate( Sansar.Quaternion rotation, Action handler ) ``` Sets the rotation of this Mover to a target World Space rotation. | Parameter | Type | Description | |---|---|---| | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddRotate( Sansar.Quaternion targetRotation, double timeInSeconds, MoveMode interpolationMode ) ``` Rotate the Mover to the target World Space rotation over time. | Parameter | Type | Description | |---|---|---| | `targetRotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddRotate( Sansar.Quaternion targetRotation, double timeInSeconds, MoveMode interpolationMode, Action handler ) ``` Rotate the Mover to the target World Space rotation over time. | Parameter | Type | Description | |---|---|---| | `targetRotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The target rotation. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddRotateOffset
Added in 33.2.0
```csharp signature public void AddRotateOffset(Sansar.Quaternion rotationOffset) ``` Sets the rotation of this Mover to a target Local Space rotation. | Parameter | Type | Description | |---|---|---| | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddRotateOffset( Sansar.Quaternion rotationOffset, Action handler ) ``` Sets the rotation of this Mover to a target Local Space rotation. | Parameter | Type | Description | |---|---|---| | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddRotateOffset( Sansar.Quaternion rotationOffset, double timeInSeconds, MoveMode interpolationMode ) ``` Rotate the Mover to the target Local Space rotation over time. | Parameter | Type | Description | |---|---|---| | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddRotateOffset( Sansar.Quaternion rotationOffset, double timeInSeconds, MoveMode interpolationMode, Action handler ) ``` Rotate the Mover to the target Local Space rotation over time. | Parameter | Type | Description | |---|---|---| | `rotationOffset` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The local space rotation offset. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddTranslate
Added in 32.0.0
```csharp signature public void AddTranslate(Sansar.Vector position) ``` Sets the position of this Mover to a target World Space position. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddTranslate( Sansar.Vector position, Action handler ) ``` Sets the position of this Mover to a target World Space position. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddTranslate( Sansar.Vector targetPosition, double timeInSeconds, MoveMode interpolationMode ) ``` Translate the Mover to the target World Space position over time. | Parameter | Type | Description | |---|---|---| | `targetPosition` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void AddTranslate( Sansar.Vector targetPosition, double timeInSeconds, MoveMode interpolationMode, Action handler ) ``` Translate the Mover to the target World Space position over time. | Parameter | Type | Description | |---|---|---| | `targetPosition` | [Sansar.Vector](/scripting/api/sansar/vector) | The target position. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddTranslateOffset
Added in 33.2.0
```csharp signature public void AddTranslateOffset(Sansar.Vector positionOffset) ``` Sets the position of this Mover to a target Local Space position. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddTranslateOffset( Sansar.Vector positionOffset, Action handler ) ``` Sets the position of this Mover to a target Local Space position. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddTranslateOffset( Sansar.Vector positionOffset, double timeInSeconds, MoveMode interpolationMode ) ``` Translate the Mover to the target Local Space position over time. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 33.2.0
```csharp signature public void AddTranslateOffset( Sansar.Vector positionOffset, double timeInSeconds, MoveMode interpolationMode, Action handler ) ``` Translate the Mover to the target Local Space position over time. | Parameter | Type | Description | |---|---|---| | `positionOffset` | [Sansar.Vector](/scripting/api/sansar/vector) | The local space position offset. | | `timeInSeconds` | [double](https://learn.microsoft.com/dotnet/api/system.double) | The time in seconds to move over. | | `interpolationMode` | [MoveMode](/scripting/api/sansar.simulation/movemode) | The method of interpolation to use when moving. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### StopAndClear
Added in 32.0.0
```csharp signature public void StopAndClear() ``` Stops the current movement and clears any further movements for this Mover.
Remarks This method is not enqueued like other operations on the Mover. To block until the operation has executed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Added in 32.0.0
```csharp signature public void StopAndClear( Action handler ) ``` Stops the current movement and clears any further movements for this Mover. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This method is not enqueued like other operations on the Mover. To block until the operation has executed, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### ToString
Added in 32.0.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample2.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - `MoverExample4.cs` - [ScriptLibrary/Scene/KeyframedMotion.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/KeyframedMotion.cs) - [ScriptLibrary/Scene/Mover.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Mover.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/mover --- # Objective Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 34.7.0
The Objective is the interface for a user's Quest Objective ```csharp public class Objective : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Agent](#agent) · [Count](#count) · [Definition](#definition) · [Ready](#ready) | | **Methods** | [GetState](#getstate) · [SetState](#setstate) · [Subscribe](#subscribe) · [ToString](#tostring) · [Update](#update) | ## Properties ### Agent
Added in 34.7.0
```csharp signature public Sansar.Script.SessionId Agent { get; } ``` The session Id for the user on this quest.
### Count
Added in 36.3.0
```csharp signature public int Count { get; set; } ``` Get the number of objectives collected for this user.
Remarks Returns -1 if the Objective is not Ready.
### Definition
Added in 34.7.0
```csharp signature public ObjectiveDefinition Definition { get; } ``` The [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition) for this quest.
### Ready
Added in 36.7.0
```csharp signature public bool Ready { get; } ``` If the Objective data is ready.
Remarks Returns false until the data has been fetched from the quest service. Once it returns true it will always return true.
## Methods ### GetState
Added in 34.7.0
```csharp signature public ObjectiveState GetState() ``` The [`ObjectiveState`](/scripting/api/sansar.simulation/objectivestate) representing the user's progress in the quest **Returns:** [ObjectiveState](/scripting/api/sansar.simulation/objectivestate)
### SetState
Added in 34.7.0
```csharp signature public void SetState(ObjectiveState state) ``` Set the state of the objective. | Parameter | Type | Description | |---|---|---| | `state` | [ObjectiveState](/scripting/api/sansar.simulation/objectivestate) | The state to transition to. |
Remarks Some state changes may not be permitted, in these cases [`OperationCompleteEvent`](/scripting/api/sansar.script/operationcompleteevent) success will be false.
Added in 34.7.0
```csharp signature public void SetState( ObjectiveState state, Action handler ) ``` Set the state of the objective. | Parameter | Type | Description | |---|---|---| | `state` | [ObjectiveState](/scripting/api/sansar.simulation/objectivestate) | The state to transition to. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Some state changes may not be permitted, in these cases [`OperationCompleteEvent`](/scripting/api/sansar.script/operationcompleteevent) success will be false.
### Subscribe
Added in 34.7.0
```csharp signature public Sansar.Script.IEventSubscription Subscribe( ObjectiveState State, Action callback, bool persistent ) ``` Subscribes to Objective Events. | Parameter | Type | Description | |---|---|---| | `State` | [ObjectiveState](/scripting/api/sansar.simulation/objectivestate) | The state of the objective | | `callback` | [Action<ObjectiveData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### Update
Added in 36.7.0
```csharp signature public void Update() ``` Update the ObjectiveDefinition data.
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
Added in 36.7.0
```csharp signature public void Update( Action handler ) ``` Update the ObjectiveDefinition data. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestGiverInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverInteraction.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objective --- # ObjectiveData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData Added in 34.7.0
Handler for Objective state change events. ```csharp public class ObjectiveData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentId](#agentid) · [State](#state) | | **Methods** | [ToString](#tostring) | ## Properties ### AgentId
Added in 34.7.0
```csharp signature public Sansar.Script.SessionId AgentId { get; } ``` The SessionId of the agent on the quest.
### State
Added in 34.7.0
```csharp signature public ObjectiveState State { get; } ``` The state of the objective
## Methods ### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectivedata --- # ObjectiveDefinition Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 34.7.0
The ObjectiveDefinition stores the data that is used to create quest objective instances for users. ```csharp public class ObjectiveDefinition : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Description](#description) · [InitialState](#initialstate) · [Ready](#ready) · [RequiredCount](#requiredcount) · [Title](#title) | | **Methods** | [GetObjective](#getobjective) · [ToString](#tostring) · [Update](#update) | ## Properties ### Description
Added in 34.7.0
```csharp signature public string Description { get; } ``` The objective description.
Remarks Returns null if Ready is false because the objective definition is not ready.
### InitialState
Added in 36.0.1
```csharp signature public ObjectiveState InitialState { get; } ``` The initial state that this objective will have when a user starts the quest
Remarks Returns None if Ready is false, because the objective definition is not ready.
### Ready
Added in 34.7.0
```csharp signature public bool Ready { get; } ``` If the QuestDefinition data is ready.
Remarks Returns false until the data has been fetched from the quest service. Once it returns true it will always return true.
### RequiredCount
Added in 36.3.0
```csharp signature public int RequiredCount { get; } ``` The required count to complete the objective.
Remarks Returns -1 if Ready is false because the objective definition is not ready.
### Title
Added in 34.7.0
```csharp signature public string Title { get; } ``` The objective title.
Remarks Returns null if Ready is false because the objective definition is not ready.
## Methods ### GetObjective
Added in 34.7.0
```csharp signature public void GetObjective(Sansar.Script.SessionId agent) ``` Get the state of this objective for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The [`SessionId`](/scripting/api/sansar.script/sessionid) of the user. |
Added in 34.7.0
```csharp signature public void GetObjective(AgentPrivate agent) ``` Get the state of this objective for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Obtain the objective state for this user. |
Added in 34.7.0
```csharp signature public void GetObjective( Sansar.Script.SessionId agent, Action handler ) ``` Get the state of this objective for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The [`SessionId`](/scripting/api/sansar.script/sessionid) of the user. | | `handler` | [Action<ObjectiveDefinition.GetObjectiveData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Added in 34.7.0
```csharp signature public void GetObjective( AgentPrivate agent, Action handler ) ``` Get the state of this objective for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Obtain the objective state for this user. | | `handler` | [Action<ObjectiveDefinition.GetObjectiveData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### Update
Added in 34.7.0
```csharp signature public void Update() ``` Update the ObjectiveDefinition data.
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
Added in 34.7.0
```csharp signature public void Update( Action handler ) ``` Update the ObjectiveDefinition data. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
## Used in examples - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectivedefinition --- # ObjectiveDefinition.GetObjectiveData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.OperationCompleteEvent Added in 34.7.0
```csharp public class ObjectiveDefinition.GetObjectiveData : Sansar.Script.OperationCompleteEvent ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Objective](#objective) | | **Methods** | [ToString](#tostring) | ## Properties ### Objective
Added in 34.7.0
```csharp signature public Objective Objective { get; } ```
## Methods ### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectivedefinition.getobjectivedata --- # ObjectiveState Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 34.7.0
State of a quest objective for a user. ```csharp public enum ObjectiveState ``` ## Values | Value | Description | |---|---| | `Active` Added in 34.7.0 | The objective is currently active and available to complete for this user. | | `Completed` Added in 34.7.0 | The objective has been completed for this user. | | `Locked` Added in 34.7.0 | The objective is locked for this user and can not be completed. | | `None` Added in 34.7.0 | The objective state is not set, probably the user is not on the quest. | ## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestGiverInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverInteraction.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectivestate --- # ObjectPrivate Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Interface to an object in a [`Cluster`](/scripting/api/sansar.simulation/cluster) in the Scene. ```csharp public class ObjectPrivate : Sansar.Script.InstanceInterface ``` ## Remarks Provides basic information about an object. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ForwardVector](#forwardvector) · [InitialPosition](#initialposition) · [InitialRotation](#initialrotation) · [IsMovable](#ismovable) · [Mover](#mover) · [Name](#name) · [ObjectId](#objectid) · [Position](#position) · [RightVector](#rightvector) · [Rotation](#rotation) · [UpVector](#upvector) | | **Methods** | [AddInteraction](#addinteraction) · [FindScripts](#findscripts) · [GetComponent](#getcomponent) · [GetComponentCount](#getcomponentcount) · [LookupScripts](#lookupscripts) · [ToString](#tostring) · [TryGetComponent](#trygetcomponent) · [TryGetFirstComponent](#trygetfirstcomponent) | ## Properties ### ForwardVector
```csharp signature public Sansar.Vector ForwardVector { get; } ``` The forward vector of the ObjectPrivate in the world frame. **Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.
### InitialPosition
```csharp signature public Sansar.Vector InitialPosition { get; } ``` The position of the ObjectPrivate in world frame before simulation started.
### InitialRotation
```csharp signature public Sansar.Quaternion InitialRotation { get; } ``` The rotation of the ObjectPrivate in world frame before simulation started.
### IsMovable
Added in 32.0.0
```csharp signature public bool IsMovable { get; } ```
### Mover
Added in 32.0.0
```csharp signature public Mover Mover { get; } ```
### Name
Added in 31.1.0
```csharp signature public string Name { get; } ``` This ObjectPrivate name, as specified in the editor.
### ObjectId
```csharp signature public Sansar.Script.ObjectId ObjectId { get; } ``` This ObjectPrivate Id. Unique to this Scene.
### Position
```csharp signature public Sansar.Vector Position { get; } ``` The current position of the ObjectPrivate in world frame.
### RightVector
```csharp signature public Sansar.Vector RightVector { get; } ``` The right vector of the ObjectPrivate in the world frame. **Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.
### Rotation
```csharp signature public Sansar.Quaternion Rotation { get; } ``` The current rotation of the ObjectPrivate in the world frame.
### UpVector
```csharp signature public Sansar.Vector UpVector { get; } ``` The up vector of the ObjectPrivate in the world frame. **Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.
## Methods ### AddInteraction
```csharp signature public void AddInteraction(string prompt, bool enabled) ``` Add an Interaction to the object to make it clickable. | Parameter | Type | Description | |---|---|---| | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string prompt to show on hover, leave blank to only highlight the object. | | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Whether or not the interaction is enabled. |
Remarks The [`ObjectPrivate.AddInteractionData`](/scripting/api/sansar.simulation/objectprivate.addinteractiondata) will include the Interaction object which can be subscribed to.
```csharp signature public void AddInteraction( string prompt, bool enabled, Action handler ) ``` Add an Interaction to the object to make it clickable. | Parameter | Type | Description | |---|---|---| | `prompt` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string prompt to show on hover, leave blank to only highlight the object. | | `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Whether or not the interaction is enabled. | | `handler` | [Action<ObjectPrivate.AddInteractionData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The [`ObjectPrivate.AddInteractionData`](/scripting/api/sansar.simulation/objectprivate.addinteractiondata) will include the Interaction object which can be subscribed to.
### FindScripts
Added in 32.0.0
```csharp signature [Sansar.Script.NonReflective] [System.Runtime.CompilerServices.IteratorStateMachine(typeof(Sansar.Simulation.ObjectPrivate/d__52`1))] public IEnumerable FindScripts() where TInterface : class ``` Looks up scripts on this ObjectPrivate that match the interface type. **Type parameters:** `TInterface`: The interface to find. **Returns:** [IEnumerable<TInterface>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumerable which contains all scripts of the given type name on this ObjectPrivate that match the given interface.
Remarks The name given corresponds to the `Type.FullName` of the main script class. Multiple scripts may define unrelated types of the same name, but only registered scripts that match the interface of TInterface will be returned.
```csharp signature [Sansar.Script.NonReflective] [System.Runtime.CompilerServices.IteratorStateMachine(typeof(Sansar.Simulation.ObjectPrivate/d__51`1))] public IEnumerable FindScripts( string name ) where TInterface : class ``` Looks up scripts on this ObjectPrivate that match the interface type by class name. | Parameter | Type | Description | |---|---|---| | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The type name of the script's class to find. | **Type parameters:** `TInterface`: The interface to find. **Returns:** [IEnumerable<TInterface>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumerable which contains all scripts of the given type name on this ObjectPrivate that match the given interface.
Remarks The name given corresponds to the `Type.FullName` of the main script class. Multiple scripts may define unrelated types of the same name, but only registered scripts that match the interface of TInterface will be returned.
### GetComponent
```csharp signature public object GetComponent(ComponentType componentType, uint index) ``` Get interfaces to the components that are available at runtime. | Parameter | Type | Description | |---|---|---| | `componentType` | [ComponentType](/scripting/api/sansar.simulation/componenttype) | [`ComponentType`](/scripting/api/sansar.simulation/componenttype). | | `index` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | uint32 index | **Returns:** [object](https://learn.microsoft.com/dotnet/api/system.object)
### GetComponentCount
```csharp signature public uint GetComponentCount(ComponentType componentType) ``` Get the number of components of a particular component type. [`ComponentType`](/scripting/api/sansar.simulation/componenttype) | Parameter | Type | Description | |---|---|---| | `componentType` | [ComponentType](/scripting/api/sansar.simulation/componenttype) | [`ComponentType`](/scripting/api/sansar.simulation/componenttype) | **Returns:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32)
### LookupScripts
```csharp signature public object[] LookupScripts() ``` Get handles to the scripts on the ObjectPrivate **Returns:** [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] — object \[\] of Objects of the scripts on the ObjectPrivate
Remarks The returned Objects are the created script types. For example if a script on the object is `public MyTestObject : ObjectScript` then the Objects in the array will be of type `MyTestObject`.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### TryGetComponent
```csharp signature public bool TryGetComponent( uint index, out ComponentClass component ) where ComponentClass : class ``` Try to get a component of a particular type from this ObjectPrivate | Parameter | Type | Description | |---|---|---| | `index` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The index of this component type to get. zero based index. | | `component` | ComponentClass | The component out parameter of the correct type to get. | **Type parameters:** `ComponentClass`: The component type. [`AnimationComponent`](/scripting/api/sansar.simulation/animationcomponent) [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if a component of the correct type at index is found, false otherwise.
### TryGetFirstComponent
```csharp signature public bool TryGetFirstComponent( out ComponentClass component ) where ComponentClass : class ``` Try to get the first component of a specific type on this ObjectPrivate | Parameter | Type | Description | |---|---|---| | `component` | ComponentClass | Out parameter of the correct component type. | **Type parameters:** `ComponentClass`: The component type. [`AnimationComponent`](/scripting/api/sansar.simulation/animationcomponent) and [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Returns true if able to get a component of the correct type on this ObjectPrivate.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample2.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [RandomMovement.cs](/scripting/examples/random-movement) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [StatsExample.cs](/scripting/examples/stats-example) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [AnimationExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AnimationExample.cs) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` …and 43 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectprivate --- # ObjectPrivate.AddInteractionData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The result of AddInteraction request. ```csharp public class ObjectPrivate.AddInteractionData : Sansar.Script.OperationCompleteEvent ``` ## Remarks See [`ObjectPrivate.AddInteraction`](/scripting/api/sansar.simulation/objectprivate#addinteraction-string-boolean-action) ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Interaction](#interaction) | | **Methods** | [ToString](#tostring) | ## Properties ### Interaction
```csharp signature public Interaction Interaction { get; } ``` The interaction that was added.
Remarks Null if adding the Interaction failed or there was already an Interaction on the object.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Scene/Interaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Interaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectprivate.addinteractiondata --- # ObjectPublic Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The ObjectPublic class is a more limited subset of the [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) API for use by other scripts in the scene. ```csharp public class ObjectPublic : Sansar.Script.InstanceInterface ``` ## Remarks [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) has wider access than ObjectPublic. Objects may be removed from the scene at any time. Attempting to use an ObjectPublic interface for an object no longer in the scene will throw a NullReferenceException. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ForwardVector](#forwardvector) · [InitialPosition](#initialposition) · [InitialRotation](#initialrotation) · [Name](#name) · [ObjectId](#objectid) · [Position](#position) · [RightVector](#rightvector) · [Rotation](#rotation) · [UpVector](#upvector) | | **Methods** | [ToString](#tostring) | ## Properties ### ForwardVector
```csharp signature public Sansar.Vector ForwardVector { get; } ``` The forward vector of the ObjectPublic in the world frame. **Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.
### InitialPosition
```csharp signature public Sansar.Vector InitialPosition { get; } ``` The position of the ObjectPublic in world frame before simulation started.
### InitialRotation
```csharp signature public Sansar.Quaternion InitialRotation { get; } ``` The rotation of the ObjectPublic in world frame before simulation started.
### Name
Added in 31.1.0
```csharp signature public string Name { get; } ``` This ObjectPublic name, as specified in the editor.
### ObjectId
```csharp signature public Sansar.Script.ObjectId ObjectId { get; } ``` This ObjectPublic Id. Unique to this Scene.
### Position
```csharp signature public Sansar.Vector Position { get; } ``` The current position of the ObjectPublic in world frame.
### RightVector
```csharp signature public Sansar.Vector RightVector { get; } ``` The right vector of the ObjectPublic in the world frame. **Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.
### Rotation
```csharp signature public Sansar.Quaternion Rotation { get; } ``` The current rotation of the ObjectPublic in the world frame.
### UpVector
```csharp signature public Sansar.Vector UpVector { get; } ``` The up vector of the ObjectPublic in the world frame. **Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectpublic --- # ObjectScript Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.ScriptBase
Extend SceneObjectScript to create a script that can be used on content that is rezzable in a scene. ```csharp public abstract class ObjectScript : Sansar.Script.ScriptBase ``` ## Remarks ObjectScript scripts on objects will be run when rezzed by other scripts via [`ScenePrivate.CreateCluster`](/scripting/api/sansar.simulation/sceneprivate#createcluster-clusterresource-vector-quaternion-vector-createclusterhandler) Override [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) for script initialization, primarily event subscriptions. Use [`ObjectScript.ObjectPrivate`](/scripting/api/sansar.simulation/objectscript#objectprivate) to access the Object the script is on. Use [`ObjectScript.ScenePublic`](/scripting/api/sansar.simulation/objectscript#scenepublic) to access the Scene the object is in. ```csharp title="ObjectScriptExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "© 2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2018 Linden Research, Inc. Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ /* Start a coroutine to wait for collision events. * Which types of collisions are handled may be set on the properties panel for * the object when editing the scene. */ using Sansar.Simulation; using Sansar.Script; using System; // To get full access to the Object API a script must extend from ObjectScript public class ObjectScriptExample : ObjectScript { // Components can be set in the editor if the correct component types are added to the object [EditorVisible] private RigidBodyComponent RigidBody = null; [DefaultValue(true)] [DisplayName("Track Avatar Hits")] [EditorVisible] private bool TrackAgentHits = true; [DefaultValue(true)] [DisplayName("Track Object Hits")] [EditorVisible] private bool TrackObjectHits = true; public ObjectScriptExample() { // Script initialization order: // Constructor (this method) // Set base class members (ObjectScript's ExperienceInfo, SceneInfo, and ObjectPrivate) // Set public fields that were configured at edit time (RigidBody, TrackAgentHist, TrackObjectHits) // Init() } // Override Init to set up event handlers and start coroutines. public override void Init() { // When unhandled exceptions occur, they may be caught with this event handler. // Certain exceptions may not be recoverable at all and may cause the script to // immediately be removed. Script.UnhandledException += UnhandledException; // If the object had its components set in the editor they should now have the member initialized // The component can also be found dynamically if (RigidBody == null) { if (!ObjectPrivate.TryGetFirstComponent(out RigidBody)) { // Since object scripts are initialized when the scene loads, no one will actually see this message. ScenePublic.Chat.MessageAllUsers("There is no RigidBodyComponent attached to this object."); return; } } // Convert the supplied bools to the correct CollisionEventType to track CollisionEventType trackedEvents = 0; if (TrackAgentHits) { trackedEvents |= CollisionEventType.CharacterContact; } if (TrackObjectHits) { trackedEvents |= CollisionEventType.RigidBodyContact; } // StartCoroutine will queue CheckForCollisions to run // Arguments after the coroutine method are passed as arguments to the method. StartCoroutine(CheckForCollisions, trackedEvents); } private void CheckForCollisions(CollisionEventType trackedEvents) { while (true) { // This will block the coroutine until a collision happens CollisionData data = (CollisionData)WaitFor(RigidBody.Subscribe, trackedEvents, Sansar.Script.ComponentId.Invalid); if (data.EventType == CollisionEventType.CharacterContact) { ScenePublic.Chat.MessageAllUsers("I hit an avatar!"); } else { ScenePublic.Chat.MessageAllUsers("I hit an object!"); } } } private void UnhandledException(object sender, Exception e) { // Depending on the script scheduling policy, the exception may or may not be recoverable. // An unrecoverable exception that can be handled will only be given a short time to run // so the handler method needs to be kept small. // Any exception thrown from this method will terminate the script regardless of the value // of UnhandledExceptionRecoverable if (!Script.UnhandledExceptionRecoverable) { ScenePublic.Chat.MessageAllUsers("Unrecoverable exception happened, the script will now be removed."); } else { ScenePublic.Chat.MessageAllUsers("This script will be allowed to continue."); } } } ```

Source: Examples/ObjectScriptExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Constructors** | [ObjectScript](#objectscript) | | **Properties** | [AllowedContexts](#allowedcontexts) · [ObjectPrivate](#objectprivate) · [ScenePublic](#scenepublic) | ## Constructors ### ObjectScript
```csharp signature protected ObjectScript() ``` This constructor is called before any properties have been set. Override [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) to initialize the script after properties have been set.
## Properties ### AllowedContexts
```csharp signature protected override sealed Sansar.Script.Reflective.Context AllowedContexts { get; } ``` Internal use only.
### ObjectPrivate
```csharp signature [Sansar.Script.NonReflective] public ObjectPrivate ObjectPrivate { protected get; set; } ``` The ObjectPrivate this script is attached to if it is attached to an object. **Value:** [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) — The scene object this script is attached to if it is attached to an object, null otherwise.
Remarks For AgentScripts this is the Agent's ObjectPrivate of their avatar.
### ScenePublic
```csharp signature [Sansar.Script.NonReflective] public ScenePublic ScenePublic { protected get; set; } ``` Public scene information for the current scene. **Value:** [ScenePublic](/scripting/api/sansar.simulation/scenepublic) — The Scene this object is in.
Remarks This value will be set before Init is called.
## Used in examples - [MoverExample2.cs](/scripting/examples/mover-examples) - [GravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/GravityExample.cs) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/objectscript --- # PlayHandle Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The PlayHandle represents audio play handles. ```csharp public class PlayHandle : Sansar.Script.InstanceInterface, IDisposable ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [Dispose](#dispose) · [Finalize](#finalize) · [GetLoudness](#getloudness) · [GetPitchShift](#getpitchshift) · [GetRemainingSeconds](#getremainingseconds) · [GetStatus](#getstatus) · [IsPlaying](#isplaying) · [OnFinished](#onfinished) · [SetLoudness](#setloudness) · [SetPitchShift](#setpitchshift) · [Stop](#stop) | ## Methods ### Dispose
```csharp signature public void Dispose() ``` Releases resources held by this instance.
### Finalize
```csharp signature void Finalize() ```
Remarks Ensures that this instance has been Disposed.
### GetLoudness
```csharp signature public float GetLoudness() ``` Retrieves the loudness for this PlayHandle. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The loudness (in dB).
Remarks This synchronous method returns the broadcasted loudness. It does not wait to hear back from clients.
### GetPitchShift
```csharp signature public float GetPitchShift() ``` Retrieves the relative pitch for this PlayHandle. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The relative pitch.
Remarks This synchronous method returns the broadcasted pitch. It does not wait to hear back from clients.
### GetRemainingSeconds
```csharp signature public float GetRemainingSeconds() ``` Returns the number of seconds remaining. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The number of seconds remaining. (0 if done playing, -1 if looped)
### GetStatus
```csharp signature public PlayStatus GetStatus() ``` Returns the current PlayStatus. **Returns:** [PlayStatus](/scripting/api/sansar.simulation/playstatus) — The current PlayStatus.
### IsPlaying
```csharp signature public bool IsPlaying() ``` Returns whether the sound is currently playing. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if currently playing
### OnFinished
```csharp signature public void OnFinished(Action handler) ``` Triggers action when this sound is finished playing. Doesn't trigger if stopped or looping. | Parameter | Type | Description | |---|---|---| | `handler` | [Action](https://learn.microsoft.com/dotnet/api/system.action) | Action to be called when the sound finishes playing. |
### SetLoudness
```csharp signature public void SetLoudness(float loudness) ``` Sets the loudness for this PlayHandle. | Parameter | Type | Description | |---|---|---| | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The loudness (in dB). |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetLoudness( float loudness, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the loudness for this PlayHandle. | Parameter | Type | Description | |---|---|---| | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The loudness (in dB). | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetLoudness( float loudness, Action handler ) ``` Sets the loudness for this PlayHandle. | Parameter | Type | Description | |---|---|---| | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The loudness (in dB). | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetPitchShift
```csharp signature public void SetPitchShift(float pitch) ``` Sets the relative pitch for this PlayHandle. | Parameter | Type | Description | |---|---|---| | `pitch` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The relative pitch in semitones. (default = 0) |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetPitchShift( float pitch, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the relative pitch for this PlayHandle. | Parameter | Type | Description | |---|---|---| | `pitch` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The relative pitch in semitones. (default = 0) | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetPitchShift( float pitch, Action handler ) ``` Sets the relative pitch for this PlayHandle. | Parameter | Type | Description | |---|---|---| | `pitch` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The relative pitch in semitones. (default = 0) | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### Stop
```csharp signature public void Stop() ``` Stops the sound on this PlayHandle.
Remarks This asynchronous method queues the write then returns.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Stop(Sansar.Script.ScriptBase.OperationComplete handler) ``` Stops the sound on this PlayHandle. | Parameter | Type | Description | |---|---|---| | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns.
```csharp signature public void Stop(Action handler) ``` Stops the sound on this PlayHandle. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns.
```csharp signature public void Stop(bool fadeout) ``` Stops the sound on this PlayHandle. | Parameter | Type | Description | |---|---|---| | `fadeout` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Will fade out if true. |
Remarks This asynchronous method queues the write then returns.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Stop( bool fadeout, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Stops the sound on this PlayHandle. | Parameter | Type | Description | |---|---|---| | `fadeout` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Will fade out if true. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns.
```csharp signature public void Stop( bool fadeout, Action handler ) ``` Stops the sound on this PlayHandle. | Parameter | Type | Description | |---|---|---| | `fadeout` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Will fade out if true. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns.
## Used in examples - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [ScriptLibrary/Scene/AudioStream.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/AudioStream.cs) - [ScriptLibrary/Scene/Sound.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Sound.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/playhandle --- # PlaySettings Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
The PlaySettings class contains settings for playing sounds. ```csharp public struct PlaySettings ``` ## Remarks See `AudioComponent.PlaySoundOnComponent` and `AgentPrivate.PlaySound` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [DontSync](#dontsync) · [Looped](#looped) · [Looping](#looping) · [Loudness](#loudness) · [Offset](#offset) · [PitchShift](#pitchshift) · [PlayOnce](#playonce) | ## Fields ### DontSync
```csharp signature public bool DontSync ``` false = we adjust the offset per Agent so that the sound is synchronized to everyone. This means late-joining Agents will hear sound at a greater offset. true = turn this off, let everyone hear sound from start / your offset
Remarks The default value is false.
### Looped
```csharp signature public static readonly PlaySettings Looped ``` The default play parameters for looped sounds.
### Looping
```csharp signature public bool Looping ``` false = play once, true = sound will loop.
Remarks The default value is false.
### Loudness
```csharp signature public float Loudness ``` Loudness in dB.
Remarks Default is 0.
### Offset
```csharp signature public float Offset ``` Play from time offset (in seconds). Use DontSync if you want everyone to hear the sound from this offset regardless of when they join.
Remarks The default is 0.
### PitchShift
```csharp signature public float PitchShift ``` Relative pitch, in semitones. Changing a sound's pitch also affects its duration. For example, if you raise the pitch by 12 semitones (an octave), it plays twice as quickly.
Remarks The default is 0.
### PlayOnce
```csharp signature public static readonly PlaySettings PlayOnce ``` The default play parameters for sounds that play once.
## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/Sound.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Sound.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/playsettings --- # PlayStatus Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Current status of the PlayStatus. ```csharp public enum PlayStatus ``` ## Values | Value | Description | |---|---| | `cFinishedPlaying` | (one-shots only) Finished playing to the end. | | `cLooping` | Currently looping. | | `cPlayingOnce` | Currently playing once. | | `cStopped` | Was stopped during playback. | | `FinishedPlaying` | (one-shots only) Finished playing to the end. | | `Looping` | Currently looping. | | `PlayingOnce` | Currently playing once. | | `Stopped` | Was stopped during playback. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/playstatus --- # Quest Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 34.7.0
The Quest is the interface for a user's progress in a Quest. ```csharp public class Quest : Sansar.Script.InstanceInterface ``` ## Remarks Each instance of Quest is generated from a [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition) and is associated with a specific user, represented by a [`SessionId`](/scripting/api/sansar.script/sessionid). It can be used to offer the quest to that user, and to track and control their progress through the quest. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Agent](#agent) · [Definition](#definition) · [Objectives](#objectives) · [Ready](#ready) | | **Methods** | [GetState](#getstate) · [Offer](#offer) · [SetState](#setstate) · [Subscribe](#subscribe) · [ToString](#tostring) · [Update](#update) | ## Properties ### Agent
Added in 34.7.0
```csharp signature public Sansar.Script.SessionId Agent { get; } ``` The session Id for the user on this quest.
### Definition
Added in 34.7.0
```csharp signature public QuestDefinition Definition { get; } ``` The [`QuestDefinition`](/scripting/api/sansar.simulation/questdefinition) for this quest.
### Objectives
Added in 34.7.0
```csharp signature public Objective[] Objectives { get; } ``` Returns a list of the objectives for this quest.
### Ready
Added in 36.7.0
```csharp signature public bool Ready { get; } ``` If the Quest data is ready.
Remarks Returns false until the data has been fetched from the quest service. Once it returns true it will always return true.
## Methods ### GetState
Added in 34.7.0
```csharp signature public QuestState GetState() ``` The [`QuestState`](/scripting/api/sansar.simulation/queststate) representing the user's progress in the quest. **Returns:** [QuestState](/scripting/api/sansar.simulation/queststate)
### Offer
Added in 34.7.0
```csharp signature public void Offer() ``` Offer the quest to a user.
Added in 34.7.0
```csharp signature public void Offer( Action handler ) ``` Offer the quest to a user. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### SetState
Added in 34.7.0
```csharp signature public void SetState(QuestState state) ``` Set the state of the quest | Parameter | Type | Description | |---|---|---| | `state` | [QuestState](/scripting/api/sansar.simulation/queststate) | The state to transition to. |
Added in 34.7.0
```csharp signature public void SetState( QuestState state, Action handler ) ``` Set the state of the quest | Parameter | Type | Description | |---|---|---| | `state` | [QuestState](/scripting/api/sansar.simulation/queststate) | The state to transition to. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### Subscribe
Added in 34.7.0
```csharp signature public Sansar.Script.IEventSubscription Subscribe( QuestState State, Action callback, bool persistent ) ``` Subscribes to Quest Events. | Parameter | Type | Description | |---|---|---| | `State` | [QuestState](/scripting/api/sansar.simulation/queststate) | The state of the quest | | `callback` | [Action<QuestData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### Update
Added in 36.7.0
```csharp signature public void Update() ``` Update the ObjectiveDefinition data.
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
Added in 36.7.0
```csharp signature public void Update( Action handler ) ``` Update the ObjectiveDefinition data. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestCharacter.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestCharacter.cs) - [ScriptLibrary/Quest/QuestGiver.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiver.cs) - [ScriptLibrary/Quest/QuestGiverBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverBase.cs) - [ScriptLibrary/Quest/QuestGiverInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverInteraction.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestObject.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObject.cs) - [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs) - [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/quest --- # QuestCharacter Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 35.1.0
The QuestCharacter is the interface for a Quest Character ```csharp public class QuestCharacter : Sansar.Script.InstanceInterface ``` ## Remarks There is as yet no way to create Quest Characters, but this functionality is coming soon. ## Members at a glance | Kind | Members | |---|---| | **Methods** | [GetCharacterTracker](#getcharactertracker) · [ShowQuests](#showquests) · [TurnInQuests](#turninquests) | ## Methods ### GetCharacterTracker
Added in 36.0.1
```csharp signature public CharacterTracker GetCharacterTracker( Sansar.Script.SessionId sessionId ) ``` Track a user's progress through the quests associated with this character. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user. | **Returns:** [CharacterTracker](/scripting/api/sansar.simulation/charactertracker)
### ShowQuests
Added in 35.1.0
```csharp signature public void ShowQuests(Sansar.Script.SessionId sessionId) ``` Show a UI panel displaying this characters' quests. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to open the ui panel for. |
### TurnInQuests
Added in 35.1.0
```csharp signature public void TurnInQuests(Sansar.Script.SessionId sessionId) ``` Turn in any quests that a user has completed for this character, and show the quest character ui. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to complete quests for. |
Added in 35.1.0
```csharp signature public void TurnInQuests( Sansar.Script.SessionId sessionId, Action handler ) ``` Turn in any quests that a user has completed for this character, and show the quest character ui. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the user to complete quests for. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
## Used in examples - [ScriptLibrary/Quest/QuestCharacter.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestCharacter.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/questcharacter --- # QuestData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData Added in 34.7.0
Handler for Quest state change events. ```csharp public class QuestData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentId](#agentid) · [State](#state) | | **Methods** | [ToString](#tostring) | ## Properties ### AgentId
Added in 34.7.0
```csharp signature public Sansar.Script.SessionId AgentId { get; } ``` The SessionId of the agent on the quest.
### State
Added in 34.7.0
```csharp signature public QuestState State { get; } ``` The state of the quest
## Methods ### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestGiverBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverBase.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/questdata --- # QuestDefinition Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 34.7.0
The QuestDefinition stores the data that is used to create quest instances for users. ```csharp public class QuestDefinition : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Description](#description) · [ObjectiveDefinitions](#objectivedefinitions) · [Ready](#ready) · [Title](#title) | | **Methods** | [GetQuest](#getquest) · [ToString](#tostring) · [Update](#update) | ## Properties ### Description
Added in 34.7.0
```csharp signature public string Description { get; } ``` The description of this quest.
### ObjectiveDefinitions
Added in 34.7.0
```csharp signature public ObjectiveDefinition[] ObjectiveDefinitions { get; } ``` All the ObjectiveDefinitions for this QuestDefinition.
Remarks The ObjectiveDefinitions for this QuestDefinition
### Ready
Added in 34.7.0
```csharp signature public bool Ready { get; } ``` If the QuestDefinition data is ready.
Remarks Returns false until the data has been fetched from the quest service. Once it returns true it will always return true.
### Title
Added in 34.7.0
```csharp signature public string Title { get; } ``` The title of this quest.
## Methods ### GetQuest
Added in 34.7.0
```csharp signature public void GetQuest(Sansar.Script.SessionId agent) ``` Get the state of this quest for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The [`SessionId`](/scripting/api/sansar.script/sessionid) of the user. |
Added in 34.7.0
```csharp signature public void GetQuest(AgentPrivate agent) ``` Get the state of this quest for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Obtain the quest state for this user. |
Added in 34.7.0
```csharp signature public void GetQuest( Sansar.Script.SessionId agent, Action handler ) ``` Get the state of this quest for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The [`SessionId`](/scripting/api/sansar.script/sessionid) of the user. | | `handler` | [Action<QuestDefinition.GetQuestData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Added in 34.7.0
```csharp signature public void GetQuest( AgentPrivate agent, Action handler ) ``` Get the state of this quest for a particular user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Obtain the quest state for this user. | | `handler` | [Action<QuestDefinition.GetQuestData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### Update
Added in 34.7.0
```csharp signature public void Update() ``` Update the QuestDefinition data.
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
Added in 34.7.0
```csharp signature public void Update( Action handler ) ``` Update the QuestDefinition data. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.
## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestGiverBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverBase.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/questdefinition --- # QuestDefinition.GetQuestData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.OperationCompleteEvent Added in 34.7.0
```csharp public class QuestDefinition.GetQuestData : Sansar.Script.OperationCompleteEvent ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Quest](#quest) | | **Methods** | [ToString](#tostring) | ## Properties ### Quest
Added in 34.7.0
```csharp signature public Quest Quest { get; } ```
## Methods ### ToString
Added in 34.7.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestGiverBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverBase.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/questdefinition.getquestdata --- # QuestState Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 34.7.0
State of a quest for a user. ```csharp public enum QuestState ``` ## Values | Value | Description | |---|---| | `Active` Added in 34.7.0 | The user is on the quest. | | `Completed` Added in 34.7.0 | The user has completed the quest. | | `None` Added in 34.7.0 | The quest has not yet been offered to the user. | | `ObjectivesCompleted` Added in 36.0.1 | The user has completed all the objectives for this quest. | | `Offered` Added in 34.7.0 | The user has been offered the quest. | | `SelectReward` Added in 36.0.1 | The user has completed all the objectives for this quest, and turned it in, but still has to select rewards | ## Used in examples - [QuestDebugExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/QuestDebugExample.cs) - [ScriptLibrary/Quest/QuestGiverBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverBase.cs) - [ScriptLibrary/Quest/QuestGiverInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverInteraction.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) - [ScriptLibrary/Quest/QuestVisibility.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestVisibility.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/queststate --- # RagdollRegion Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 47.1.1
Flags for targeting specific ragdoll body regions. Combine with bitwise OR. ```csharp [System.Flags] public enum RagdollRegion ``` ## Remarks When applying impulse to specific regions (e.g. LeftArm \| LeftLeg), the force is distributed only among the bodies in those regions, creating asymmetric effects like spinning falls. ## Values | Value | Description | |---|---| | `AllRegions` Added in 47.1.1 | All regions. | | `Head` Added in 47.1.1 | Head. | | `LeftArm` Added in 47.1.1 | Left arm (shoulder, elbow, wrist). | | `LeftLeg` Added in 47.1.1 | Left leg (hip, knee, ankle). | | `NoRegion` Added in 47.1.1 | No region. | | `RightArm` Added in 47.1.1 | Right arm (shoulder, elbow, wrist). | | `RightLeg` Added in 47.1.1 | Right leg (hip, knee, ankle). | | `Torso` Added in 47.1.1 | Torso (pelvis, spine, neck). |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/ragdollregion --- # RayCastHit Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
Result of a Raycast. ```csharp public struct RayCastHit ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentId](#componentid) · [Fraction](#fraction) · [Location](#location) · [Normal](#normal) | ## Fields ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId ``` The id of the [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) hit.
### Fraction
```csharp signature public float Fraction ``` The query shape's position (upon contact) along the cast direction as a fraction of the original casting length.
### Location
```csharp signature public Sansar.Vector Location ``` The location where the hit occurred.
### Normal
```csharp signature public Sansar.Vector Normal ``` The normal at the location where the hit occurred.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/raycasthit --- # ReactionData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData Added in 41.0.0
Subscribe to receive reaction events from users. ```csharp public class ReactionData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Orientation](#orientation) · [Position](#position) · [Type](#type) | | **Methods** | [ToString](#tostring) | ## Properties ### Orientation
Added in 41.0.0
```csharp signature public Sansar.Quaternion Orientation { get; } ``` The reaction orientation in world space
### Position
Added in 41.0.0
```csharp signature public Sansar.Vector Position { get; } ``` The reaction position in world space
### Type
Added in 41.0.0
```csharp signature public string Type { get; } ``` The reaction event type
## Methods ### ToString
Added in 41.0.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ReactionsExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ReactionsExample.cs) - [ScriptLibrary/Scene/Reaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Reaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/reactiondata --- # Reactions Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 41.0.0
The Reactions class subscriptions to user reaction events. ```csharp public class Reactions : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [AddReaction](#addreaction) · [AddSystemReaction](#addsystemreaction) · [DisableDefaultReactions](#disabledefaultreactions) · [RemoveReaction](#removereaction) · [SubscribeToReaction](#subscribetoreaction) | ## Methods ### AddReaction
Added in 43.2.1
```csharp signature public void AddReaction( string reactionType, string displayText, ThumbnailedClusterResource resource ) ``` Add a new reaction type to all clients | Parameter | Type | Description | |---|---|---| | `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback. Should be of a form like 'Developer.Type' to match the default, e.g. 'Sansar.Fire' | | `displayText` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A short string that appears on the emotes panel | | `resource` | [ThumbnailedClusterResource](/scripting/api/sansar.simulation/thumbnailedclusterresource) | A cluster source which has a thumbnail defined in inventory. |
### AddSystemReaction
Added in 43.2.1
```csharp signature public void AddSystemReaction( string reactionType, string displayText, string thumbnailPath, ClusterResource resource ) ``` Add a new system default reaction. Intended for internal use by Sansar | Parameter | Type | Description | |---|---|---| | `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback. Should be of a form like 'Developer.Type' to match the default, e.g. 'Sansar.Fire' | | `displayText` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A short string that appears on the emotes panel | | `thumbnailPath` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Must be a path to a file included by client. RUNTIME:/UI/Social/Images/\*.png | | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | A cluster source that will be passed to the reaction callback. |
### DisableDefaultReactions
Added in 43.2.1
```csharp signature public void DisableDefaultReactions() ``` Removes all the default reactions from the emote menu, leaving only custom ones.
### RemoveReaction
Added in 43.2.1
```csharp signature public void RemoveReaction(string reactionType) ``` Remove the specified global reaction from all clients. | Parameter | Type | Description | |---|---|---| | `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback. Should be of a form like 'Developer.Type' to match the default, e.g. 'Sansar.Fire' |
### SubscribeToReaction
Added in 41.0.0
```csharp signature public Sansar.Script.IEventSubscription SubscribeToReaction( Action callback, bool persistent ) ``` Subscribes to Reaction Events. | Parameter | Type | Description | |---|---|---| | `callback` | [Action<ReactionData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
## Used in examples - [ReactionsExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ReactionsExample.cs) - [ScriptLibrary/Scene/Reaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Reaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/reactions --- # RenderMaterial Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 37.0.0
The RenderMaterial handles interactions with render materials. ```csharp public class RenderMaterial : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [HasAbsorption](#hasabsorption) · [HasApplyGlobalWind](#hasapplyglobalwind) New in 47.10.0 · [HasApplyUvOffsetToAo](#hasapplyuvoffsettoao) · [HasApplyUvOffsetToDiffuse](#hasapplyuvoffsettodiffuse) · [HasApplyUvOffsetToEmissive](#hasapplyuvoffsettoemissive) · [HasAudioReactAdaptiveDisplacement](#hasaudioreactadaptivedisplacement) · [HasAudioReactAdaptiveFlashEmissive](#hasaudioreactadaptiveflashemissive) · [HasAudioReactDisplacementOnHigh](#hasaudioreactdisplacementonhigh) · [HasAudioReactDisplacementOnLow](#hasaudioreactdisplacementonlow) · [HasAudioReactDisplacementOnMid](#hasaudioreactdisplacementonmid) · [HasAudioReactEmissiveBrightness](#hasaudioreactemissivebrightness) · [HasAudioReactEmissiveColor](#hasaudioreactemissivecolor) · [HasAudioReactFlashEmissiveOnHigh](#hasaudioreactflashemissiveonhigh) · [HasAudioReactFlashEmissiveOnLow](#hasaudioreactflashemissiveonlow) · [HasAudioReactFlashEmissiveOnMid](#hasaudioreactflashemissiveonmid) · [HasAudioReactFlipbookFrame](#hasaudioreactflipbookframe) · [HasBladeDensity](#hasbladedensity) New in 47.10.0 · [HasBladeHeight](#hasbladeheight) New in 47.10.0 · [HasBladeWidth](#hasbladewidth) New in 47.10.0 · [HasBlendDisplacementFlipbook](#hasblenddisplacementflipbook) · [HasBlendOnDisplacementLoop](#hasblendondisplacementloop) · [HasBrightness](#hasbrightness) · [HasDirtRoughness](#hasdirtroughness) New in 47.10.0 · [HasDrawAfterimages](#hasdrawafterimages) · [HasEmissiveIntensity](#hasemissiveintensity) · [HasFlipbookFrame](#hasflipbookframe) · [HasFlipbookIndex](#hasflipbookindex) · [HasFurDensity](#hasfurdensity) New in 47.10.0 · [HasFurLength](#hasfurlength) New in 47.10.0 · [HasFurRootColor](#hasfurrootcolor) New in 47.10.0 · [HasFurThickness](#hasfurthickness) New in 47.10.0 · [HasFurTipColor](#hasfurtipcolor) New in 47.10.0 · [HasGrassDensity](#hasgrassdensity) New in 47.10.0 · [HasGrassDirtColor](#hasgrassdirtcolor) New in 47.10.0 · [HasGrassLength](#hasgrasslength) New in 47.10.0 · [HasGrassRootColor](#hasgrassrootcolor) New in 47.10.0 · [HasGrassThickness](#hasgrassthickness) New in 47.10.0 · [HasGrassTipColor](#hasgrasstipcolor) New in 47.10.0 · [HasGravityStrength](#hasgravitystrength) New in 47.10.0 · [HasLoopDisplacementFlipbook](#hasloopdisplacementflipbook) · [HasLoopFlipbook](#hasloopflipbook) · [HasPingPongDisplacementFlipbook](#haspingpongdisplacementflipbook) · [HasReceiveReflection](#hasreceivereflection) · [HasRenderBlades](#hasrenderblades) New in 47.10.0 · [HasRenderFins](#hasrenderfins) New in 47.10.0 · [HasRenderShells](#hasrendershells) New in 47.10.0 · [HasRoughness](#hasroughness) New in 47.10.0 · [HasScrollAlbedo](#hasscrollalbedo) · [HasScrollAo](#hasscrollao) · [HasScrollDisplacement](#hasscrolldisplacement) · [HasScrollDisplacementFactor](#hasscrolldisplacementfactor) · [HasScrollEmissive](#hasscrollemissive) · [HasScrollMask](#hasscrollmask) · [HasScrollMetalness](#hasscrollmetalness) · [HasScrollNormalRoughness](#hasscrollnormalroughness) · [HasSelfShadowStrength](#hasselfshadowstrength) New in 47.10.0 · [HasShadowCasting](#hasshadowcasting) · [HasShellHeight](#hasshellheight) New in 47.10.0 · [HasTint](#hastint) · [HasUseCustomBladeShape](#hasusecustombladeshape) New in 47.10.0 · [HasVatBlendAnimLoop](#hasvatblendanimloop) · [HasVATFrame](#hasvatframe) · [HasVatLoopAnim](#hasvatloopanim) · [HasVATLoopRunLength](#hasvatlooprunlength) · [HasVATLoopStartFrame](#hasvatloopstartframe) · [HasVatPingPongAnim](#hasvatpingponganim) · [HasVATStepRate](#hasvatsteprate) · [HasWindFlowScale](#haswindflowscale) New in 47.10.0 · [HasWindStrength](#haswindstrength) New in 47.10.0 · [Index](#index) · [Name](#name) · [ShaderType](#shadertype) | | **Methods** | [GetProperties](#getproperties) · [SetProperties](#setproperties) · [ToString](#tostring) | ## Properties ### HasAbsorption
Added in 37.0.0
```csharp signature public bool HasAbsorption { get; } ``` Whether or not this material allows changing absorption.
### HasApplyGlobalWind
New in 47.10.0
```csharp signature public bool HasApplyGlobalWind { get; } ``` Whether or not this material allows toggling global wind.
### HasApplyUvOffsetToAo
Added in 46.5.0
```csharp signature public bool HasApplyUvOffsetToAo { get; } ``` Whether or not this material allows toggling UV offset application to ambient occlusion.
### HasApplyUvOffsetToDiffuse
Added in 46.5.0
```csharp signature public bool HasApplyUvOffsetToDiffuse { get; } ``` Whether or not this material allows toggling UV offset application to diffuse layers.
### HasApplyUvOffsetToEmissive
Added in 46.5.0
```csharp signature public bool HasApplyUvOffsetToEmissive { get; } ``` Whether or not this material allows toggling UV offset application to emissive.
### HasAudioReactAdaptiveDisplacement
Added in 46.5.0
```csharp signature public bool HasAudioReactAdaptiveDisplacement { get; } ``` Whether or not this material allows toggling audio reactive adaptive displacement mode.
### HasAudioReactAdaptiveFlashEmissive
Added in 46.5.0
```csharp signature public bool HasAudioReactAdaptiveFlashEmissive { get; } ``` Whether or not this material allows toggling audio reactive adaptive emissive flash mode.
### HasAudioReactDisplacementOnHigh
Added in 46.5.0
```csharp signature public bool HasAudioReactDisplacementOnHigh { get; } ``` Whether or not this material allows toggling audio reactive displacement on high frequencies.
### HasAudioReactDisplacementOnLow
Added in 46.5.0
```csharp signature public bool HasAudioReactDisplacementOnLow { get; } ``` Whether or not this material allows toggling audio reactive displacement on low frequencies.
### HasAudioReactDisplacementOnMid
Added in 46.5.0
```csharp signature public bool HasAudioReactDisplacementOnMid { get; } ``` Whether or not this material allows toggling audio reactive displacement on mid frequencies.
### HasAudioReactEmissiveBrightness
Added in 46.5.0
```csharp signature public bool HasAudioReactEmissiveBrightness { get; } ``` Whether or not this material allows toggling audio reactive emissive brightness mode.
### HasAudioReactEmissiveColor
Added in 46.5.0
```csharp signature public bool HasAudioReactEmissiveColor { get; } ``` Whether or not this material allows toggling audio reactive emissive color mode.
### HasAudioReactFlashEmissiveOnHigh
Added in 46.5.0
```csharp signature public bool HasAudioReactFlashEmissiveOnHigh { get; } ``` Whether or not this material allows toggling audio reactive flash emissive on high frequencies.
### HasAudioReactFlashEmissiveOnLow
Added in 46.5.0
```csharp signature public bool HasAudioReactFlashEmissiveOnLow { get; } ``` Whether or not this material allows toggling audio reactive flash emissive on low frequencies.
### HasAudioReactFlashEmissiveOnMid
Added in 46.5.0
```csharp signature public bool HasAudioReactFlashEmissiveOnMid { get; } ``` Whether or not this material allows toggling audio reactive flash emissive on mid frequencies.
### HasAudioReactFlipbookFrame
Added in 46.5.0
```csharp signature public bool HasAudioReactFlipbookFrame { get; } ``` Whether or not this material allows toggling audio reactive flipbook frame advancement.
### HasBladeDensity
New in 47.10.0
```csharp signature public bool HasBladeDensity { get; } ``` Whether or not this material allows changing grass blade density.
### HasBladeHeight
New in 47.10.0
```csharp signature public bool HasBladeHeight { get; } ``` Whether or not this material allows changing grass blade height.
### HasBladeWidth
New in 47.10.0
```csharp signature public bool HasBladeWidth { get; } ``` Whether or not this material allows changing grass blade width.
### HasBlendDisplacementFlipbook
Added in 46.5.0
```csharp signature public bool HasBlendDisplacementFlipbook { get; } ``` Whether or not this material allows toggling displacement flipbook blending.
### HasBlendOnDisplacementLoop
Added in 46.5.0
```csharp signature public bool HasBlendOnDisplacementLoop { get; } ``` Whether or not this material allows toggling blend on displacement loop.
### HasBrightness
Added in 37.0.0
```csharp signature public bool HasBrightness { get; } ``` Whether or not this material allows changing brightness.
### HasDirtRoughness
New in 47.10.0
```csharp signature public bool HasDirtRoughness { get; } ``` Whether or not this material allows changing grass dirt roughness.
### HasDrawAfterimages
Added in 46.5.0
```csharp signature public bool HasDrawAfterimages { get; } ``` Whether or not this material allows toggling afterimages drawing.
### HasEmissiveIntensity
Added in 37.0.0
```csharp signature public bool HasEmissiveIntensity { get; } ``` Whether or not this material allows changing emissive intensity.
### HasFlipbookFrame
Added in 37.0.0
```csharp signature public bool HasFlipbookFrame { get; } ``` Whether or not this material allows flipbook animation.
### HasFlipbookIndex
Added in 46.5.0
```csharp signature public bool HasFlipbookIndex { get; } ``` Whether or not this material allows indexed flipbook animation.
### HasFurDensity
New in 47.10.0
```csharp signature public bool HasFurDensity { get; } ``` Whether or not this material allows changing fur density.
### HasFurLength
New in 47.10.0
```csharp signature public bool HasFurLength { get; } ``` Whether or not this material allows changing fur length.
### HasFurRootColor
New in 47.10.0
```csharp signature public bool HasFurRootColor { get; } ``` Whether or not this material allows changing fur root color.
### HasFurThickness
New in 47.10.0
```csharp signature public bool HasFurThickness { get; } ``` Whether or not this material allows changing fur thickness.
### HasFurTipColor
New in 47.10.0
```csharp signature public bool HasFurTipColor { get; } ``` Whether or not this material allows changing fur tip color.
### HasGrassDensity
New in 47.10.0
```csharp signature public bool HasGrassDensity { get; } ``` Whether or not this material allows changing grass density.
### HasGrassDirtColor
New in 47.10.0
```csharp signature public bool HasGrassDirtColor { get; } ``` Whether or not this material allows changing grass dirt color.
### HasGrassLength
New in 47.10.0
```csharp signature public bool HasGrassLength { get; } ``` Whether or not this material allows changing grass length.
### HasGrassRootColor
New in 47.10.0
```csharp signature public bool HasGrassRootColor { get; } ``` Whether or not this material allows changing grass root color.
### HasGrassThickness
New in 47.10.0
```csharp signature public bool HasGrassThickness { get; } ``` Whether or not this material allows changing grass thickness.
### HasGrassTipColor
New in 47.10.0
```csharp signature public bool HasGrassTipColor { get; } ``` Whether or not this material allows changing grass tip color.
### HasGravityStrength
New in 47.10.0
```csharp signature public bool HasGravityStrength { get; } ``` Whether or not this material allows changing fur gravity strength.
### HasLoopDisplacementFlipbook
Added in 46.5.0
```csharp signature public bool HasLoopDisplacementFlipbook { get; } ``` Whether or not this material allows toggling displacement flipbook looping.
### HasLoopFlipbook
Added in 46.5.0
```csharp signature public bool HasLoopFlipbook { get; } ``` Whether or not this material allows toggling flipbook looping.
### HasPingPongDisplacementFlipbook
Added in 46.5.0
```csharp signature public bool HasPingPongDisplacementFlipbook { get; } ``` Whether or not this material allows toggling displacement flipbook ping-pong.
### HasReceiveReflection
Added in 46.5.0
```csharp signature public bool HasReceiveReflection { get; } ``` Whether or not this material allows toggling receivership of reflections.
### HasRenderBlades
New in 47.10.0
```csharp signature public bool HasRenderBlades { get; } ``` Whether or not this material allows toggling grass blade rendering.
### HasRenderFins
New in 47.10.0
```csharp signature public bool HasRenderFins { get; } ``` Whether or not this material allows toggling grass fin rendering.
### HasRenderShells
New in 47.10.0
```csharp signature public bool HasRenderShells { get; } ``` Whether or not this material allows toggling grass shell rendering.
### HasRoughness
New in 47.10.0
```csharp signature public bool HasRoughness { get; } ``` Whether or not this material allows changing roughness.
### HasScrollAlbedo
Added in 46.5.0
```csharp signature public bool HasScrollAlbedo { get; } ``` Whether or not this material allows toggling albedo scrolling.
### HasScrollAo
Added in 46.5.0
```csharp signature public bool HasScrollAo { get; } ``` Whether or not this material allows toggling ambient occlusion scrolling.
### HasScrollDisplacement
Added in 46.5.0
```csharp signature public bool HasScrollDisplacement { get; } ``` Whether or not this material allows toggling displacement scrolling.
### HasScrollDisplacementFactor
Added in 46.5.0
```csharp signature public bool HasScrollDisplacementFactor { get; } ``` Whether or not this material allows toggling displacement factor scrolling.
### HasScrollEmissive
Added in 46.5.0
```csharp signature public bool HasScrollEmissive { get; } ``` Whether or not this material allows toggling emission scrolling.
### HasScrollMask
Added in 46.5.0
```csharp signature public bool HasScrollMask { get; } ``` Whether or not this material allows toggling mask scrolling.
### HasScrollMetalness
Added in 46.5.0
```csharp signature public bool HasScrollMetalness { get; } ``` Whether or not this material allows toggling metalness scrolling.
### HasScrollNormalRoughness
Added in 46.5.0
```csharp signature public bool HasScrollNormalRoughness { get; } ``` Whether or not this material allows toggling normal/roughness scrolling.
### HasSelfShadowStrength
New in 47.10.0
```csharp signature public bool HasSelfShadowStrength { get; } ``` Whether or not this material allows changing self shadow strength.
### HasShadowCasting
Added in 46.5.0
```csharp signature public bool HasShadowCasting { get; } ``` Whether or not this material allows toggling shadow casting.
### HasShellHeight
New in 47.10.0
```csharp signature public bool HasShellHeight { get; } ``` Whether or not this material allows changing grass shell height.
### HasTint
Added in 37.0.0
```csharp signature public bool HasTint { get; } ``` Whether or not this material allows tinting.
### HasUseCustomBladeShape
New in 47.10.0
```csharp signature public bool HasUseCustomBladeShape { get; } ``` Whether or not this material allows toggling the custom grass blade shape.
### HasVatBlendAnimLoop
Added in 46.5.0
```csharp signature public bool HasVatBlendAnimLoop { get; } ``` Whether or not this material allows toggling the blending of animation loops.
### HasVATFrame
Added in 46.5.0
```csharp signature public bool HasVATFrame { get; } ``` Whether or not this material allows VAT animation offset frame.
### HasVatLoopAnim
Added in 46.5.0
```csharp signature public bool HasVatLoopAnim { get; } ``` Whether or not this material allows toggling animation looping.
### HasVATLoopRunLength
Added in 46.5.0
```csharp signature public bool HasVATLoopRunLength { get; } ``` Whether or not this material allows VAT animation loop run length.
### HasVATLoopStartFrame
Added in 46.5.0
```csharp signature public bool HasVATLoopStartFrame { get; } ``` Whether or not this material allows VAT animation loop start frame.
### HasVatPingPongAnim
Added in 46.5.0
```csharp signature public bool HasVatPingPongAnim { get; } ``` Whether or not this material allows toggling animation ping-pong.
### HasVATStepRate
Added in 46.5.0
```csharp signature public bool HasVATStepRate { get; } ``` Whether or not this material allows VAT animation step rate.
### HasWindFlowScale
New in 47.10.0
```csharp signature public bool HasWindFlowScale { get; } ``` Whether or not this material allows changing wind flow scale.
### HasWindStrength
New in 47.10.0
```csharp signature public bool HasWindStrength { get; } ``` Whether or not this material allows changing wind strength.
### Index
Added in 37.0.0
```csharp signature public int Index { get; } ``` Gets the internal index for the material
### Name
Added in 37.0.0
```csharp signature public string Name { get; } ``` Gets the name of the material
### ShaderType
Added in 37.0.0
```csharp signature public string ShaderType { get; } ``` Gets a string identifying the type of shader.
## Methods ### GetProperties
Added in 37.0.0
```csharp signature public MaterialProperties GetProperties() ``` Get the MaterialProperties **Returns:** [MaterialProperties](/scripting/api/sansar.simulation/materialproperties)
### SetProperties
Added in 37.0.0
```csharp signature public void SetProperties(MaterialProperties properties) ``` Set new values for MaterialProperties | Parameter | Type | Description | |---|---|---| | `properties` | [MaterialProperties](/scripting/api/sansar.simulation/materialproperties) | properties |
Added in 37.0.0
```csharp signature public void SetProperties( MaterialProperties properties, Action handler ) ``` Set new values for MaterialProperties | Parameter | Type | Description | |---|---|---| | `properties` | [MaterialProperties](/scripting/api/sansar.simulation/materialproperties) | properties | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Added in 37.0.0
```csharp signature public void SetProperties( MaterialProperties properties, float timeInSeconds, InterpolationMode interpolationMode ) ``` Set new values for MaterialProperties interpolated over time | Parameter | Type | Description | |---|---|---| | `properties` | [MaterialProperties](/scripting/api/sansar.simulation/materialproperties) | properties | | `timeInSeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | timeInSeconds | | `interpolationMode` | [InterpolationMode](/scripting/api/sansar.simulation/interpolationmode) | timeInSeconds |
Added in 37.0.0
```csharp signature public void SetProperties( MaterialProperties properties, float timeInSeconds, InterpolationMode interpolationMode, Action handler ) ``` Set new values for MaterialProperties interpolated over time | Parameter | Type | Description | |---|---|---| | `properties` | [MaterialProperties](/scripting/api/sansar.simulation/materialproperties) | properties | | `timeInSeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | timeInSeconds | | `interpolationMode` | [InterpolationMode](/scripting/api/sansar.simulation/interpolationmode) | timeInSeconds | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### ToString
Added in 37.0.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/rendermaterial --- # RigidBodyComponent Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The RigidBodyComponent handles interactions with rigid body physics. ```csharp public class RigidBodyComponent : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ComponentType](#componenttype) | | **Properties** | [ComponentId](#componentid) · [Name](#name) | | **Methods** | [AddAngularImpulse](#addangularimpulse) · [AddLinearImpulse](#addlinearimpulse) · [GetAngularDamping](#getangulardamping) · [GetAngularVelocity](#getangularvelocity) · [GetBounce](#getbounce) · [GetCanGrab](#getcangrab) · [GetCenterOfMass](#getcenterofmass) · [GetColliderCenter](#getcollidercenter) · [GetColliderExtents](#getcolliderextents) · [GetDynamicFriction](#getdynamicfriction) · [GetGravityFactor](#getgravityfactor) · [GetHeldObjectInfo](#getheldobjectinfo) · [GetInverseInertia](#getinverseinertia) · [GetLinearDamping](#getlineardamping) · [GetLinearVelocity](#getlinearvelocity) · [GetMass](#getmass) · [GetMotionType](#getmotiontype) · [GetOrientation](#getorientation) · [GetPosition](#getposition) · [GetSitObjectInfo](#getsitobjectinfo) · [GetStaticFriction](#getstaticfriction) · [IsDynamic](#isdynamic) · [IsTriggerVolume](#istriggervolume) · [ReleaseHeldObject](#releaseheldobject) · [SetAngularDamping](#setangulardamping) · [SetAngularVelocity](#setangularvelocity) · [SetBounce](#setbounce) · [SetCanGrab](#setcangrab) · [SetCenterOfMass](#setcenterofmass) · [SetDynamicFriction](#setdynamicfriction) · [SetGravityFactor](#setgravityfactor) · [SetInverseInertia](#setinverseinertia) · [SetLinearDamping](#setlineardamping) · [SetLinearVelocity](#setlinearvelocity) · [SetMass](#setmass) · [SetMotionType](#setmotiontype) · [SetOrientation](#setorientation) · [SetPosition](#setposition) · [SetStaticFriction](#setstaticfriction) · [Subscribe](#subscribe) · [SubscribeToHeldObject](#subscribetoheldobject) · [SubscribeToSitObject](#subscribetositobject) · [ToString](#tostring) | ## Fields ### ComponentType
```csharp signature public static readonly ComponentType ComponentType ``` The [`RigidBodyComponent.ComponentType`](/scripting/api/sansar.simulation/rigidbodycomponent#componenttype) of this component
## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` Retrieves the component id for this RigidBodyComponent. **Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.
### Name
Added in 33.2.0
```csharp signature public string Name { get; } ``` This RigidBodyComponent name, as specified in the editor.
## Methods ### AddAngularImpulse
```csharp signature public void AddAngularImpulse(Sansar.Vector impulse) ``` Adds an angular impulse to this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong AddAngularImpulse( Sansar.Vector impulse, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Adds an angular impulse to this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void AddAngularImpulse( Sansar.Vector impulse, Action handler ) ``` Adds an angular impulse to this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### AddLinearImpulse
```csharp signature public void AddLinearImpulse(Sansar.Vector impulse) ``` Adds a linear impulse the the center of mass of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong AddLinearImpulse( Sansar.Vector impulse, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Adds a linear impulse the the center of mass of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void AddLinearImpulse( Sansar.Vector impulse, Action handler ) ``` Adds a linear impulse the the center of mass of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### GetAngularDamping
```csharp signature public float GetAngularDamping() ``` Retrieves the amount of damping applied to this object's angular motion. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The angular damping factor.
### GetAngularVelocity
```csharp signature public Sansar.Vector GetAngularVelocity() ``` Retrieves the angular velocity for this RigidBodyComponent. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The velocity.
### GetBounce
```csharp signature public float GetBounce() ``` Retrieves the bounce of this RigidBodyComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The bounce factor.
### GetCanGrab
```csharp signature public bool GetCanGrab() ``` The can grab state for this RigidBodyComponent. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — A bool indicating if the object can be picked up.
### GetCenterOfMass
```csharp signature public Sansar.Vector GetCenterOfMass() ``` Retrieves the center of mass of this object in local space. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — A Vector to the center of mass of this object, in the objects local space.
### GetColliderCenter
```csharp signature public Sansar.Vector GetColliderCenter() ``` Retrieves the center of the collision shape for this object in local space. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The center of the collision shape.
### GetColliderExtents
```csharp signature public Sansar.Vector GetColliderExtents() ``` Retrieves the extents of the collision shape for this object in local space. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The extents of the collision shape.
### GetDynamicFriction
```csharp signature public float GetDynamicFriction() ``` Retrieves the dynamic friction of this RigidBodyComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The dynamic friction.
### GetGravityFactor
```csharp signature public float GetGravityFactor() ``` Retrieves what factor of the world's gravity is applied to this object. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The gravity factor.
### GetHeldObjectInfo
```csharp signature public HeldObjectInfo GetHeldObjectInfo() ``` Data about who is holding this RigidBodyComponent. **Returns:** [HeldObjectInfo](/scripting/api/sansar.simulation/heldobjectinfo) — A [`HeldObjectInfo`](/scripting/api/sansar.simulation/heldobjectinfo) struct.
### GetInverseInertia
```csharp signature public Sansar.Vector GetInverseInertia() ``` Retrieves the moment of inertia for this object. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — A Vector representation of the inverse moment of inertia.
### GetLinearDamping
```csharp signature public float GetLinearDamping() ``` Retrieves the amount of damping applied to this object's linear motion. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The linear damping factor.
### GetLinearVelocity
```csharp signature public Sansar.Vector GetLinearVelocity() ``` Retrieves the linear velocity for this RigidBodyComponent. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The velocity.
### GetMass
```csharp signature public float GetMass() ``` Retrieves the mass of this RigidBodyComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The mass.
### GetMotionType
```csharp signature public RigidBodyMotionType GetMotionType() ``` The motion type for this RigidBodyComponent. **Returns:** [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) — A RigidBodyMotionType enum for the motion type.
### GetOrientation
```csharp signature public Sansar.Quaternion GetOrientation() ``` Retrieves the orientation of this RigidBodyComponent. **Returns:** [Sansar.Quaternion](/scripting/api/sansar/quaternion) — The orientation.
### GetPosition
```csharp signature public Sansar.Vector GetPosition() ``` Retrieves the position of this RigidBodyComponent. **Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The position.
### GetSitObjectInfo
```csharp signature public SitObjectInfo[] GetSitObjectInfo() ``` Data about who is sitting on this RigidBodyComponent. **Returns:** [SitObjectInfo](/scripting/api/sansar.simulation/sitobjectinfo)\[\] — A [`SitObjectInfo`](/scripting/api/sansar.simulation/sitobjectinfo) struct.
### GetStaticFriction
```csharp signature public float GetStaticFriction() ``` Retrieves the static friction of this RigidBodyComponent. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The static friction.
### IsDynamic
Deprecated
```csharp signature [System.Obsolete("Use GetMotionType()", false)] public bool IsDynamic() ``` Whether this rigidbody is dynamic. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this is a dynamic object.
Remarks Deprecated. Use GetMotionType() instead.
### IsTriggerVolume
```csharp signature public bool IsTriggerVolume() ``` Whether this RigidBodyComponent is a TriggerVolume. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this RigidBodyComponent is a TriggerVolume.
Remarks TriggerVolumes can be moved through and generate [`CollisionEventType.cTrigger`](/scripting/api/sansar.simulation/collisioneventtype#F:Sansar.Simulation.CollisionEventType.cTrigger) collision events instead of normal collision events.
### ReleaseHeldObject
```csharp signature public void ReleaseHeldObject() ``` Force any agent holding this object to drop it.
Added in 32.0.0
```csharp signature public void ReleaseHeldObject( Action handler ) ``` Force any agent holding this object to drop it. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### SetAngularDamping
```csharp signature public void SetAngularDamping(float angularDamping) ``` Sets the amount of damping to apply to this object's angular motion. | Parameter | Type | Description | |---|---|---| | `angularDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular damping factor. Default value is 0. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetAngularDamping( float angularDamping, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the amount of damping to apply to this object's angular motion. | Parameter | Type | Description | |---|---|---| | `angularDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular damping factor. Default value is 0. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetAngularDamping( float angularDamping, Action handler ) ``` Sets the amount of damping to apply to this object's angular motion. | Parameter | Type | Description | |---|---|---| | `angularDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular damping factor. Default value is 0. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetAngularVelocity
```csharp signature public void SetAngularVelocity(Sansar.Vector velocity) ``` Sets the angular velocity for this RigidBodyComponent. Angular velocity is clamped between -100m/s and 100m/s. | Parameter | Type | Description | |---|---|---| | `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |
Remarks This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetAngularVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getangularvelocity) will return the previous velocity until the write occurs. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetAngularVelocity( Sansar.Vector velocity, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the angular velocity for this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetAngularVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getangularvelocity) will return the previous velocity until the write occurs. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetAngularVelocity( Sansar.Vector velocity, Action handler ) ``` Sets the angular velocity for this RigidBodyComponent. Angular velocity is clamped between -100m/s and 100m/s. | Parameter | Type | Description | |---|---|---| | `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetAngularVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getangularvelocity) will return the previous velocity until the write occurs. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetBounce
```csharp signature public void SetBounce(float bounce) ``` Sets the bounce of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The bounce factor. Value should be between 0 and 1 (inclusive) |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetBounce( float bounce, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the bounce of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The bounce factor. Value should be between 0 and 1 (inclusive) | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetBounce( float bounce, Action handler ) ``` Sets the bounce of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The bounce factor. Value should be between 0 and 1 (inclusive) | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetCanGrab
```csharp signature public void SetCanGrab(bool canGrab) ``` Sets the can grab state for this rigidbody. | Parameter | Type | Description | |---|---|---| | `canGrab` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Boolean value to indicate if the rigid body can be grabbed. |
Remarks This method will throw an exception if the rigid body has the static motion type. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetCanGrab( bool canGrab, Action handler ) ``` Sets the can grab state for this rigidbody. | Parameter | Type | Description | |---|---|---| | `canGrab` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Boolean value to indicate if the rigid body can be grabbed. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This method will throw an exception if the rigid body has the static motion type. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetCenterOfMass
```csharp signature public void SetCenterOfMass(Sansar.Vector centerOfMass) ``` Sets the center of mass of this object in local space. | Parameter | Type | Description | |---|---|---| | `centerOfMass` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector to the center of mass of this object, in the objects local space. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetCenterOfMass( Sansar.Vector centerOfMass, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the center of mass of this object in local space. | Parameter | Type | Description | |---|---|---| | `centerOfMass` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector to the center of mass of this object, in the objects local space. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetCenterOfMass( Sansar.Vector centerOfMass, Action handler ) ``` Sets the center of mass of this object in local space. | Parameter | Type | Description | |---|---|---| | `centerOfMass` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector to the center of mass of this object, in the objects local space. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetDynamicFriction
```csharp signature public void SetDynamicFriction(float dynamicFriction) ``` Sets the dynamic friction of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `dynamicFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The dynamic friction. Value should be between 0 and 1 (inclusive) |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetDynamicFriction( float dynamicFriction, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the dynamic friction of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `dynamicFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The dynamic friction. Value should be between 0 and 1 (inclusive) | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetDynamicFriction( float dynamicFriction, Action handler ) ``` Sets the dynamic friction of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `dynamicFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The dynamic friction. Value should be between 0 and 1 (inclusive) | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetGravityFactor
```csharp signature public void SetGravityFactor(float gravityFactor) ``` Sets what factor of the world's gravity is applied to this object. | Parameter | Type | Description | |---|---|---| | `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is -2 to 2 |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetGravityFactor( float gravityFactor, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets what factor of the world's gravity is applied to this object. | Parameter | Type | Description | |---|---|---| | `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is -2 to 2 | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetGravityFactor( float gravityFactor, Action handler ) ``` Sets what factor of the world's gravity is applied to this object. | Parameter | Type | Description | |---|---|---| | `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is -2 to 2 | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetInverseInertia
```csharp signature public void SetInverseInertia(Sansar.Vector inverseInertia) ``` Sets the moment of inertia for this object. | Parameter | Type | Description | |---|---|---| | `inverseInertia` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector representation of the inverse moment of inertia for this object in world space. |
Remarks Setting this to zero in the x and y components, for example, will give this object infinite inertia on the x and y axes and only permit it to rotate around the z axis. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetInverseInertia( Sansar.Vector inverseInertia, Action handler ) ``` Sets the moment of inertia for this object. | Parameter | Type | Description | |---|---|---| | `inverseInertia` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector representation of the inverse moment of inertia for this object in world space. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Setting this to zero in the x and y components, for example, will give this object infinite inertia on the x and y axes and only permit it to rotate around the z axis. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetLinearDamping
```csharp signature public void SetLinearDamping(float linearDamping) ``` Sets the amount of damping to apply to this object's linear motion. | Parameter | Type | Description | |---|---|---| | `linearDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The linear damping factor. Default value is 0. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetLinearDamping( float linearDamping, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the amount of damping to apply to this object's linear motion. | Parameter | Type | Description | |---|---|---| | `linearDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The linear damping factor. Default value is 0. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetLinearDamping( float linearDamping, Action handler ) ``` Sets the amount of damping to apply to this object's linear motion. | Parameter | Type | Description | |---|---|---| | `linearDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The linear damping factor. Default value is 0. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetLinearVelocity
```csharp signature public void SetLinearVelocity(Sansar.Vector velocity) ``` Sets the linear velocity for this RigidBodyComponent. Linear velocity is clamped between -200m/s and 200m/s. | Parameter | Type | Description | |---|---|---| | `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |
Remarks This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetLinearVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getlinearvelocity) will return the previous velocity until the write occurs. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetLinearVelocity( Sansar.Vector velocity, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the linear velocity for this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetLinearVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getlinearvelocity) will return the previous velocity until the write occurs. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetLinearVelocity( Sansar.Vector velocity, Action handler ) ``` Sets the linear velocity for this RigidBodyComponent. Linear velocity is clamped between -200m/s and 200m/s. | Parameter | Type | Description | |---|---|---| | `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetLinearVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getlinearvelocity) will return the previous velocity until the write occurs. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetMass
```csharp signature public void SetMass(float mass) ``` Sets the mass of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `mass` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The mass. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetMass( float mass, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the mass of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `mass` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The mass. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetMass( float mass, Action handler ) ``` Sets the mass of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `mass` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The mass. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetMotionType
```csharp signature public void SetMotionType(RigidBodyMotionType motionType) ``` Sets the motion type for this rigidbody. | Parameter | Type | Description | |---|---|---| | `motionType` | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | The motion type. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetMotionType( RigidBodyMotionType motionType, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the motion type for this rigidbody. | Parameter | Type | Description | |---|---|---| | `motionType` | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | The motion type. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetMotionType( RigidBodyMotionType motionType, Action handler ) ``` Sets the motion type for this rigidbody. | Parameter | Type | Description | |---|---|---| | `motionType` | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | The motion type. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetOrientation
```csharp signature public void SetOrientation(Sansar.Quaternion orientation) ``` Sets the orientation of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Use SetOrientation(Quaternion)", false)] public ulong SetOrientation(Sansar.Vector orientation) ``` Sets the orientation of this $className$. | Parameter | Type | Description | |---|---|---| | `orientation` | [Sansar.Vector](/scripting/api/sansar/vector) | The orientation. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks Deprecated. Use SetOrientation(Quaternion) instead.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetOrientation( Sansar.Quaternion orientation, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the orientation of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetOrientation( Sansar.Quaternion orientation, Action handler ) ``` Sets the orientation of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Use SetOrientation(Quaternion)", false)] public ulong SetOrientation( Sansar.Vector orientation, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the orientation of this $className$. | Parameter | Type | Description | |---|---|---| | `orientation` | [Sansar.Vector](/scripting/api/sansar/vector) | The orientation. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks Deprecated. Use SetOrientation(Quaternion) instead.
Deprecated
```csharp signature [System.Obsolete("Use SetOrientation(Quaternion)", false)] public ulong SetOrientation( Sansar.Vector orientation, Action handler ) ``` Sets the orientation of this $className$. | Parameter | Type | Description | |---|---|---| | `orientation` | [Sansar.Vector](/scripting/api/sansar/vector) | The orientation. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks Deprecated. Use SetOrientation(Quaternion) instead.
### SetPosition
```csharp signature public void SetPosition(Sansar.Vector position) ``` Sets the position of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The position. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetPosition( Sansar.Vector position, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the position of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The position. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetPosition( Sansar.Vector position, Action handler ) ``` Sets the position of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The position. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### SetStaticFriction
```csharp signature public void SetStaticFriction(float staticFriction) ``` Sets the static friction of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `staticFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The static friction. Value should be between 0 and 1 (inclusive) |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetStaticFriction( float staticFriction, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the static friction of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `staticFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The static friction. Value should be between 0 and 1 (inclusive) | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
```csharp signature public void SetStaticFriction( float staticFriction, Action handler ) ``` Sets the static friction of this RigidBodyComponent. | Parameter | Type | Description | |---|---|---| | `staticFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The static friction. Value should be between 0 and 1 (inclusive) | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.
### Subscribe
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( CollisionEventType EventType, RigidBodyComponent.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Collision Events. | Parameter | Type | Description | |---|---|---| | `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. | | `callback` | [RigidBodyComponent.SubscriptionHandler](/scripting/api/sansar.simulation/rigidbodycomponent.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( CollisionEventType EventType, Action callback, bool persistent ) ``` Subscribes to Collision Events. | Parameter | Type | Description | |---|---|---| | `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. | | `callback` | [Action<CollisionData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( CollisionEventType EventType, Sansar.Script.ComponentId HitComponentId, RigidBodyComponent.SubscriptionHandler callback, bool persistent ) ``` Subscribes to Collision Events. | Parameter | Type | Description | |---|---|---| | `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. | | `HitComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the rigid body component or character that was hit. | | `callback` | [RigidBodyComponent.SubscriptionHandler](/scripting/api/sansar.simulation/rigidbodycomponent.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( CollisionEventType EventType, Sansar.Script.ComponentId HitComponentId, Action callback, bool persistent ) ``` Subscribes to Collision Events. | Parameter | Type | Description | |---|---|---| | `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. | | `HitComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the rigid body component or character that was hit. | | `callback` | [Action<CollisionData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### SubscribeToHeldObject
```csharp signature public Sansar.Script.IEventSubscription SubscribeToHeldObject( HeldObjectEventType HeldObjectEvent, Action callback, bool persistent ) ``` Subscribes to HeldObject Events. | Parameter | Type | Description | |---|---|---| | `HeldObjectEvent` | [HeldObjectEventType](/scripting/api/sansar.simulation/heldobjecteventtype) | The type of held object event which occurred. | | `callback` | [Action<HeldObjectData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### SubscribeToSitObject
```csharp signature public Sansar.Script.IEventSubscription SubscribeToSitObject( SitEventType SitObjectEvent, Action callback, bool persistent ) ``` Subscribes to SitObject Events. | Parameter | Type | Description | |---|---|---| | `SitObjectEvent` | [SitEventType](/scripting/api/sansar.simulation/siteventtype) | The type of sit event which occurred. | | `callback` | [Action<SitObjectData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [MoverExample1.cs](/scripting/examples/mover-examples) - [RandomMovement.cs](/scripting/examples/random-movement) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs) - [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs) …and 15 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/rigidbodycomponent --- # RigidBodyComponent.SubscriptionHandler Kind: Delegate · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Delegate Namespace Sansar.Simulation
Handler for rigid body events. ```csharp [System.Obsolete("Use subscription callbacks of type Action", false)] public delegate void RigidBodyComponent.SubscriptionHandler( CollisionEventType EventType, Sansar.Script.ComponentId ComponentId, Sansar.Script.ComponentId HitComponentId, ObjectPublic HitObject, CollisionEventPhase Phase, ControlPointType HitControlPoint ) ``` | Parameter | Type | Description | |---|---|---| | `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. | | `ComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the rigid body component. | | `HitComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the rigid body component or character that was hit. | | `HitObject` | [ObjectPublic](/scripting/api/sansar.simulation/objectpublic) | The [`ObjectPublic`](/scripting/api/sansar.simulation/objectpublic) that was hit. | | `Phase` | [CollisionEventPhase](/scripting/api/sansar.simulation/collisioneventphase) | used by trigger events to determine if trigger enter or exit occurred | | `HitControlPoint` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | The specific control point hit, if any |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/rigidbodycomponent.subscriptionhandler --- # RigidBodyMotionType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Type of motion that can be applied to a rigid body. ```csharp public enum RigidBodyMotionType ``` ## Values | Value | Description | |---|---| | `MotionTypeDynamic` | Dynamic. This object is fully affected by the physics simulation. | | `MotionTypeKeyframed` | Keyframed. This object has its position and velocity directly controlled by scripts. | | `MotionTypeStatic` | Static. This object never moves. | ## Used in examples - [MoverExample1.cs](/scripting/examples/mover-examples) - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) - [ScriptLibrary/Scene/KeyframedMotion.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/KeyframedMotion.cs) - [ScriptLibrary/Scene/PositionReset.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/PositionReset.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/rigidbodymotiontype --- # SceneInfo Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Information about a Scene. ```csharp public class SceneInfo : Sansar.Script.InstanceInterface ``` ## Remarks Provides read only access to Scene information. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ApiVersion](#apiversion) · [ApiVersionString](#apiversionstring) | | **Properties** | [AccessGroup](#accessgroup) · [AvatarId](#avatarid) · [AvatarUuid](#avataruuid) · [BuildId](#buildid) · [CompatVersion](#compatversion) · [Configuration](#configuration) · [EventId](#eventid) · [ExperienceId](#experienceid) · [ExperienceName](#experiencename) · [InstanceId](#instanceid) · [InstanceRole](#instancerole) · [LocationHandle](#locationhandle) · [MaxUsers](#maxusers) · [ProtoVersion](#protoversion) · [SansarUri](#sansaruri) | | **Methods** | [ToString](#tostring) | ## Fields ### ApiVersion
```csharp signature public static readonly Version ApiVersion ``` Api version the scene is running.
### ApiVersionString
```csharp signature public static readonly string ApiVersionString ``` Api version the scene is running.
## Properties ### AccessGroup
```csharp signature public string AccessGroup { get; } ``` Access group of the scene. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String name of the access group.
Remarks For internal debugging
### AvatarId
```csharp signature public string AvatarId { get; } ``` Persona handle for the owner of the scene. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks This handle can be used with [`Client.TeleportToLocation`](/scripting/api/sansar.simulation/client#teleporttolocation-string-string).
### AvatarUuid
```csharp signature public Guid AvatarUuid { get; } ``` Persona ID for the owner of the scene. **Value:** [Guid](https://learn.microsoft.com/dotnet/api/system.guid) — System.Guid
Remarks The persona ID can be used to verify an agent is the owner of the scene. To retrieve the agent's id use [`AgentInfo.AvatarUuid`](/scripting/api/sansar.simulation/agentinfo#avataruuid).
### BuildId
```csharp signature public string BuildId { get; } ``` Scene's build id for debugging. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String build id of the region server.
Remarks For internal debugging.
### CompatVersion
```csharp signature public string CompatVersion { get; } ``` Scene's asset compatibility version for debugging. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks All assets must match this version to load.
### Configuration
```csharp signature public string Configuration { get; } ``` Scene's build configuration. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — Expected values are debug, release or production.
Remarks For internal debugging
### EventId
Added in 31.1.0
```csharp signature public string EventId { get; } ``` The event id of this scene if it is part of an event. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The Guid for this event as a string.
### ExperienceId
```csharp signature public string ExperienceId { get; } ``` Scene's World Id. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — World id string
Remarks For internal debugging.
### ExperienceName
```csharp signature public string ExperienceName { get; } ``` Scene's experience name. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — Experience name string
Remarks For internal debugging.
### InstanceId
```csharp signature public string InstanceId { get; } ``` Instance id for this specific instance of the scene. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
### InstanceRole
```csharp signature public string InstanceRole { get; } ``` The role of this scene. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The role of this instance: "Unset", "Broadcaster", or "Clone".
Remarks Broadcaster scenes have the role "Broadcaster" and clone scenes have the role "Clone". Normal scenes will have the role "Unset".
### LocationHandle
```csharp signature public string LocationHandle { get; } ``` Location handle for the Experience. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks This handle can be used with [`Client.TeleportToLocation`](/scripting/api/sansar.simulation/client#teleporttolocation-string-string).
### MaxUsers
```csharp signature public int MaxUsers { get; } ``` Maximum number of users allowed per instance of this scene. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — Maximum number of users allowed in the scene.
Remarks New instances will start if more users attempt to join the scene.
### ProtoVersion
```csharp signature public string ProtoVersion { get; } ``` Scene's message protocol version for debugging. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks Can be used to verify the Experience's protocol version is the expected value.
### SansarUri
```csharp signature public string SansarUri { get; } ``` The full Sansar URI for this instance of the scene. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs) - [ScriptLibrary/Scene/ChatCommand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/ChatCommand.cs) - [ScriptLibrary/Scene/Hotkey.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Hotkey.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sceneinfo --- # SceneObjectScript Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.ScriptBase
Extend SceneObjectScript to create a script that can be used on content that is natively in the scene. This is the primary script type in Sansar. ```csharp public abstract class SceneObjectScript : Sansar.Script.ScriptBase ``` ## Remarks Override [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) for script initialization, primarily event subscriptions. Use [`SceneObjectScript.ObjectPrivate`](/scripting/api/sansar.simulation/sceneobjectscript#objectprivate) to access the Object the script is on. Use [`SceneObjectScript.ScenePrivate`](/scripting/api/sansar.simulation/sceneobjectscript#sceneprivate) to access the Scene the object is in. ```csharp title="SceneObjectScriptExample.cs" /* This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. * When using this content, you must: * • Acknowledge that the content is from the Sansar Knowledge Base. * • Include our copyright notice: "© 2022 Sansar, Inc." * • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License. * • Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode. * For example: * "This work uses content from the Sansar Knowledge Base. © 2018 Linden Research, Inc. Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)." */ /* Start a coroutine to wait for collision events. * Which types of collisions are handled may be set on the properties panel for * the object when editing the scene. */ using Sansar.Simulation; using Sansar.Script; using System; // To get full access to the Object API a script must extend from ObjectScript public class SceneObjectScriptExample : SceneObjectScript { // Components can be set in the editor if the correct component types are added to the object [EditorVisible] private RigidBodyComponent RigidBody = null; [DefaultValue(true)] [DisplayName("Track Avatar Hits")] [EditorVisible] private bool TrackAgentHits = true; [DefaultValue(true)] [DisplayName("Track Object Hits")] [EditorVisible] private bool TrackObjectHits = true; public SceneObjectScriptExample() { // Script initialization order: // Constructor (this method) // Set base class members (ObjectScript's ExperienceInfo, SceneInfo, and ObjectPrivate) // Set public fields that were configured at edit time (RigidBody, TrackAgentHist, TrackObjectHits) // Init() } // Override Init to set up event handlers and start coroutines. public override void Init() { // When unhandled exceptions occur, they may be caught with this event handler. // Certain exceptions may not be recoverable at all and may cause the script to // immediately be removed. Script.UnhandledException += UnhandledException; // If the object had its components set in the editor they should now have the member initialized // The component can also be found dynamically if (RigidBody == null) { if (!ObjectPrivate.TryGetFirstComponent(out RigidBody)) { // Since object scripts are initialized when the scene loads, no one will actually see this message. ScenePrivate.Chat.MessageAllUsers("There is no RigidBodyComponent attached to this object."); return; } } // Convert the supplied bools to the correct CollisionEventType to track CollisionEventType trackedEvents = 0; if (TrackAgentHits) { trackedEvents |= CollisionEventType.CharacterContact; } if (TrackObjectHits) { trackedEvents |= CollisionEventType.RigidBodyContact; } // StartCoroutine will queue CheckForCollisions to run // Arguments after the coroutine method are passed as arguments to the method. StartCoroutine(CheckForCollisions, trackedEvents); } private void CheckForCollisions(CollisionEventType trackedEvents) { while (true) { // This will block the coroutine until a collision happens CollisionData data = (CollisionData)WaitFor(RigidBody.Subscribe, trackedEvents, Sansar.Script.ComponentId.Invalid); if (data.EventType == CollisionEventType.CharacterContact) { ScenePrivate.Chat.MessageAllUsers("I hit an avatar!"); } else { ScenePrivate.Chat.MessageAllUsers("I hit an object!"); } } } private void UnhandledException(object sender, Exception e) { // Depending on the script scheduling policy, the exception may or may not be recoverable. // An unrecoverable exception that can be handled will only be given a short time to run // so the handler method needs to be kept small. // Any exception thrown from this method will terminate the script regardless of the value // of UnhandledExceptionRecoverable if (!Script.UnhandledExceptionRecoverable) { ScenePrivate.Chat.MessageAllUsers("Unrecoverable exception happened, the script will now be removed."); } else { ScenePrivate.Chat.MessageAllUsers("This script will be allowed to continue."); } } } ```

Source: Examples/SceneObjectScriptExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Members at a glance | Kind | Members | |---|---| | **Constructors** | [SceneObjectScript](#sceneobjectscript) | | **Properties** | [AllowedContexts](#allowedcontexts) · [ObjectPrivate](#objectprivate) · [ScenePrivate](#sceneprivate) | ## Constructors ### SceneObjectScript
```csharp signature protected SceneObjectScript() ``` This constructor is called before any properties have been set. Override [`ScriptBase.Init`](/scripting/api/sansar.script/scriptbase#init) to initialize the script after properties have been set.
## Properties ### AllowedContexts
```csharp signature protected override sealed Sansar.Script.Reflective.Context AllowedContexts { get; } ``` Internal use only.
### ObjectPrivate
```csharp signature [Sansar.Script.NonReflective] public ObjectPrivate ObjectPrivate { protected get; set; } ``` The ObjectPrivate this script is attached to if it is attached to an object. **Value:** [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) — The scene object this script is attached to if it is attached to an object, null otherwise.
Remarks For AgentScripts this is the Agent's ObjectPrivate of their avatar.
### ScenePrivate
```csharp signature [Sansar.Script.NonReflective] public ScenePrivate ScenePrivate { protected get; set; } ``` The Scene API for the Scene this script is a part of if the script is attached to scene content. **Value:** [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate) — The Scene API for this scene if this script was attached to scene content, null otherwise.
Remarks This value will be set before Init is called.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [RandomMovement.cs](/scripting/examples/random-movement) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [ReflectiveTrackerExample.cs](/scripting/examples/reflective-detector) - [SimpleScriptExample.cs](/scripting/examples/simple-script) - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [AdvancedCoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AdvancedCoroutineExample.cs) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) …and 36 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sceneobjectscript --- # ScenePrivate Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Interface for Scripts that are part of a Scene. A more complete and less limited API than [`ScenePublic`](/scripting/api/sansar.simulation/scenepublic) ```csharp public class ScenePrivate : Sansar.Script.InstanceInterface ``` ## Remarks The ScenePrivate class provides services relating to the Scene. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [GravityMaximum](#gravitymaximum) · [GravityMinimum](#gravityminimum) · [MaximumCastRayResults](#maximumcastrayresults) · [MinimumCastRadius](#minimumcastradius) | | **Properties** | [AgentCount](#agentcount) · [Chat](#chat) · [DefaultGravity](#defaultgravity) · [HttpClient](#httpclient) · [Reactions](#reactions) · [SceneInfo](#sceneinfo) · [User](#user) | | **Methods** | [AddToSceneLibrary](#addtoscenelibrary) · [AddToSceneLibraryForAgent](#addtoscenelibraryforagent) · [CastBox](#castbox) · [CastCapsule](#castcapsule) · [CastRay](#castray) · [CastSphere](#castsphere) · [ClearAllowFlightOverrideForAgent](#clearallowflightoverrideforagent) New in 47.10.0 · [ClearAllowFlightOverrides](#clearallowflightoverrides) New in 47.10.0 · [ClearColorLut](#clearcolorlut) New in 47.10.0 · [ClearColorLutOverrideForAgent](#clearcolorlutoverrideforagent) New in 47.10.0 · [ClearColorLutOverrides](#clearcolorlutoverrides) New in 47.10.0 · [ClearSceneLibrary](#clearscenelibrary) · [ClearSceneLibraryForAgent](#clearscenelibraryforagent) · [CreateCluster](#createcluster) · [CreateDataStore](#createdatastore) · [FindAgent](#findagent) · [FindObject](#findobject) · [FindReflective](#findreflective) · [FindScript](#findscript) · [GetAgent](#getagent) · [GetAgents](#getagents) · [GetAllowFlight](#getallowflight) New in 47.10.0 · [GetBoxClosestPoints](#getboxclosestpoints) · [GetCapsuleClosestPoints](#getcapsuleclosestpoints) · [GetGravity](#getgravity) · [GetPortalCreatorName](#getportalcreatorname) · [GetPortalDescription](#getportaldescription) · [GetPortalUri](#getportaluri) · [GetSphereClosestPoints](#getsphereclosestpoints) · [GetTimeOfDay](#gettimeofday) New in 47.10.0 · [GetTimeOfDayMode](#gettimeofdaymode) New in 47.10.0 · [OverrideAudioStream](#overrideaudiostream) · [OverrideIndexedMediaSource](#overrideindexedmediasource) · [OverrideMediaSource](#overridemediasource) · [PerformIndexedMediaAction](#performindexedmediaaction) · [PerformMediaAction](#performmediaaction) · [PlaySound](#playsound) · [PlaySoundAtPosition](#playsoundatposition) · [PlayStream](#playstream) · [PlayStreamAtPosition](#playstreamatposition) · [RemoveFromSceneLibrary](#removefromscenelibrary) · [RemoveFromSceneLibraryForAgent](#removefromscenelibraryforagent) · [ResetScene](#resetscene) · [SetAllowFlight](#setallowflight) New in 47.10.0 · [SetColorLut](#setcolorlut) New in 47.10.0 · [SetGravity](#setgravity) · [SetMegaphone](#setmegaphone) · [SetTimeOfDay](#settimeofday) New in 47.10.0 · [SetTimeOfDayMode](#settimeofdaymode) New in 47.10.0 · [ShakeCameraAtPosition](#shakecameraatposition) New in 47.10.0 · [StopAllCameraShakes](#stopallcamerashakes) New in 47.10.0 · [ToString](#tostring) · [VoiceBroadcastStart](#voicebroadcaststart) · [VoiceBroadcastStop](#voicebroadcaststop) · [VoiceBroadcastStopAll](#voicebroadcaststopall) | ## Fields ### GravityMaximum
```csharp signature public static readonly float GravityMaximum ``` The maximum gravity magnitude in m/s^2, which is equal to 49.05 or 5 G's.
Remarks A value greater than this will clamp to this value.
### GravityMinimum
```csharp signature public static readonly float GravityMinimum ``` The minimum allowed gravity magnitude in m/s^2, which is equal to zero.
Remarks A value less than this will clamp to this value.
### MaximumCastRayResults
```csharp signature public static readonly int MaximumCastRayResults ``` The maximum number of results returned from a `CastRay`, `CastSphere` or `CastBox` call. Anything over this will be truncated.
### MinimumCastRadius
```csharp signature public static readonly float MinimumCastRadius ``` The minimum radius for a `CastSphere` call or minimum half extents for `CastBox`. Any value smaller than this will use `CastRay` instead.
## Properties ### AgentCount
```csharp signature public uint AgentCount { get; } ``` The number of agents in the Scene. **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — Unsigned integer count of the number of agents in the Scene.
Remarks This number changes when agents join and part.
### Chat
```csharp signature public Chat Chat { get; } ``` Gets the Chat interface for this Scene **Value:** [Chat](/scripting/api/sansar.simulation/chat) — The Chat Api
### DefaultGravity
```csharp signature public float DefaultGravity { get; } ``` The default gravity magnitude in the scene in m/s^2, which is equal to 9.81 or 1 G. **Value:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The default scene gravity magnitude.
Remarks The direction of the gravity vector is constant.
Example ```csharp float sansarGravity = ScenePrivate.DefaultGravity; // Get default gravity in m/s^2 ```
### HttpClient
```csharp signature public HttpClient HttpClient { get; } ``` Gets the HttpClient for this Scene **Value:** [HttpClient](/scripting/api/sansar.simulation/httpclient) — The HttpClient Api
### Reactions
Added in 41.0.0
```csharp signature public Reactions Reactions { get; } ``` Gets the Reactions interface for this Scene **Value:** [Reactions](/scripting/api/sansar.simulation/reactions) — The Chat Api
### SceneInfo
```csharp signature public SceneInfo SceneInfo { get; } ``` Gets the SceneInfo for this Scene **Value:** [SceneInfo](/scripting/api/sansar.simulation/sceneinfo) — The full SceneInfo Api
### User
```csharp signature public User User { get; } ``` Gets the User interface for this Scene **Value:** [User](/scripting/api/sansar.simulation/user) — The User Api
## Methods ### AddToSceneLibrary
Added in 47.1.1
```csharp signature public void AddToSceneLibrary( ClusterResource resource, string displayName ) ``` Add an item to the scene library for all users. | Parameter | Type | Description | |---|---|---| | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | The cluster resource to add. | | `displayName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The display name shown in the backpack. |
Added in 47.2.0
```csharp signature public void AddToSceneLibrary( ClusterResource resource, string displayName, string thumbnailAssetId ) ``` Add an item to the scene library for all users. | Parameter | Type | Description | |---|---|---| | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | The cluster resource to add. | | `displayName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The display name shown in the backpack. | | `thumbnailAssetId` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional thumbnail asset id shown as the item icon. |
### AddToSceneLibraryForAgent
Added in 47.1.1
```csharp signature public void AddToSceneLibraryForAgent( AgentPrivate agent, ClusterResource resource, string displayName ) ``` Add an item to the scene library for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. | | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | The cluster resource to add. | | `displayName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The display name shown in the backpack. |
Added in 47.2.0
```csharp signature public void AddToSceneLibraryForAgent( AgentPrivate agent, ClusterResource resource, string displayName, string thumbnailAssetId ) ``` Add an item to the scene library for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. | | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | The cluster resource to add. | | `displayName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The display name shown in the backpack. | | `thumbnailAssetId` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional thumbnail asset id shown as the item icon. |
### CastBox
```csharp signature public RayCastHit[] CastBox( Sansar.Vector halfExtents, Sansar.Vector start, Sansar.Vector end ) ``` Casts a box from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If all 3 dimensions are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead. maxHits defaults to 1 if unspecified and will return only the nearest hit.
```csharp signature public RayCastHit[] CastBox( Sansar.Vector halfExtents, Sansar.Quaternion orientation, Sansar.Vector start, Sansar.Vector end ) ``` Casts a box from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If all 3 dimensions are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead.
```csharp signature public RayCastHit[] CastBox( Sansar.Vector halfExtents, Sansar.Vector start, Sansar.Vector end, int maxHits ) ``` Casts a box from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If all 3 dimensions are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead. maxHits defaults to 1 if unspecified and will return only the nearest hit.
```csharp signature public RayCastHit[] CastBox( Sansar.Vector halfExtents, Sansar.Quaternion orientation, Sansar.Vector start, Sansar.Vector end, int maxHits ) ``` Casts a box from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If all 3 dimensions are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead.
### CastCapsule
```csharp signature public RayCastHit[] CastCapsule( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Vector start, Sansar.Vector end ) ``` Casts a capsule from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If the radius and capsule length are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead.
```csharp signature public RayCastHit[] CastCapsule( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Quaternion orientation, Sansar.Vector start, Sansar.Vector end ) ``` Casts a capsule from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If the radius and capsule length are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead.
```csharp signature public RayCastHit[] CastCapsule( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Vector start, Sansar.Vector end, int maxHits ) ``` Casts a capsule from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If the radius and capsule length are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead.
```csharp signature public RayCastHit[] CastCapsule( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Quaternion orientation, Sansar.Vector start, Sansar.Vector end, int maxHits ) ``` Casts a capsule from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
Remarks If the radius and capsule length are less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to `CastRay` instead.
### CastRay
```csharp signature public RayCastHit[] CastRay(Sansar.Vector start, Sansar.Vector end) ``` Casts a ray from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\] — An array of hit results, ordered from nearest to furthest. If the cast did not hit anything the array will be empty.
Remarks maxHits defaults to 1 if unspecified and will return only the nearest hit.
```csharp signature public RayCastHit[] CastRay( Sansar.Vector start, Sansar.Vector end, int maxHits ) ``` Casts a ray from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\] — An array of hit results, ordered from nearest to furthest. If the cast did not hit anything the array will be empty.
Remarks maxHits defaults to 1 if unspecified and will return only the nearest hit.
### CastSphere
```csharp signature public RayCastHit[] CastSphere( float radius, Sansar.Vector start, Sansar.Vector end ) ``` Casts a sphere from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `radius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the sphere. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\] — An array of hit results, ordered from nearest to furthest. If the cast did not hit anything the array will be empty.
Remarks If the radius is less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to [`ScenePrivate.CastRay`](/scripting/api/sansar.simulation/sceneprivate#castray-vector-vector-int32) instead. maxHits defaults to 1 if unspecified and will return only the nearest hit.
```csharp signature public RayCastHit[] CastSphere( float radius, Sansar.Vector start, Sansar.Vector end, int maxHits ) ``` Casts a sphere from start to end and returns an array of collisions along the path. | Parameter | Type | Description | |---|---|---| | `radius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the sphere. | | `start` | [Sansar.Vector](/scripting/api/sansar/vector) | The initial point of the query. | | `end` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the query. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\] — An array of hit results, ordered from nearest to furthest. If the cast did not hit anything the array will be empty.
Remarks If the radius is less than [`ScenePrivate.MinimumCastRadius`](/scripting/api/sansar.simulation/sceneprivate#minimumcastradius) the call will be forwarded to [`ScenePrivate.CastRay`](/scripting/api/sansar.simulation/sceneprivate#castray-vector-vector-int32) instead. maxHits defaults to 1 if unspecified and will return only the nearest hit.
### ClearAllowFlightOverrideForAgent
New in 47.10.0
```csharp signature public void ClearAllowFlightOverrideForAgent(AgentPrivate agent) ``` Clears the per-agent flight override for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. |
Remarks The agent will inherit this instance's default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
New in 47.10.0
```csharp signature public void ClearAllowFlightOverrideForAgent( AgentPrivate agent, Action handler ) ``` Clears the per-agent flight override for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The agent will inherit this instance's default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
### ClearAllowFlightOverrides
New in 47.10.0
```csharp signature public void ClearAllowFlightOverrides() ``` Clears all per-agent flight overrides in this scene.
Remarks All agents will inherit this instance's unchanged default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
New in 47.10.0
```csharp signature public void ClearAllowFlightOverrides( Action handler ) ``` Clears all per-agent flight overrides in this scene. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks All agents will inherit this instance's unchanged default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
### ClearColorLut
New in 47.10.0
```csharp signature public void ClearColorLut() ``` Removes the scene-wide color LUT override, going back to the LUT chosen in the scene settings.
Remarks Per-agent overrides persist until cleared or the agent leaves. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
New in 47.10.0
```csharp signature public void ClearColorLut( Action handler ) ``` Removes the scene-wide color LUT override, going back to the LUT chosen in the scene settings. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Per-agent overrides persist until cleared or the agent leaves. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
### ClearColorLutOverrideForAgent
New in 47.10.0
```csharp signature public void ClearColorLutOverrideForAgent(AgentPrivate agent) ``` Clears the per-agent color LUT override for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. |
Remarks The agent goes back to the scene-wide LUT. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
New in 47.10.0
```csharp signature public void ClearColorLutOverrideForAgent( AgentPrivate agent, Action handler ) ``` Clears the per-agent color LUT override for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The agent goes back to the scene-wide LUT. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.
### ClearColorLutOverrides
New in 47.10.0
```csharp signature public void ClearColorLutOverrides() ``` Clears all per-agent color LUT overrides in this scene.
Remarks All agents go back to the scene-wide LUT, which is left as it is. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
New in 47.10.0
```csharp signature public void ClearColorLutOverrides( Action handler ) ``` Clears all per-agent color LUT overrides in this scene. | Parameter | Type | Description | |---|---|---| | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks All agents go back to the scene-wide LUT, which is left as it is. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
### ClearSceneLibrary
Added in 47.1.1
```csharp signature public void ClearSceneLibrary() ``` Remove all items from the scene library for all users.
### ClearSceneLibraryForAgent
Added in 47.1.1
```csharp signature public void ClearSceneLibraryForAgent(AgentPrivate agent) ``` Remove all per-agent scene library items for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. |
### CreateCluster
```csharp signature public ulong CreateCluster( ClusterResource asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity ) ``` Creates a new cluster and adds it to the Scene. | Parameter | Type | Description | |---|---|---| | `asset` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | Asset identifier to create. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | Mono.Simd.Vector4f for the initial position. | | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | Mono.Simd.Vector4f for the initial rotation. | | `initialVelocity` | [Sansar.Vector](/scripting/api/sansar/vector) | Mono.Simd.Vector4f for the initial velocity. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The internal event id for the completion event.
Remarks The new object may start simulating before the event is triggered.
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong CreateCluster( ClusterResource asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity, ScenePrivate.CreateClusterHandler handler ) ``` Creates a new cluster and adds it to the Scene. | Parameter | Type | Description | |---|---|---| | `asset` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | Asset identifier to create. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | Mono.Simd.Vector4f for the initial position. | | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | Mono.Simd.Vector4f for the initial rotation. | | `initialVelocity` | [Sansar.Vector](/scripting/api/sansar/vector) | Mono.Simd.Vector4f for the initial velocity. | | `handler` | [ScenePrivate.CreateClusterHandler](/scripting/api/sansar.simulation/sceneprivate.createclusterhandler) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The internal event id for the completion event.
Remarks The new object may start simulating before the event is triggered.
```csharp signature public void CreateCluster( ClusterResource asset, Sansar.Vector position, Sansar.Quaternion rotation, Sansar.Vector initialVelocity, Action handler ) ``` Creates a new cluster and adds it to the Scene. | Parameter | Type | Description | |---|---|---| | `asset` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | Asset identifier to create. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | Mono.Simd.Vector4f for the initial position. | | `rotation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | Mono.Simd.Vector4f for the initial rotation. | | `initialVelocity` | [Sansar.Vector](/scripting/api/sansar/vector) | Mono.Simd.Vector4f for the initial velocity. | | `handler` | [Action<ScenePrivate.CreateClusterData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks The new object may start simulating before the event is triggered.
### CreateDataStore
Added in 37.1.0
```csharp signature public DataStore CreateDataStore(Guid id) ``` Returns a new instance of the [`DataStore`](/scripting/api/sansar.simulation/datastore) class. | Parameter | Type | Description | |---|---|---| | `id` | [Guid](https://learn.microsoft.com/dotnet/api/system.guid) | The id of the [`DataStore`](/scripting/api/sansar.simulation/datastore) to create. | **Returns:** [DataStore](/scripting/api/sansar.simulation/datastore) — A new [`DataStore`](/scripting/api/sansar.simulation/datastore) object.
Remarks All [`DataStore`](/scripting/api/sansar.simulation/datastore) objects with a given [`DataStore.Id`](/scripting/api/sansar.simulation/datastore#id) share the same database.
Added in 37.1.0
```csharp signature public DataStore CreateDataStore(string id) ``` Returns a new instance of the [`DataStore`](/scripting/api/sansar.simulation/datastore) class. | Parameter | Type | Description | |---|---|---| | `id` | [string](https://learn.microsoft.com/dotnet/api/system.string) | String used to generate an id. If the id is a valid Guid then it will be used directly. | **Returns:** [DataStore](/scripting/api/sansar.simulation/datastore) — A new [`DataStore`](/scripting/api/sansar.simulation/datastore) object.
Remarks All [`DataStore`](/scripting/api/sansar.simulation/datastore) objects with a given [`DataStore.Id`](/scripting/api/sansar.simulation/datastore#id) share the same database. Ensure that this value is kept secret and unique.
### FindAgent
```csharp signature public AgentPrivate FindAgent(Sansar.Script.ObjectId objectId) ``` Looks up an Agent associated with the given object id. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | The object to find. | **Returns:** [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) — The agent, or null if an agent cannot be found with that id.
Remarks Agents may leave at any time.
```csharp signature public AgentPrivate FindAgent(Sansar.Script.SessionId sessionId) ``` Looks up an Agent associated with the given session id if they are in the scene. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The session id of the agent to find. | **Returns:** [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) — The agent, or null if an agent cannot be found with that id in the scene.
Remarks Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
```csharp signature public AgentPrivate FindAgent(Guid personaId) ``` Looks up an Agent associated with the given persona id, if they are in the scene. | Parameter | Type | Description | |---|---|---| | `personaId` | [Guid](https://learn.microsoft.com/dotnet/api/system.guid) | The object to find. | **Returns:** [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) — The agent, or null if an agent cannot be found with that id in the scene.
Remarks Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
### FindObject
```csharp signature public ObjectPrivate FindObject(Sansar.Script.ObjectId objectId) ``` Looks up a Object associated with the given object id. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | The object to find. | **Returns:** [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) — The ObjectPrivate, or null if a Object cannot be found with that id.
### FindReflective
```csharp signature [Sansar.Script.NonReflective] public IEnumerable FindReflective( string name ) where TInterface : class ``` Looks up Reflective objects in the scene that match the interface type by class name. | Parameter | Type | Description | |---|---|---| | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The type name of the object's class to find. | **Type parameters:** `TInterface`: The interface type to find. **Returns:** [IEnumerable<TInterface>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumerable which contains all objects of the given type name that match the given interface.
Remarks The name given corresponds to the `Type.FullName` of the object. Multiple scripts may define unrelated types of the same name, but only registered objects that match the interface of TInterface will be returned.
### FindScript
```csharp signature public object FindScript(Sansar.Script.ScriptId scriptId) ``` Looks up the script object associated with the given scriptId | Parameter | Type | Description | |---|---|---| | `scriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | The scriptId of the object to find. | **Returns:** [object](https://learn.microsoft.com/dotnet/api/system.object) — The script object, or null if an script cannot be found with that id in the scene.
Remarks Objects and their associated scripts may be removed the scene at any time.
### GetAgent
```csharp signature public AgentPrivate GetAgent(uint index) ``` Get an [`AgentPrivate`](/scripting/api/sansar.simulation/agentprivate) for a specific agent in the Scene. | Parameter | Type | Description | |---|---|---| | `index` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The index of the agent to get. | **Returns:** [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) — Returns null if the index is larger than the number of agents in the Scene, or if the agent is not fully loaded.
Remarks Agents may appear at different indices as they join and part.
### GetAgents
```csharp signature public IEnumerable GetAgents() ``` Returns the current list of Agents in the Scene. **Returns:** [IEnumerable<AgentPrivate>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — The current list of agents in the Scene
### GetAllowFlight
New in 47.10.0
```csharp signature public bool GetAllowFlight() ``` Gets the flight availability default for this scene instance. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The instance default, before per-agent overrides.
Remarks Flight settings are per instance: they are not saved to the world or shared with clone regions.
### GetBoxClosestPoints
```csharp signature public RayCastHit[] GetBoxClosestPoints( Sansar.Vector halfExtents, Sansar.Vector origin, float maximumDistance ) ``` Extends a box with the given half extents the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The center of the query. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
```csharp signature public RayCastHit[] GetBoxClosestPoints( Sansar.Vector halfExtents, Sansar.Vector origin, Sansar.Quaternion orientation, float maximumDistance ) ``` Extends a box with the given half extents the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The center of the query. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\] — An array of hit results, ordered from nearest to furthest. If the cast did not hit anything the array will be empty.
```csharp signature public RayCastHit[] GetBoxClosestPoints( Sansar.Vector halfExtents, Sansar.Vector origin, float maximumDistance, int maxHits ) ``` Extends a box with the given half extents the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The center of the query. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
```csharp signature public RayCastHit[] GetBoxClosestPoints( Sansar.Vector halfExtents, Sansar.Vector origin, Sansar.Quaternion orientation, float maximumDistance, int maxHits ) ``` Extends a box with the given half extents the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `halfExtents` | [Sansar.Vector](/scripting/api/sansar/vector) | The x,y,z distance from the center of the box to the corresponding face. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The center of the query. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\] — An array of hit results, ordered from nearest to furthest. If the cast did not hit anything the array will be empty.
### GetCapsuleClosestPoints
```csharp signature public RayCastHit[] GetCapsuleClosestPoints( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Vector origin, float maximumDistance ) ``` Extends a capsule with the given parameters the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The base of the capsule. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
```csharp signature public RayCastHit[] GetCapsuleClosestPoints( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Vector origin, Sansar.Quaternion orientation, float maximumDistance ) ``` Extends a capsule with the given parameters the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The base of the capsule. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
```csharp signature public RayCastHit[] GetCapsuleClosestPoints( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Vector origin, float maximumDistance, int maxHits ) ``` Extends a capsule with the given parameters the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The base of the capsule. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
```csharp signature public RayCastHit[] GetCapsuleClosestPoints( Sansar.Vector capsuleStart, Sansar.Vector capsuleEnd, float capsuleRadius, Sansar.Vector origin, Sansar.Quaternion orientation, float maximumDistance, int maxHits ) ``` Extends a capsule with the given parameters the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `capsuleStart` | [Sansar.Vector](/scripting/api/sansar/vector) | The base point of the capsule. | | `capsuleEnd` | [Sansar.Vector](/scripting/api/sansar/vector) | The end point of the capsule. | | `capsuleRadius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the capsule to query. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The base of the capsule. | | `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation of the query shape. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
### GetGravity
```csharp signature public float GetGravity() ``` Gets the scene's current acceleration of gravity in m/s^2. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — Number indicating the magnitude of gravity in the scene.
Remarks The default gravity for the scene is [`ScenePrivate.DefaultGravity`](/scripting/api/sansar.simulation/sceneprivate#defaultgravity)
Example ```csharp float currentGravity = ScenePrivate.GetGravity(); // Get the current scene gravity in m/s^2 ```
### GetPortalCreatorName
```csharp signature public string GetPortalCreatorName(Sansar.Script.ObjectId objectId) ``` The name of the user who created the specified portal. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks User who created the portal.
### GetPortalDescription
```csharp signature public string GetPortalDescription(Sansar.Script.ObjectId objectId) ``` Description for the specified portal. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks The description of the portal.
### GetPortalUri
```csharp signature public string GetPortalUri(Sansar.Script.ObjectId objectId) ``` URI destination for the specified portal. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks The URI of the destination of the portal.
### GetSphereClosestPoints
```csharp signature public RayCastHit[] GetSphereClosestPoints( float radius, Sansar.Vector origin, float maximumDistance ) ``` Extends a sphere with the given radius the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `radius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the sphere to query. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The center of the query. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
```csharp signature public RayCastHit[] GetSphereClosestPoints( float radius, Sansar.Vector origin, float maximumDistance, int maxHits ) ``` Extends a sphere with the given radius the maximum distance and returns any hits. | Parameter | Type | Description | |---|---|---| | `radius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The radius of the sphere to query. | | `origin` | [Sansar.Vector](/scripting/api/sansar/vector) | The center of the query. | | `maximumDistance` | [float](https://learn.microsoft.com/dotnet/api/system.single) | the maximum distance from the origin to check. | | `maxHits` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | Limit the number of results returned. | **Returns:** [RayCastHit](/scripting/api/sansar.simulation/raycasthit)\[\]
### GetTimeOfDay
New in 47.10.0
```csharp signature public float GetTimeOfDay() ``` Gets the scene's current time of day in hours. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The time of day in hours, from 0 up to 24.
Remarks The scene clock runs from 0 at midnight up to 24, so 13.5 is half past one in the afternoon. With the mode [`TimeOfDayMode.Off`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Off) this is the time set in the scene settings, which has no effect on the scene until the mode is [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) or [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle).
Example ```csharp float hours = ScenePrivate.GetTimeOfDay(); // Get the scene clock in hours ```
### GetTimeOfDayMode
New in 47.10.0
```csharp signature public TimeOfDayMode GetTimeOfDayMode() ``` Gets how the scene's time of day runs. **Returns:** [TimeOfDayMode](/scripting/api/sansar.simulation/timeofdaymode) — The current [`TimeOfDayMode`](/scripting/api/sansar.simulation/timeofdaymode).
Remarks See TimeOfDayExample.cs in the Examples folder for more details.
Example ```csharp bool dayNight = ScenePrivate.GetTimeOfDayMode() != TimeOfDayMode.Off; // Is the time of day in effect? ```
### OverrideAudioStream
```csharp signature public void OverrideAudioStream(string url) ``` Overrides source of web audio streams. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
Remarks Applies to all agents in this scene. NOTE: this may cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
```csharp signature public void OverrideAudioStream( string url, Action handler ) ``` Overrides source of web audio streams. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to all agents in this scene. NOTE: this may cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
### OverrideIndexedMediaSource
Added in 46.5.0
```csharp signature public void OverrideIndexedMediaSource( string url, int mediaIndex, int mediaWidth, int mediaHeight, Action handler ) ``` Overrides source of indexed media surfaces. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `mediaIndex` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source index. | | `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. | | `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to all agents in this scene. NOTE: this will cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
### OverrideMediaSource
```csharp signature public void OverrideMediaSource(string url) ``` Sets stream channel source. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
```csharp signature public void OverrideMediaSource( string url, int mediaWidth, int mediaHeight ) ``` Overrides source of media surfaces. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. | | `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. |
Remarks Applies to all agents in this scene. NOTE: this will cause a few seconds of silence while restarting starting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
```csharp signature public void OverrideMediaSource( string url, int mediaWidth, int mediaHeight, Action handler ) ``` Overrides source of media surfaces. | Parameter | Type | Description | |---|---|---| | `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. | | `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. | | `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to all agents in this scene. NOTE: this will cause a few seconds of silence while restarting the stream. To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.
### PerformIndexedMediaAction
Added in 46.5.0
```csharp signature public void PerformIndexedMediaAction( MediaAction action, int mediaIndex, Action handler ) ``` Performs a specific action on the current media surface index. | Parameter | Type | Description | |---|---|---| | `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. | | `mediaIndex` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source index. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to all agents currently in the scene.
### PerformMediaAction
```csharp signature public void PerformMediaAction(MediaAction action) ``` Performs a specific action on the current media surface. | Parameter | Type | Description | |---|---|---| | `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. |
Remarks Applies to this agent only.
```csharp signature public void PerformMediaAction( MediaAction action, Action handler ) ``` Performs a specific action on the current media surface. | Parameter | Type | Description | |---|---|---| | `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Applies to all agents currently in the scene.
### PlaySound
```csharp signature public PlayHandle PlaySound( SoundResource soundResource, PlaySettings playSettings ) ``` Play sound to direct output. | Parameter | Type | Description | |---|---|---| | `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. | | `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for all agents in this scene.
### PlaySoundAtPosition
```csharp signature public PlayHandle PlaySoundAtPosition( SoundResource soundResource, Sansar.Vector position, PlaySettings playSettings ) ``` Play sound at specified position. | Parameter | Type | Description | |---|---|---| | `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The absolute position. | | `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for all agents in this scene. By setting an absolute position, the location of this sound will be static. If you want the sound to move, you must play the sound on an audio component and move the audio component.
### PlayStream
```csharp signature public PlayHandle PlayStream( StreamChannel streamChannel, float loudness ) ``` Play web audio stream to direct output. | Parameter | Type | Description | |---|---|---| | `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. | | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for all agents in this scene.
### PlayStreamAtPosition
```csharp signature public PlayHandle PlayStreamAtPosition( StreamChannel streamChannel, Sansar.Vector position, float loudness ) ``` Play web audio stream at specified position. | Parameter | Type | Description | |---|---|---| | `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. | | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The absolute position. | | `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. | **Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.
Remarks Plays for all agents in this scene. By setting an absolute position, the location of this sound will be static. If you want the sound to move, you must play the sound on an audio component and move the audio component.
### RemoveFromSceneLibrary
Added in 47.1.1
```csharp signature public void RemoveFromSceneLibrary(ClusterResource resource) ``` Remove an item from the scene library for all users. | Parameter | Type | Description | |---|---|---| | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | The cluster resource to remove. |
### RemoveFromSceneLibraryForAgent
Added in 47.1.1
```csharp signature public void RemoveFromSceneLibraryForAgent( AgentPrivate agent, ClusterResource resource ) ``` Remove an item from the scene library for a specific agent. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The target agent. | | `resource` | [ClusterResource](/scripting/api/sansar.simulation/clusterresource) | The cluster resource to remove. |
### ResetScene
```csharp signature [Sansar.Script.Interface(Restricted=true)] public void ResetScene() ``` Restarts the Scene.
Remarks All clients will be momentarily disconnected.
### SetAllowFlight
New in 47.10.0
```csharp signature public void SetAllowFlight(bool allowFlight) ``` Sets the flight availability default for this scene instance. | Parameter | Type | Description | |---|---|---| | `allowFlight` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The default for agents without an explicit override. |
Remarks Existing overrides persist until cleared or the agent leaves. This instance-only setting is not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
New in 47.10.0
```csharp signature public void SetAllowFlight( bool allowFlight, Action handler ) ``` Sets the flight availability default for this scene instance. | Parameter | Type | Description | |---|---|---| | `allowFlight` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The default for agents without an explicit override. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Existing overrides persist until cleared or the agent leaves. This instance-only setting is not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
### SetColorLut
New in 47.10.0
```csharp signature public void SetColorLut(TextureResource lut) ``` Overrides the scene's color LUT for everyone in this scene instance. | Parameter | Type | Description | |---|---|---| | `lut` | [TextureResource](/scripting/api/sansar.simulation/textureresource) | The LUT texture to grade with, or null to go back to the LUT chosen in the scene settings. |
Remarks Every user without a per-agent override, see [`AgentPrivate.SetColorLut`](/scripting/api/sansar.simulation/agentprivate#setcolorlut-textureresource), is graded with this LUT in place of the scene settings LUT, including users who join later. A PostFX volume with its own LUT still takes over while a user's camera is inside it. This instance-only setting is not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
New in 47.10.0
```csharp signature public void SetColorLut( TextureResource lut, Action handler ) ``` Overrides the scene's color LUT for everyone in this scene instance. | Parameter | Type | Description | |---|---|---| | `lut` | [TextureResource](/scripting/api/sansar.simulation/textureresource) | The LUT texture to grade with, or null to go back to the LUT chosen in the scene settings. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Every user without a per-agent override, see [`AgentPrivate.SetColorLut`](/scripting/api/sansar.simulation/agentprivate#setcolorlut-textureresource), is graded with this LUT in place of the scene settings LUT, including users who join later. A PostFX volume with its own LUT still takes over while a user's camera is inside it. This instance-only setting is not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued client updates, not client acknowledgment.
### SetGravity
```csharp signature public void SetGravity(float scale) ``` Sets the scene's current gravity acceleration in m/s^2. | Parameter | Type | Description | |---|---|---| | `scale` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravity magnitude. |
Remarks Set to [`ScenePrivate.DefaultGravity`](/scripting/api/sansar.simulation/sceneprivate#defaultgravity) to return to the default. The valid range is from [`ScenePrivate.GravityMinimum`](/scripting/api/sansar.simulation/sceneprivate#gravityminimum) to [`ScenePrivate.GravityMaximum`](/scripting/api/sansar.simulation/sceneprivate#gravitymaximum). The direction cannot be changed.
Example ```csharp ScenePrivate.SetGravity(1.622f); // Set the scene to moon gravity ```
Deprecated
```csharp signature [System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong SetGravity( float scale, Sansar.Script.ScriptBase.OperationComplete handler ) ``` Sets the scene's current gravity acceleration in m/s^2. | Parameter | Type | Description | |---|---|---| | `scale` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravity magnitude. | | `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. | **Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id which can be passed to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) from a coroutine for synchronous behavior.
Remarks Set to [`ScenePrivate.DefaultGravity`](/scripting/api/sansar.simulation/sceneprivate#defaultgravity) to return to the default. The valid range is from [`ScenePrivate.GravityMinimum`](/scripting/api/sansar.simulation/sceneprivate#gravityminimum) to [`ScenePrivate.GravityMaximum`](/scripting/api/sansar.simulation/sceneprivate#gravitymaximum). The direction cannot be changed.
Example ```csharp ScenePrivate.SetGravity(1.622f); // Set the scene to moon gravity ```
```csharp signature public void SetGravity( float scale, Action handler ) ``` Sets the scene's current gravity acceleration in m/s^2. | Parameter | Type | Description | |---|---|---| | `scale` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravity magnitude. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Set to [`ScenePrivate.DefaultGravity`](/scripting/api/sansar.simulation/sceneprivate#defaultgravity) to return to the default. The valid range is from [`ScenePrivate.GravityMinimum`](/scripting/api/sansar.simulation/sceneprivate#gravityminimum) to [`ScenePrivate.GravityMaximum`](/scripting/api/sansar.simulation/sceneprivate#gravitymaximum). The direction cannot be changed.
Example ```csharp ScenePrivate.SetGravity(1.622f); // Set the scene to moon gravity ```
### SetMegaphone
```csharp signature public void SetMegaphone(AgentPrivate agent, bool enable) ``` Sets the megaphone status of the user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Agent to broadcast. | | `enable` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If true, user's voice will be heard by everyone in the scene. If false, user's voice will be spatialized normally. |
```csharp signature public void SetMegaphone( AgentPrivate agent, bool enable, Action handler ) ``` Sets the megaphone status of the user. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Agent to broadcast. | | `enable` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If true, user's voice will be heard by everyone in the scene. If false, user's voice will be spatialized normally. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### SetTimeOfDay
New in 47.10.0
```csharp signature public void SetTimeOfDay(float hours) ``` Sets the scene's current time of day in hours. | Parameter | Type | Description | |---|---|---| | `hours` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The time of day in hours, from 0 at midnight up to 24. 18.5 is half past six in the evening. |
Remarks Every user in the scene sees the change. With the mode [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle) the clock carries on running from the new time. The mode is left as it is: the time only takes effect while the mode is [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) or [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle), see [`ScenePrivate.SetTimeOfDayMode`](/scripting/api/sansar.simulation/sceneprivate#settimeofdaymode-timeofdaymode).
Example ```csharp ScenePrivate.SetTimeOfDay(18.5f); // Half past six in the evening ```
New in 47.10.0
```csharp signature public void SetTimeOfDay( float hours, Action handler ) ``` Sets the scene's current time of day in hours. | Parameter | Type | Description | |---|---|---| | `hours` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The time of day in hours, from 0 at midnight up to 24. 18.5 is half past six in the evening. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Every user in the scene sees the change. With the mode [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle) the clock carries on running from the new time. The mode is left as it is: the time only takes effect while the mode is [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) or [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle), see [`ScenePrivate.SetTimeOfDayMode`](/scripting/api/sansar.simulation/sceneprivate#settimeofdaymode-timeofdaymode).
Example ```csharp ScenePrivate.SetTimeOfDay(18.5f); // Half past six in the evening ```
### SetTimeOfDayMode
New in 47.10.0
```csharp signature public void SetTimeOfDayMode(TimeOfDayMode mode) ``` Sets how the scene's time of day runs. | Parameter | Type | Description | |---|---|---| | `mode` | [TimeOfDayMode](/scripting/api/sansar.simulation/timeofdaymode) | The new mode. |
Remarks Every user in the scene sees the change. The clock carries on from its current reading: switching from [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle) to [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) holds the sun where it is, and switching back sets it moving again from there. A scene built with the mode [`TimeOfDayMode.Off`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Off) has its sun baked into the lighting, so the bounced sunlight stays as built when a script turns the time of day on; build the scene with the mode [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) or [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle) for the full effect.
Example ```csharp ScenePrivate.SetTimeOfDayMode(TimeOfDayMode.Cycle); // Start the day and night cycle ```
New in 47.10.0
```csharp signature public void SetTimeOfDayMode( TimeOfDayMode mode, Action handler ) ``` Sets how the scene's time of day runs. | Parameter | Type | Description | |---|---|---| | `mode` | [TimeOfDayMode](/scripting/api/sansar.simulation/timeofdaymode) | The new mode. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Every user in the scene sees the change. The clock carries on from its current reading: switching from [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle) to [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) holds the sun where it is, and switching back sets it moving again from there. A scene built with the mode [`TimeOfDayMode.Off`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Off) has its sun baked into the lighting, so the bounced sunlight stays as built when a script turns the time of day on; build the scene with the mode [`TimeOfDayMode.Fixed`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Fixed) or [`TimeOfDayMode.Cycle`](/scripting/api/sansar.simulation/timeofdaymode#F:Sansar.Simulation.TimeOfDayMode.Cycle) for the full effect.
Example ```csharp ScenePrivate.SetTimeOfDayMode(TimeOfDayMode.Cycle); // Start the day and night cycle ```
### ShakeCameraAtPosition
New in 47.10.0
```csharp signature public CameraShakeHandle ShakeCameraAtPosition( Sansar.Vector position, float radius, CameraShakeSettings settings ) ``` Requests a shake for current players, attenuated by camera distance from a world position. | Parameter | Type | Description | |---|---|---| | `position` | [Sansar.Vector](/scripting/api/sansar/vector) | Stationary world-space source position in meters; W is ignored. | | `radius` | [float](https://learn.microsoft.com/dotnet/api/system.single) | World-space radius in meters, clamped to 0 through 1000; 0 is inert. | | `settings` | [CameraShakeSettings](/scripting/api/sansar.simulation/camerashakesettings) | Settings to snapshot, or null for fresh default settings. | **Returns:** [CameraShakeHandle](/scripting/api/sansar.simulation/camerashakehandle) — A non-null handle for this script's request, including inert requests.
Remarks Strength falls to zero at the radius using each player's unshaken viewing camera. Only players present at the call receive it. Direction remains in camera space. Player comfort settings and VR limits can reduce or suppress any shake. Leaving the world ends that player's shake. Only the rendered view changes; camera transforms, audio and targeting are unaffected. ```csharp title="CameraShakeExample.cs" /* This example is licensed under the Creative Commons Attribution 4.0 International License. * Copyright 2026 Sansar, Inc. https://creativecommons.org/licenses/by/4.0/ */ using System; using System.Collections.Generic; using Sansar; using Sansar.Script; using Sansar.Simulation; /// Demonstrates camera shake with chat commands on the default channel. /// Use /shake rumble, jitter, sway, impact, near, engine or stop. /// Engine toggles a continuous rumble for the sender; stop clears this script's shakes for everyone. /// An optional CameraComponent on this object fixes the view for current and future users. /// Player comfort settings and VR limits can reduce or suppress the motion. public class CameraShakeExample : SceneObjectScript { private CameraComponent camera; private readonly Dictionary engines = new Dictionary(); /// Sets up chat commands and the optional fixed camera. public override void Init() { ObjectPrivate.TryGetFirstComponent(out camera); ScenePrivate.User.Subscribe(User.AddUser, OnUserAdded); ScenePrivate.User.Subscribe(User.RemoveUser, OnUserRemoved); ScenePrivate.Chat.Subscribe(Chat.DefaultChannel, OnChat, true); // Script reloads also need to set up users who are already in the world. foreach (AgentPrivate agent in ScenePrivate.GetAgents()) { SetCamera(agent); } // The Debug local-source live test requires this marker from the real body. Log.Write("CameraShakeExample ready (real shake body): /shake rumble, jitter, sway, impact, near, engine, stop"); } private void SetCamera(AgentPrivate agent) { if (camera != null && agent != null && agent.IsValid) { agent.Client.SetActiveCamera(camera, ScriptCameraControlMode.AgentControlOnly); } } private void OnUserAdded(UserData data) { SetCamera(ScenePrivate.FindAgent(data.User)); } private void OnUserRemoved(UserData data) { // Leaving the world ends that player's shake; discard the old session's handle. engines.Remove(data.User); } private bool StopEngine(SessionId sessionId) { CameraShakeHandle engine; if (!engines.TryGetValue(sessionId, out engine)) { return false; } engine.Stop(0.25f); engines.Remove(sessionId); return true; } private void OnChat(ChatData data) { string[] words = data.Message.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (words.Length != 2 || !words[0].Equals("/shake", StringComparison.OrdinalIgnoreCase)) { return; } // SourceId identifies the sender, rather than the object running this script. AgentPrivate agent = ScenePrivate.FindAgent(data.SourceId); if (agent == null || !agent.IsValid) { return; } SessionId sessionId = agent.AgentInfo.SessionId; switch (words[1].ToLowerInvariant()) { case "rumble": // Presets are mutable: edit before starting. Starts snapshot the settings. CameraShakeSettings rumble = CameraShakeSettings.Earthquake(); rumble.Direction = new Vector(1, 0.5f, 0); agent.Client.ShakeCamera(rumble); break; case "jitter": agent.Client.ShakeCamera(new CameraShakeSettings { Pattern = CameraShakePattern.Jitter, Magnitude = 0.25f, Duration = 1.0f // Frequency 0 uses Jitter's default of 20 Hz. }); break; case "sway": // Long side-to-side motion for the fixed-camera pixel-displacement test. agent.Client.ShakeCamera(new CameraShakeSettings { Pattern = CameraShakePattern.Sway, Magnitude = 0.6f, Frequency = 2.0f, Duration = 6.0f, Direction = new Vector(1, 0, 0), FadeOut = 0.3f }); break; case "impact": // Landing: one downward kick. Duration 0 would still give just one kick. agent.Client.ShakeCamera(CameraShakeSettings.Impact(new Vector(0, -1, 0))); break; case "near": // Only players present now receive this explosion. Their camera distance // from this object's world position controls falloff to zero at 20 meters. ScenePrivate.ShakeCameraAtPosition(ObjectPrivate.Position, 20.0f, CameraShakeSettings.Explosion()); break; case "engine": // Send again to stop; separate sessions retain separate handles. if (!StopEngine(sessionId)) { engines[sessionId] = agent.Client.ShakeCamera(CameraShakeSettings.EngineRumble()); } break; case "stop": StopEngine(sessionId); // Both stop-all scopes affect only shakes requested by this script. agent.Client.StopAllCameraShakes(); ScenePrivate.StopAllCameraShakes(); engines.Clear(); break; } } } ```

Source: Examples/CameraShakeExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

### StopAllCameraShakes
New in 47.10.0
```csharp signature public void StopAllCameraShakes(float fadeOut) ``` Stops all shakes from the calling script on current players in this scene. | Parameter | Type | Description | |---|---|---| | `fadeOut` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Ending fade in seconds, clamped to 0 through 5; defaults to 0.1. |
Remarks 0 stops immediately. Shakes from other scripts are unaffected.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
### VoiceBroadcastStart
Deprecated
```csharp signature [System.Obsolete("Deprecated. use ScenePrivate.SetMegaphone(agent, true) instead", false)] public void VoiceBroadcastStart(AgentPrivate agent) ``` Start broadcasting agent's voice to the voice broadcast channel. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Agent to broadcast. |
Remarks Plays for all agents in this scene.
### VoiceBroadcastStop
Deprecated
```csharp signature [System.Obsolete("Deprecated. use ScenePrivate.SetMegaphone(agent, false) instead", false)] public void VoiceBroadcastStop(AgentPrivate agent) ``` Stop broadcasting agent's voice to voice broadcast channel. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | Agent to stop broadcasting. |
Remarks Stops for all agents in this scene.
### VoiceBroadcastStopAll
Deprecated
```csharp signature [System.Obsolete("Deprecated. use AgentPrivate.SetMegaphone(false) instead", false)] public void VoiceBroadcastStopAll() ``` Stop broadcasting all voices to voice broadcast channel.
Remarks Stops for all agents in this scene.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector) - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs) - [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [BroadcastUsers.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BroadcastUsers.cs) - `CameraShakeExample.cs` …and 56 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sceneprivate --- # ScenePrivate.CreateClusterData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The result of a create cluster request. ```csharp public class ScenePrivate.CreateClusterData : Sansar.Script.OperationCompleteEvent ``` ## Remarks See [`ScenePrivate.CreateCluster`](/scripting/api/sansar.simulation/sceneprivate#createcluster-clusterresource-vector-quaternion-vector-action). ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ClusterReference](#clusterreference) | | **Methods** | [ToString](#tostring) | ## Properties ### ClusterReference
```csharp signature public Cluster ClusterReference { get; } ``` The cluster object which was created as a result of the create call. **Value:** [Cluster](/scripting/api/sansar.simulation/cluster) — The cluster created or null if the call failed.
Remarks Will be null if Success is false.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) - [ScriptLibrary/Scene/Reaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Reaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sceneprivate.createclusterdata --- # ScenePrivate.CreateClusterHandler Kind: Delegate · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Delegate Namespace Sansar.Simulation
Handler for CreateCluster ```csharp [System.Obsolete("Deprecated. Use the Action<> overload", false)] public delegate void ScenePrivate.CreateClusterHandler( bool Success, string Message, Cluster ClusterReference ) ``` | Parameter | Type | Description | |---|---|---| | `Success` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Indicates if the operation was successful | | `Message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Additional information about the result, usually null or empty if Success is true. | | `ClusterReference` | [Cluster](/scripting/api/sansar.simulation/cluster) | The cluster object which was created as a result of the create call.Will be null if Success is false. | ## Remarks Will be null if Success is false.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sceneprivate.createclusterhandler --- # ScenePublic Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The Public Scene API, a more limited subset of [`ScenePrivate`](/scripting/api/sansar.simulation/sceneprivate). ```csharp public class ScenePublic : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [AgentCount](#agentcount) · [Chat](#chat) · [SceneInfo](#sceneinfo) · [User](#user) | | **Methods** | [FindAgent](#findagent) · [FindObject](#findobject) · [FindReflective](#findreflective) · [GetAgent](#getagent) · [GetAgents](#getagents) · [GetPortalCreatorName](#getportalcreatorname) · [GetPortalDescription](#getportaldescription) · [GetPortalUri](#getportaluri) · [ToString](#tostring) | ## Properties ### AgentCount
```csharp signature public uint AgentCount { get; } ``` The number of agents in the Scene. **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — Unsigned integer count of the number of agents in the Scene.
Remarks This number changes when agents join and part.
### Chat
```csharp signature public Chat Chat { get; } ``` Gets the Chat interface for this Scene **Value:** [Chat](/scripting/api/sansar.simulation/chat) — The Chat Api
### SceneInfo
```csharp signature public SceneInfo SceneInfo { get; } ``` Gets the SceneInfo for this Scene **Value:** [SceneInfo](/scripting/api/sansar.simulation/sceneinfo) — The full SceneInfo Api
### User
```csharp signature public User User { get; } ``` Gets the User interface for this Scene **Value:** [User](/scripting/api/sansar.simulation/user) — The User Api
## Methods ### FindAgent
```csharp signature public AgentPublic FindAgent(Sansar.Script.ObjectId objectId) ``` Looks up an AgentInfo associated with the given object id. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | The object to find. | **Returns:** [AgentPublic](/scripting/api/sansar.simulation/agentpublic) — The AgentInfo, or null if an agent cannot be found with that id.
Remarks Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
```csharp signature public AgentPublic FindAgent(Sansar.Script.SessionId sessionId) ``` Looks up an AgentInfo associated with the given session id, if they are in the scene. | Parameter | Type | Description | |---|---|---| | `sessionId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | The sessionId of the agent to find. | **Returns:** [AgentPublic](/scripting/api/sansar.simulation/agentpublic) — The AgentInfo, or null if an agent cannot be found with that id.
Remarks Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
```csharp signature public AgentPublic FindAgent(Guid personaId) ``` Looks up an AgentInfo associated with the given persona id, if they are in the scene. | Parameter | Type | Description | |---|---|---| | `personaId` | [Guid](https://learn.microsoft.com/dotnet/api/system.guid) | The personaId of the agent to find. | **Returns:** [AgentPublic](/scripting/api/sansar.simulation/agentpublic) — The agent, or null if an agent cannot be found with that id in the scene.
Remarks Agents may leave at any time. Attempting to use an Agent or AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.
### FindObject
Added in 32.0.0
```csharp signature public ObjectPublic FindObject(Sansar.Script.ObjectId objectId) ``` Looks up a Object associated with the given object id. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | The object to find. | **Returns:** [ObjectPublic](/scripting/api/sansar.simulation/objectpublic) — The ObjectPublic, or null if a Object cannot be found with that id.
### FindReflective
```csharp signature [Sansar.Script.NonReflective] public IEnumerable FindReflective( string name ) where TInterface : class ``` Looks up Reflective objects in the scene that match the interface type by class name. | Parameter | Type | Description | |---|---|---| | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The type name of the object's class to find. | **Type parameters:** `TInterface`: The interface type to find. **Returns:** [IEnumerable<TInterface>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumerable which contains all objects of the given type name that match the given interface.
Remarks The name given corresponds to the `Type.FullName` of the object. Multiple scripts may define unrelated types of the same name, but only registered objects that match the interface of TInterface will be returned.
### GetAgent
```csharp signature public AgentPublic GetAgent(uint index) ``` Get an [`AgentPublic`](/scripting/api/sansar.simulation/agentpublic) for a specific agent in the Scene. | Parameter | Type | Description | |---|---|---| | `index` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The index of the agent to get. | **Returns:** [AgentPublic](/scripting/api/sansar.simulation/agentpublic) — Returns null if the index is larger than the number of agents in the Scene.
Remarks Agents may appear at different indices as they join and part.
### GetAgents
```csharp signature public IEnumerable GetAgents() ``` Returns the current list of Agents in the Scene. **Returns:** [IEnumerable<AgentPublic>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — The current list of agents in the Scene
### GetPortalCreatorName
```csharp signature public string GetPortalCreatorName(Sansar.Script.ObjectId objectId) ``` The name of the user who created the specified portal. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks User who created the portal.
### GetPortalDescription
```csharp signature public string GetPortalDescription(Sansar.Script.ObjectId objectId) ``` Description for the specified portal. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks The description of the portal.
### GetPortalUri
```csharp signature public string GetPortalUri(Sansar.Script.ObjectId objectId) ``` URI destination for the specified portal. | Parameter | Type | Description | |---|---|---| | `objectId` | [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) | | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — String
Remarks The URI of the destination of the portal.
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs) - [ScriptLibrary/LibraryDebugger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/LibraryDebugger.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/scenepublic --- # ScriptCameraControlMode Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 37.0.0
Type of control mode to use for a script camera. ```csharp public enum ScriptCameraControlMode ``` ## Values | Value | Description | |---|---| | `AgentControlOnly` Added in 37.0.0 | The agent will move and respond to user input. | | `CameraControlOnly` Added in 37.0.0 | The camera will move and respond to user input (Rotation only). | | `FullControl` Added in 37.0.0 | Both agent and camera will respond to user input. | | `NoControl` Added in 37.0.0 | No control. Agent and camera will ignore user input. | ## Used in examples - `CameraShakeExample.cs` - [ScriptLibrary/Scene/Screenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Screenshot.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/scriptcameracontrolmode --- # SimpleScript Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.ScriptBase
Extend SimpleScript to create a script that can be used on content that is natively in the scene. This is the primary script type in Sansar. ```csharp [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", true)] public abstract class SimpleScript : Sansar.Script.ScriptBase ``` ## Remarks Use [`SimpleScript.ObjectPrivate`](/scripting/api/sansar.simulation/simplescript#objectprivate) to access the Object the script is on. Use [`SimpleScript.ScenePrivate`](/scripting/api/sansar.simulation/simplescript#sceneprivate) to access the Scene the object is in. Override [`SimpleScript.OnAddUser`](/scripting/api/sansar.simulation/simplescript#onadduser) to handle AddUser events. Override [`SimpleScript.OnRemoveUser`](/scripting/api/sansar.simulation/simplescript#onremoveuser) to handle AddUser events. ```csharp protected override OnRemoveUser(AgentInfo agent) { Log.Write($"{agent.Name} has left the region."); } ``` Override [`SimpleScript.OnTimer`](/scripting/api/sansar.simulation/simplescript#ontimer) to do something at regular intervals. ```csharp protected override OnTimer() { RigidBodyComponent?.SetPosition(ObjectPrivate?.InitialPosition); } ``` Override [`SimpleScript.OnChat`](/scripting/api/sansar.simulation/simplescript#onchat) to handle Chat events when users or scripts chat. ```csharp protected override OnChat(ChatData data) { AgentPrivate agent = ScenePrivate.FindAgent(data.SourceId); if (agent != null && agent.AgentInfo.AvatarUuid == ScenePrivate.SceneInfo.AvatarUuid)) { Log.Write($"Scene owner {agent.AgentInfo.Name} said {data.Message}"); } } ``` Override [`SimpleScript.OnCollision`](/scripting/api/sansar.simulation/simplescript#oncollision) to handle Collision events with the object this script is on. ```csharp protected override OnCollision(CollisionData data) { Log.Write($"Bumped {data.HitObject.ObjectId}"); } ``` Override [`SimpleScript.OnScriptEvent`](/scripting/api/sansar.simulation/simplescript#onscriptevent) to handle ScriptEvent events from other scripts. ```csharp protected override OnScriptEvent(AgentPrivate agent) { ISimpleScriptEvent simple = data.Data.As(); Log.Write($"Received message {data.Message} event with data {simple.Value}"); } ``` Override `SimpleScript.SimpleInit` for more advanced script initialization. ```csharp title="SimpleScriptExample.cs" /* (C) Linden Research, Inc. All Rights Reserved. */ using Sansar.Script; using Sansar.Simulation; // Updated from deprecated SimpleScript to SceneObjectScript public class SimpleScriptExample : SceneObjectScript { public override void Init() { // SceneObjectScript uses standard event subscription instead of RegisterSimpleScriptEvent Log.Write(LogLevel.Info, "SimpleScriptExample initialized"); } } ```

Source: Examples/SimpleScriptExample.cs in the Sansar 47.10.0 client ScriptApi snapshot.

## Example ```csharp protected override OnAddUser(AgentPrivate agent) { agent.SendChat($"Welcome to the {ScenePrivate.SceneInfo.ExperienceName} scene!"); } ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [SimpleScript](#simplescript) | | **Properties** | [ObjectPrivate](#objectprivate) · [RigidBodyComponent](#rigidbodycomponent) · [ScenePrivate](#sceneprivate) | | **Methods** | [GetSubscription](#getsubscription) · [Init](#init) · [OnAddUser](#onadduser) · [OnChat](#onchat) · [OnCollision](#oncollision) · [OnRemoveUser](#onremoveuser) · [OnScriptEvent](#onscriptevent) · [OnTimer](#ontimer) · [SimpleInit](#simpleinit) | ## Constructors ### SimpleScript
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected SimpleScript() ``` This constructor is called before any properties have been set. Override `SimpleScript.SimpleInit` to initialize the script after properties have been set and events setup.
## Properties ### ObjectPrivate
```csharp signature [Sansar.Script.NonReflective] public ObjectPrivate ObjectPrivate { protected get; set; } ``` The ObjectPrivate this script is attached to if it is attached to an object. **Value:** [ObjectPrivate](/scripting/api/sansar.simulation/objectprivate) — The scene object this script is attached to if it is attached to an object, null otherwise.
Remarks For AgentScripts this is the Agent's ObjectPrivate of their avatar.
### RigidBodyComponent
```csharp signature protected RigidBodyComponent RigidBodyComponent { get; } ``` The first RigidBodyComponent on ObjectPrivate **Value:** [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) — The first [`SimpleScript.RigidBodyComponent`](/scripting/api/sansar.simulation/simplescript#rigidbodycomponent) on the object this script is attached to.
Remarks This is a convenience for: ```csharp RigidBodyComponent rigidbody; if (ObjectPrivate != null && ObjectPrivate.TryGetFirstComponent(out rigidbody)) { // Do something with rigidbody } ```
### ScenePrivate
```csharp signature [Sansar.Script.NonReflective] public ScenePrivate ScenePrivate { protected get; set; } ``` The Scene API for the Scene this script is a part of if the script is attached to scene content. **Value:** [ScenePrivate](/scripting/api/sansar.simulation/sceneprivate) — The Scene API for this scene if this script was attached to scene content, null otherwise.
Remarks This value will be set before Init is called.
## Methods ### GetSubscription
```csharp signature protected Sansar.Script.IEventSubscription GetSubscription( string methodName ) ``` Get the IEventSubscription for any of the registered event subscription methods | Parameter | Type | Description | |---|---|---| | `methodName` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The n | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An IEventSubscription interface that can be used to unsubscribe from a registered event.
Example ```csharp GetSubscription("OnChat").Unsubscribe(); ```
### Init
```csharp signature [Sansar.Script.Api] public override sealed void Init() ``` Init() initializes all event subscriptions for the overridable methods in SimpleScript
### OnAddUser
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void OnAddUser(AgentPrivate agent) ``` Code in OnAddUser will run whenever a user enters the scene. | Parameter | Type | Description | |---|---|---| | `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The AgentPrivate for the user that has joined the scene. |
Remarks Override OnAddUser to handle events when a user enters the scene.
Example ```csharp protected override OnAddUser(AgentPrivate agent) { agent.SendChat($"Welcome to the {ScenePrivate.SceneInfo.ExperienceName} scene!"); } ```
### OnChat
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void OnChat(ChatData data) ``` Code in OnChat will run whenever chat is heard. | Parameter | Type | Description | |---|---|---| | `data` | [ChatData](/scripting/api/sansar.simulation/chatdata) | ChatData for the message. |
Remarks Defaults to all chat on the default channel. Use \[OnChatOptions\] to change the channel or limit the source of the chat.
### OnCollision
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void OnCollision(CollisionData data) ``` Receive events whenever the object this script is on collides with something or someone. | Parameter | Type | Description | |---|---|---| | `data` | [CollisionData](/scripting/api/sansar.simulation/collisiondata) | The CollisionData about the collision. |
Remarks By default receives events for every collision. Use [`SimpleScript.OnCollisionOptionsAttribute`](/scripting/api/sansar.simulation/simplescript.oncollisionoptionsattribute) to change which types of collision events will trigger OnCollision.
### OnRemoveUser
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void OnRemoveUser(AgentInfo data) ``` Code in OnRemoveUser will run whenever a user leaves the scene. | Parameter | Type | Description | |---|---|---| | `data` | [AgentInfo](/scripting/api/sansar.simulation/agentinfo) | UserData for the user that has left the scene. |
Remarks Override OnAddUser to handle events when a user enters the scene.
Example ```csharp // This event occurs when a user leaves the scene protected override void OnRemoveUser(AgentInfo info) { Log.Write($"{info.Name} has left the region."); } ```
### OnScriptEvent
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void OnScriptEvent( Sansar.Script.ScriptId sourceScriptId, object data ) ``` Receive events from other scripts. | Parameter | Type | Description | |---|---|---| | `sourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | The [`ScriptId`](/scripting/api/sansar.script/scriptid) of the script that sent the message | | `data` | [object](https://learn.microsoft.com/dotnet/api/system.object) | The data sent by another script, as an object. |
Remarks If EventName is not set then OnScriptEvent will receive events with the name of the script class. In the following example it will receive events named "MySimpleScript" ```csharp public class SimpleExample : SimpleScript { // Send events to this handler from other simple scripts with: PostScriptEvent("SimpleExample", myVector); protected override void OnScriptEvent(object eventData) { Vector newPos = eventData as Vector; if (newPos != null) AllPositions.Add(newPos); } } ``` To send events to a SimpleScript from a non-simple script, the non-simple script must build a Reflective class that contains a single public object field named Data like this: ```csharp class SimpleData : Reflective { public object Data; } ``` Then send the data like this: ```csharp PostScriptEvent("simpleeventname",new SimpleData {Data = position}); ```
Example ```csharp // Send events to this handler from other simple scripts with: PostScriptEvent("AddPosition", myVector); [OnScriptEventOptions(EventName="AddPosition")] protected override void OnScriptEvent(object eventData) { Vector newPos = eventData as Vector; if (newPos != null) AllPositions.Add(newPos); } ```
### OnTimer
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void OnTimer() ``` Code in OnTimer will run at regular intervals.
Remarks Defaults to one call per second. Change the rate with [`SimpleScript.OnTimerOptionsAttribute`](/scripting/api/sansar.simulation/simplescript.ontimeroptionsattribute)
Example ```csharp // Set OnTimer to happen once every minute. [OnTimerOptions(Rate=60)] protected override void OnTimer() ```
### SimpleInit
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected virtual void SimpleInit() ``` Override SimpleInit for script setup, such as subscribing to other events or
Remarks SimpleInit is run after events have been set up for overridden methods. Use it to set up more complex subscriptions or otherwise initialize the script.
## Used in examples - [SimpleScriptExample.cs](/scripting/examples/simple-script)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript --- # SimpleScript.OnAddUserOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

This type is documented in the client, but it is not in the reference assemblies that scripts compile against. Scripts may not be able to use it.

Use to create additional OnAddUser subscriptions ```csharp protected class SimpleScript.OnAddUserOptionsAttribute : SimpleScript.SimpleScriptOptionsAttribute ``` ## Remarks This is provided for consistency only. There are no options that can be set and multiple subscriptions would receive all the same events. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OnAddUserOptionsAttribute](#onadduseroptionsattribute) | ## Constructors ### OnAddUserOptionsAttribute
```csharp signature public SimpleScript.OnAddUserOptionsAttribute() ``` Default Constructor

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.onadduseroptionsattribute --- # SimpleScript.OnChatOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Set options for OnChat() overrides, or use to create more simple chat handlers. ```csharp [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)] [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected class SimpleScript.OnChatOptionsAttribute : SimpleScript.SimpleScriptOptionsAttribute ``` ## Remarks This attribute is optional when overriding OnChat which by default will respond to all chat on the default channel (Chat.DefaultChannel) and all sources. Add this attribute to any method that matches Action<ChatData> to create extra chat event subscriptions. ```csharp [OnChatOptions(Channel=5)] void ChatFrom5(ChatData data) { // chat from channel 5. } void OnChat(ChatData data) { // chat from the default channel (0) } ``` ## Example ```csharp // Only listen for chat on Channel 10 from scripts. [OnChatOptions(Channel=10, Source="script")] protected override OnChat(ChatData data) ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OnChatOptionsAttribute](#onchatoptionsattribute) | | **Properties** | [Channel](#channel) · [Source](#source) | ## Constructors ### OnChatOptionsAttribute
```csharp signature public SimpleScript.OnChatOptionsAttribute() ``` Set options for OnChat events
## Properties ### Channel
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] public int Channel { get; set; } ``` Specify a specific channel to listen for messages on. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — The channel to listen for chat on.
Remarks By default listens for chat on Chat.DefaultChannel (0).
Example ```csharp // Only listen for chat on Channel 10. [OnChatOptions(Channel=10)] protected override OnChat(ChatData data) ```
### Source
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] public string Source { get; set; } ``` string source of the chat: system, user or script. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The source chat to listen for: "script", "user" or "system"
Remarks Restricts which chat messages will trigger OnChat. \[OnChatOptions(Source="user")\] will only run OnChat for chat from users, while "script" will respond to other script messages, and "system" will only respond to system messages.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.onchatoptionsattribute --- # SimpleScript.OnCollisionOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Set options for OnCollision events, or use to create more simple collision handlers. ```csharp [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false)] [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected class SimpleScript.OnCollisionOptionsAttribute : SimpleScript.SimpleScriptOptionsAttribute ``` ## Remarks This attribute is optional when overriding OnCollision which by default will respond to [`CollisionEventType.AllCollisions`](/scripting/api/sansar.simulation/collisioneventtype#F:Sansar.Simulation.CollisionEventType.AllCollisions). Add this attribute to any method that matches Action<CollisionData> to create extra collision event subscriptions. ```csharp [OnCollisionOptions(EventType=CollisionEventType.CharacterContact)] void CharacterCollisionsOnly(CollisionData data) { // character collisions. } void OnCollision(CollisionData data) { // all collisions (including character) } ``` ## Example ```csharp // Only receive events for collisions with users [OnCollisionOptions(EventType=CollisionEventType.CharacterContact] protected override OnCollision(CollisionData data) ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OnCollisionOptionsAttribute](#oncollisionoptionsattribute) | | **Properties** | [EventType](#eventtype) | ## Constructors ### OnCollisionOptionsAttribute
```csharp signature public SimpleScript.OnCollisionOptionsAttribute() ``` Set options for OnCollision events.
## Properties ### EventType
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] public CollisionEventType EventType { get; set; } ``` Set the event type for the types of collisions to get events for. **Value:** [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) — The type of collision events to subscribe to.
Example ```csharp // Only receive events for collisions with users [OnCollisionOptions(EventType=CollisionEventType.CharacterContact] protected override OnCollision(CollisionData data) ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.oncollisionoptionsattribute --- # SimpleScript.OnRemoveUserOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

This type is documented in the client, but it is not in the reference assemblies that scripts compile against. Scripts may not be able to use it.

Use to create additional OnRemoveUser subscriptions ```csharp protected class SimpleScript.OnRemoveUserOptionsAttribute : SimpleScript.SimpleScriptOptionsAttribute ``` ## Remarks This is provided for consistency only. There are no options that can be set and multiple subscriptions would receive all the same events. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OnRemoveUserOptionsAttribute](#onremoveuseroptionsattribute) | ## Constructors ### OnRemoveUserOptionsAttribute
```csharp signature public SimpleScript.OnRemoveUserOptionsAttribute() ``` Default Constructor

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.onremoveuseroptionsattribute --- # SimpleScript.OnScriptEventOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Set options for OnScriptEvent events. ```csharp [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false)] [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected class SimpleScript.OnScriptEventOptionsAttribute : SimpleScript.SimpleScriptOptionsAttribute ``` ## Remarks If EventName is not set then OnScriptEvent will receive events with the name of the script class. ## Example ```csharp // Send events to this handler from other simple scripts with: PostScriptEvent("AddPosition", myVector); [OnScriptEventOptions(EventName="AddPosition")] protected override void OnScriptEvent(object eventData) { Vector newPos = eventData as Vector; if (newPos != null) AllPositions.Add(newPos); } ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OnScriptEventOptionsAttribute](#onscripteventoptionsattribute) | | **Properties** | [Message](#message) | ## Constructors ### OnScriptEventOptionsAttribute
```csharp signature public SimpleScript.OnScriptEventOptionsAttribute() ```
## Properties ### Message
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] public string Message { get; set; } ``` Set the name of the script event to listen for. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The name of the script event message to subscribe to.
Remarks If Message is not set then OnScriptEvent will receive events with the name of the script class. In the following example it will receive events named "MySimpleScript" ```csharp // Listen for script events named "MyEvent" public class MySimpleScript : SimpleScript { protected override void OnScriptEvent(ScriptEventData data) { // Will get script events named "MySimpleScript" } } ```
Example ```csharp // Listen for script events "MyEvent" [OnScriptEventOptions(Message="MyEvent")] protected override void OnScriptEvent(ScriptEventData data) ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.onscripteventoptionsattribute --- # SimpleScript.OnTimerOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Set options for OnTimer() overrides, or use to create more simple timers. ```csharp [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false)] [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] protected class SimpleScript.OnTimerOptionsAttribute : SimpleScript.SimpleScriptOptionsAttribute ``` ## Remarks This attribute is optional when overriding OnTimer which by default will run once per second. Add this attribute to any method that matches Action<> to create extra timers. ```csharp [OnTimerOptions(Rate=5)] void TimerEvery5() { // run every 5 seconds } void OnTimer() { // run every 1 second } ``` ## Example ```csharp // Run this timer every 5 seconds [OnTimerOptions(Rate=5)] protected override OnTimer() ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [OnTimerOptionsAttribute](#ontimeroptionsattribute) | | **Fields** | [MinimumRate](#minimumrate) | | **Properties** | [Rate](#rate) | ## Constructors ### OnTimerOptionsAttribute
```csharp signature public SimpleScript.OnTimerOptionsAttribute() ```
## Fields ### MinimumRate
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] public readonly double MinimumRate ``` Minimum value for Rate is 0.025, which is 40 times per second.
## Properties ### Rate
Deprecated
```csharp signature [System.Obsolete("SimpleScript is deprecated and will not receive new features. Please use SceneObjectScript or ObjectScript.", false)] public double Rate { get; set; } ``` Set the rate in seconds between events. **Value:** [double](https://learn.microsoft.com/dotnet/api/system.double) — The value in seconds between OnTimer events.
Remarks A Rate of 1 would call OnTimer once every second, 0.1 would call OnTimer 10 times every second, and 10 would call OnTimer once every 10 seconds. Minimum value for Rate is 0.025, which is 40 times per second.
Example ```csharp // Set OnTimer to happen every 0.2 seconds. [OnTimerOptions(Rate=0.2)] protected override void OnTimer(Int64 frame) ```

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.ontimeroptionsattribute --- # SimpleScript.SimpleScriptOptionsAttribute Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Attribute
Internal Use Only ```csharp protected abstract class SimpleScript.SimpleScriptOptionsAttribute : Attribute ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [SimpleScriptOptionsAttribute](#simplescriptoptionsattribute) | ## Constructors ### SimpleScriptOptionsAttribute
```csharp signature public SimpleScript.SimpleScriptOptionsAttribute() ``` Default Constructor

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/simplescript.simplescriptoptionsattribute --- # SitEventType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
Type of sit event. ```csharp [System.Flags] public enum SitEventType ``` ## Values | Value | Description | |---|---| | `All` | All sit event types. | | `End` | Player avatar stands after sitting on object. | | `Start` | Player avatar starts sitting on object | ## Used in examples - [ScriptLibrary/Scene/SitStand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/SitStand.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/siteventtype --- # SitObjectData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Handler for agent sit events. ```csharp public class SitObjectData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ComponentId](#componentid) · [ObjectId](#objectid) · [SitObjectEvent](#sitobjectevent) · [SitObjectInfo](#sitobjectinfo) | | **Methods** | [ToString](#tostring) | ## Properties ### ComponentId
```csharp signature public Sansar.Script.ComponentId ComponentId { get; } ``` The ComponentId of the object the agent is sitting on [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent).
### ObjectId
```csharp signature public Sansar.Script.ObjectId ObjectId { get; } ``` The ObjectId of the object the agent is sitting on
### SitObjectEvent
```csharp signature public SitEventType SitObjectEvent { get; } ``` The type of sit event which occurred.
### SitObjectInfo
```csharp signature public SitObjectInfo SitObjectInfo { get; } ``` information about the object the agent is sitting on
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Scene/SitStand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/SitStand.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sitobjectdata --- # SitObjectInfo Kind: Struct · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Struct Namespace Sansar.Simulation
Information about if an agent is sitting on this SitObjectInfo. ```csharp public struct SitObjectInfo ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [ExitForward](#exitforward) · [ExitPosition](#exitposition) · [IsOccupied](#isoccupied) · [LocalForward](#localforward) · [LocalPosition](#localposition) · [SessionId](#sessionid) | ## Fields ### ExitForward
```csharp signature public Sansar.Vector ExitForward ``` The local space forward direction of the exit point from this sit point.
### ExitPosition
```csharp signature public Sansar.Vector ExitPosition ``` The local space exit point where an agent will be when they stand up from this sit point.
### IsOccupied
```csharp signature public bool IsOccupied ``` Is an agent sitting on this object
### LocalForward
```csharp signature public Sansar.Vector LocalForward ``` The local space forward direction for the object sit point.
### LocalPosition
```csharp signature public Sansar.Vector LocalPosition ``` The local space point on the object where an agent would sit.
### SessionId
```csharp signature public Sansar.Script.SessionId SessionId ``` The SessionId of the agent that is sitting on the object.
## Used in examples - [ScriptLibrary/Scene/SitStand.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/SitStand.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/sitobjectinfo --- # SoundResource Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The SoundResource class represents a sound that could be added to the scene. ```csharp public class SoundResource : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [GetDurationInSeconds](#getdurationinseconds) · [GetName](#getname) | ## Methods ### GetDurationInSeconds
```csharp signature public float GetDurationInSeconds() ``` Returns the duration in seconds. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single)
### GetName
```csharp signature public string GetName() ``` Returns the name of the resource. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string)
## Used in examples - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs) - [ScriptLibrary/Scene/Sound.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Sound.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/soundresource --- # StreamChannel Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation
For playing a stream from the scene. ```csharp public enum StreamChannel ``` ## Values | Value | Description | |---|---| | `AudioChannel` | Audio Stream 1. See Scene Settings in Layout Editor for the URL. | | `MediaChannel` | The Media Surface. See Scene Settings in Layout Editor for the URL. | | `MediaChannel2` Added in 46.5.0 | Media Surface 2. See Scene Settings in Layout Editor for the URL. | | `MediaChannel3` Added in 46.5.0 | Media Surface 3. See Scene Settings in Layout Editor for the URL. | | `MediaChannel4` Added in 46.5.0 | Media Surface 4. See Scene Settings in Layout Editor for the URL. | ## Used in examples - [ScriptLibrary/Scene/AudioStream.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/AudioStream.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/streamchannel --- # TextureResource Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface New in 47.10.0
The TextureResource class represents a texture from the inventory, such as a color LUT. See [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). ```csharp public class TextureResource : Sansar.Script.InstanceInterface ``` ## Remarks Set as a script property, the texture is chosen from the inventory in the scene editor. The server never loads the texture data; only the clients that apply it do. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ResourceId](#resourceid) New in 47.10.0 | | **Methods** | [ToString](#tostring) New in 47.10.0 | ## Properties ### ResourceId
New in 47.10.0
```csharp signature public string ResourceId { get; } ``` Returns the resource Id of this TextureResource.
## Methods ### ToString
New in 47.10.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - `ColorLutExample.cs`

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/textureresource --- # ThumbnailedClusterResource Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 43.2.1
The ThumbnailedClusterResource class represents a cluster that has properties to be shown in the UI. ```csharp public class ThumbnailedClusterResource : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [ClusterResource](#clusterresource) | | **Methods** | [ToString](#tostring) | ## Properties ### ClusterResource
Added in 43.2.1
```csharp signature public ClusterResource ClusterResource { get; } ``` Returns the underlying cluster.
## Methods ### ToString
Added in 43.2.1
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ReactionsExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ReactionsExample.cs) - [ScriptLibrary/Scene/Reaction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Reaction.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/thumbnailedclusterresource --- # TimeOfDayMode Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation New in 47.10.0
How a scene's time of day runs. ```csharp public enum TimeOfDayMode ``` ## Remarks See [`ScenePrivate.GetTimeOfDayMode`](/scripting/api/sansar.simulation/sceneprivate#gettimeofdaymode) and [`ScenePrivate.SetTimeOfDayMode`](/scripting/api/sansar.simulation/sceneprivate#settimeofdaymode-timeofdaymode). ## Values | Value | Description | |---|---| | `Cycle` New in 47.10.0 | The clock runs. A full day takes the day length chosen in the scene settings. | | `Fixed` New in 47.10.0 | The sun is held at the set time of day. | | `Off` New in 47.10.0 | The scene as authored. The sun stays where its light points and the time of day has no effect. | ## Used in examples - `TimeOfDayExample.cs`

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/timeofdaymode --- # TutorialHint Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 32.0.0
Tutorial hint types. ```csharp public enum TutorialHint ``` ## Values | Value | Description | |---|---| | `BackpackHint` Added in 40.0.0 | Open Backpack hint. | | `ClearHint` Added in 32.0.0 | No Tutorial hint. | | `CodexHint` Added in 36.8.0 | Open Codex hint. | | `DropStickyHint` Added in 32.0.0 | Drop sticky held object hint. | | `EmoteHint` Added in 40.0.0 | Open Emote hint. | | `GrabHint` Added in 32.0.0 | Grab Object input hint. | | `InteractionHint` Added in 32.0.0 | Interaction hint. | | `MicrophoneToggleHint` Added in 32.0.0 | Enable/Disable microphone menu hint. | | `PrimePortalHint` Added in 36.8.0 | Use Prime Portal hint. | | `StoreHint` Added in 40.4.0 | Open Store hint. | | `StyleAvatarHint` Added in 32.0.0 | Go to Avatar customization menu hint. | | `TeleportHint` Added in 32.0.0 | Teleport input hint. | | `WalkHint` Added in 32.0.0 | Walk input hint. | | `WalkRunToggleHint` Added in 32.0.0 | Walk/Run toggle input hint. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/tutorialhint --- # TwitchData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData Added in 38.1.0
Twitch events are generated in response to twitch stream interaction. ```csharp public class TwitchData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [EventType](#eventtype) · [Intensity](#intensity) · [SessionId](#sessionid) | | **Methods** | [ToString](#tostring) | ## Properties ### EventType
Added in 38.1.0
```csharp signature public TwitchEventType EventType { get; } ``` The event which occurred
### Intensity
Added in 38.1.0
```csharp signature public float Intensity { get; } ``` The intensity of the event. Range is (0 ..1\]
### SessionId
Added in 38.1.0
```csharp signature public Sansar.Script.SessionId SessionId { get; } ``` The client which generated the event.
## Methods ### ToString
Added in 38.1.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [TwitchEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/TwitchEventExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/twitchdata --- # TwitchEventType Kind: Enum · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Enum Namespace Sansar.Simulation Added in 38.1.0
Enumerates the types of twitch events that scripts can subscribe to. ```csharp [System.Flags] public enum TwitchEventType ``` ## Values | Value | Description | |---|---| | `AllEvents` Added in 38.1.0 | Viewer Love event | | `ViewerLove` Added in 38.1.0 | Viewer Love event | ## Used in examples - [TwitchEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/TwitchEventExample.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/twitcheventtype --- # UI Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 Manages the client UI. ```csharp public class UI : Sansar.Script.InstanceInterface ``` ## Remarks The client UI can be used to send messages that appear in a client UI. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [HintText](#hinttext) · [Menu](#menu) · [ModalDialog](#modaldialog) | | **Methods** | [AddProgressBar](#addprogressbar) · [AddScoreBoard](#addscoreboard) · [CloseDetailView](#closedetailview) · [GetProgressBars](#getprogressbars) · [GetScoreBoards](#getscoreboards) · [OpenDetailViewForUri](#opendetailviewforuri) · [ToString](#tostring) | ## Properties ### HintText
Added in 34.0.0
```csharp signature public string HintText { get; set; } ``` The hint text being shown to the user. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The hint text.
Remarks Limited to 80 characters.
### Menu
Added in 47.1.1
```csharp signature public UIMenu Menu { get; } ``` The scriptable screen menu for this client. **Value:** [UIMenu](/scripting/api/sansar.simulation/uimenu) — The reusable [`UIMenu`](/scripting/api/sansar.simulation/uimenu) instance.
### ModalDialog
```csharp signature public ModalDialog ModalDialog { get; } ``` The [`ModalDialog`](/scripting/api/sansar.simulation/modaldialog) for this UI. **Value:** [ModalDialog](/scripting/api/sansar.simulation/modaldialog) — The [`ModalDialog`](/scripting/api/sansar.simulation/modaldialog) for this UI.
Remarks See [`ModalDialog.Show`](/scripting/api/sansar.simulation/modaldialog#show-string-string-string-operationcomplete) for usage details.
## Methods ### AddProgressBar
Added in 33.0.0
```csharp signature public UIProgressBar AddProgressBar() ``` Add a [`UIProgressBar`](/scripting/api/sansar.simulation/uiprogressbar) to the ui. **Returns:** [UIProgressBar](/scripting/api/sansar.simulation/uiprogressbar) — The newly created [`UIProgressBar`](/scripting/api/sansar.simulation/uiprogressbar).
Remarks Currently only one progress bar can be added to the screen, if one has already been added, cancel it before adding a new one
### AddScoreBoard
Added in 45.0.4
```csharp signature public UIScoreBoard AddScoreBoard() ``` Add a [`UIScoreBoard`](/scripting/api/sansar.simulation/uiscoreboard) to the ui. **Returns:** [UIScoreBoard](/scripting/api/sansar.simulation/uiscoreboard) — The newly created [`UIScoreBoard`](/scripting/api/sansar.simulation/uiscoreboard).
Remarks Currently only one score board can be added to the screen.
### CloseDetailView
Added in 36.7.0
```csharp signature public void CloseDetailView() ``` Close any open world detail view.
### GetProgressBars
Added in 33.0.0
```csharp signature public IEnumerable GetProgressBars() ``` Gets the progress bars that have been added to the ui. **Returns:** [IEnumerable<UIProgressBar>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumarable collection of progress bar objects.
### GetScoreBoards
Added in 45.0.4
```csharp signature public IEnumerable GetScoreBoards() ``` Gets the score board that have been added to the ui. **Returns:** [IEnumerable<UIScoreBoard>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — An IEnumarable collection of score board objects.
### OpenDetailViewForUri
Added in 36.7.0
```csharp signature public void OpenDetailViewForUri(string sansarUri) ``` Opens a window showing details for a sansar uri, giving the a user an option to travel to that location. | Parameter | Type | Description | |---|---|---| | `sansarUri` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The location to open the detail panel for. |
### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/ui --- # UIMenu Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 47.1.1
Manages a clickable on-screen menu UI element. ```csharp public class UIMenu : Sansar.Script.InstanceInterface ``` ## Remarks Use this for text-heavy game menus, voting prompts, settings panels, or non-interactive leaderboards. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [cMaxItems](#cmaxitems) | | **Properties** | [Footer](#footer) · [SelectedIndex](#selectedindex) · [SelectedItem](#selecteditem) · [Subtitle](#subtitle) · [Title](#title) | | **Methods** | [Hide](#hide) · [Show](#show) · [ShowStyled](#showstyled) · [ToString](#tostring) | ## Fields ### cMaxItems
Added in 47.1.1
```csharp signature public static readonly int cMaxItems ``` Maximum number of menu items allowed per menu.
## Properties ### Footer
Added in 47.1.1
```csharp signature public string Footer { get; } ``` The current menu footer.
### SelectedIndex
Added in 47.1.1
```csharp signature public int SelectedIndex { get; } ``` The zero-based index of the last selected menu item, or -1 if none selected.
### SelectedItem
Added in 47.1.1
```csharp signature public string SelectedItem { get; } ``` The label of the last selected menu item.
### Subtitle
Added in 47.1.1
```csharp signature public string Subtitle { get; } ``` The current menu subtitle.
### Title
Added in 47.1.1
```csharp signature public string Title { get; } ``` The current menu title.
## Methods ### Hide
Added in 47.1.1
```csharp signature public void Hide() ``` Hide the current menu.
### Show
Added in 47.1.1
```csharp signature public void Show( string title, string subtitle, string footer, object[] items, float positionXPercent, float positionYPercent, bool interactive, bool closeOnSelection ) ``` Show a scriptable menu using the default client theme. | Parameter | Type | Description | |---|---|---| | `title` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Primary header text. | | `subtitle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional secondary header text. | | `footer` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional footer or hint text. | | `items` | [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] | List of rows to display. | | `positionXPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Horizontal menu center position in percent of screen width. | | `positionYPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Vertical menu center position in percent of screen height. | | `interactive` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If false, the menu becomes a click-through display panel. | | `closeOnSelection` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If true, the menu closes on the first click. |
Remarks Call this with WaitFor to block until the first menu row is clicked.
Added in 47.1.1
```csharp signature public void Show( string title, string subtitle, string footer, object[] items, float positionXPercent, float positionYPercent, bool interactive, bool closeOnSelection, Action handler ) ``` Show a scriptable menu using the default client theme. | Parameter | Type | Description | |---|---|---| | `title` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Primary header text. | | `subtitle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional secondary header text. | | `footer` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional footer or hint text. | | `items` | [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] | List of rows to display. | | `positionXPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Horizontal menu center position in percent of screen width. | | `positionYPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Vertical menu center position in percent of screen height. | | `interactive` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If false, the menu becomes a click-through display panel. | | `closeOnSelection` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If true, the menu closes on the first click. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Call this with WaitFor to block until the first menu row is clicked.
### ShowStyled
Added in 47.1.1
```csharp signature public void ShowStyled( string title, string subtitle, string footer, object[] items, float positionXPercent, float positionYPercent, bool interactive, bool closeOnSelection, Sansar.Color panelBackgroundColor, Sansar.Color panelBorderColor, Sansar.Color titleColor, Sansar.Color textColor, Sansar.Color accentColor ) ``` Show a scriptable menu with caller-provided colors. | Parameter | Type | Description | |---|---|---| | `title` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Primary header text. | | `subtitle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional secondary header text. | | `footer` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional footer or hint text. | | `items` | [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] | List of rows to display. | | `positionXPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Horizontal menu center position in percent of screen width. | | `positionYPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Vertical menu center position in percent of screen height. | | `interactive` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If false, the menu becomes a click-through display panel. | | `closeOnSelection` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If true, the menu closes on the first click. | | `panelBackgroundColor` | [Sansar.Color](/scripting/api/sansar/color) | Background color for the menu body. | | `panelBorderColor` | [Sansar.Color](/scripting/api/sansar/color) | Border color for the menu frame. | | `titleColor` | [Sansar.Color](/scripting/api/sansar/color) | Title text color. | | `textColor` | [Sansar.Color](/scripting/api/sansar/color) | Body and row text color. | | `accentColor` | [Sansar.Color](/scripting/api/sansar/color) | Accent color used for hover and separators. |
Remarks Call this with WaitFor to block until the first menu row is clicked.
Added in 47.1.1
```csharp signature public void ShowStyled( string title, string subtitle, string footer, object[] items, float positionXPercent, float positionYPercent, bool interactive, bool closeOnSelection, Sansar.Color panelBackgroundColor, Sansar.Color panelBorderColor, Sansar.Color titleColor, Sansar.Color textColor, Sansar.Color accentColor, Action handler ) ``` Show a scriptable menu with caller-provided colors. | Parameter | Type | Description | |---|---|---| | `title` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Primary header text. | | `subtitle` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional secondary header text. | | `footer` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Optional footer or hint text. | | `items` | [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] | List of rows to display. | | `positionXPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Horizontal menu center position in percent of screen width. | | `positionYPercent` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Vertical menu center position in percent of screen height. | | `interactive` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If false, the menu becomes a click-through display panel. | | `closeOnSelection` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If true, the menu closes on the first click. | | `panelBackgroundColor` | [Sansar.Color](/scripting/api/sansar/color) | Background color for the menu body. | | `panelBorderColor` | [Sansar.Color](/scripting/api/sansar/color) | Border color for the menu frame. | | `titleColor` | [Sansar.Color](/scripting/api/sansar/color) | Title text color. | | `textColor` | [Sansar.Color](/scripting/api/sansar/color) | Body and row text color. | | `accentColor` | [Sansar.Color](/scripting/api/sansar/color) | Accent color used for hover and separators. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Call this with WaitFor to block until the first menu row is clicked.
### ToString
Added in 47.1.1
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/uimenu --- # UIProgressBar Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 33.0.0
Manages a progress bar UI element. ```csharp public class UIProgressBar : Sansar.Script.InstanceInterface ``` ## Remarks Used for progress bars on interactions. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Id](#id) · [Label](#label) | | **Methods** | [Cancel](#cancel) · [Start](#start) · [ToString](#tostring) | ## Properties ### Id
Added in 36.3.0
```csharp signature public int Id { get; } ``` The bar's ID.
Remarks This ID is only unique to this user's particular session. It is not globally unique.
### Label
Added in 36.3.0
```csharp signature public string Label { get; } ``` The bar's current Label
## Methods ### Cancel
Added in 33.0.0
```csharp signature public void Cancel() ``` Remove a progress bar.
### Start
Added in 33.0.0
```csharp signature public void Start( string label, float durationSeconds, Sansar.Color color ) ``` Start a progress bar. | Parameter | Type | Description | |---|---|---| | `label` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the bar. | | `durationSeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Duration. | | `color` | [Sansar.Color](/scripting/api/sansar/color) | Color. |
Remarks Call this with [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-action-t-t-t) in a coroutine to block until the event is generated.
Added in 33.0.0
```csharp signature public void Start( string label, float durationSeconds, Sansar.Color color, Action handler ) ``` Start a progress bar. | Parameter | Type | Description | |---|---|---| | `label` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Text of the bar. | | `durationSeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Duration. | | `color` | [Sansar.Color](/scripting/api/sansar/color) | Color. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
Remarks Call this with [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor-action-t-t-t) in a coroutine to block until the event is generated.
### ToString
Added in 36.3.0
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Scene/ProgressBar.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/ProgressBar.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/uiprogressbar --- # UIScoreBoard Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 45.0.4
Manages a score board HUD element. ```csharp public class UIScoreBoard : Sansar.Script.InstanceInterface ``` ## Remarks Used for competative games. ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Id](#id) · [Score0](#score0) · [Score1](#score1) | | **Methods** | [Paint](#paint) · [ToString](#tostring) | ## Properties ### Id
Added in 45.0.4
```csharp signature public int Id { get; } ``` The board's ID.
Remarks This ID is only unique to this user's particular session. It is not globally unique.
### Score0
Added in 45.0.4
```csharp signature public string Score0 { get; } ``` The board's left score
### Score1
Added in 45.0.4
```csharp signature public string Score1 { get; } ``` The board's right score
## Methods ### Paint
Added in 45.0.4
```csharp signature public void Paint( string score0, string score1, Sansar.Color colorScoreFg0, Sansar.Color colorScoreFg1, Sansar.Color colorScoreBg0, Sansar.Color colorScoreBg1, Sansar.Color colorFg, Sansar.Color colorBg ) ``` Paint the score board | Parameter | Type | Description | |---|---|---| | `score0` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Score of the left team. | | `score1` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Score of the right team. | | `colorScoreFg0` | [Sansar.Color](/scripting/api/sansar/color) | The left score's text color. | | `colorScoreFg1` | [Sansar.Color](/scripting/api/sansar/color) | The right score's text color. | | `colorScoreBg0` | [Sansar.Color](/scripting/api/sansar/color) | The left score's background color. | | `colorScoreBg1` | [Sansar.Color](/scripting/api/sansar/color) | The right score's background color. | | `colorFg` | [Sansar.Color](/scripting/api/sansar/color) | The board's foreground color. | | `colorBg` | [Sansar.Color](/scripting/api/sansar/color) | The board's background color. |
Added in 45.0.4
```csharp signature public void Paint( string score0, string score1, Sansar.Color colorScoreFg0, Sansar.Color colorScoreFg1, Sansar.Color colorScoreBg0, Sansar.Color colorScoreBg1, Sansar.Color colorFg, Sansar.Color colorBg, Action handler ) ``` Paint the score board | Parameter | Type | Description | |---|---|---| | `score0` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Score of the left team. | | `score1` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Score of the right team. | | `colorScoreFg0` | [Sansar.Color](/scripting/api/sansar/color) | The left score's text color. | | `colorScoreFg1` | [Sansar.Color](/scripting/api/sansar/color) | The right score's text color. | | `colorScoreBg0` | [Sansar.Color](/scripting/api/sansar/color) | The left score's background color. | | `colorScoreBg1` | [Sansar.Color](/scripting/api/sansar/color) | The right score's background color. | | `colorFg` | [Sansar.Color](/scripting/api/sansar/color) | The board's foreground color. | | `colorBg` | [Sansar.Color](/scripting/api/sansar/color) | The board's background color. | | `handler` | [Action<Sansar.Script.OperationCompleteEvent>](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |
### ToString
Added in 45.0.4
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/uiscoreboard --- # User Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0 The User class handles interactions user logins and logoffs. ```csharp public class User : Sansar.Script.InstanceInterface ``` ## Members at a glance | Kind | Members | |---|---| | **Fields** | [AddUser](#adduser) · [RemoveUser](#removeuser) | | **Methods** | [Subscribe](#subscribe) | ## Fields ### AddUser
```csharp signature public static readonly string AddUser ``` For subscribing to events for users entering the scene
### RemoveUser
```csharp signature public static readonly string RemoveUser ``` For subscribing to events for users leaving the scene
## Methods ### Subscribe
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( string Action, User.SubscriptionHandler callback, bool persistent ) ``` Subscribes to User Events. | Parameter | Type | Description | |---|---|---| | `Action` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string action of the event: AddUser, RemoveUser | | `callback` | [User.SubscriptionHandler](/scripting/api/sansar.simulation/user.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( string Action, Action callback, bool persistent ) ``` Subscribes to User Events. | Parameter | Type | Description | |---|---|---| | `Action` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string action of the event: AddUser, RemoveUser | | `callback` | [Action<UserData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
Deprecated
```csharp signature [System.Obsolete("Use subscription callbacks of type Action", false)] public void Subscribe( string Action, Sansar.Script.SessionId User, User.SubscriptionHandler callback, bool persistent ) ``` Subscribes to User Events. | Parameter | Type | Description | |---|---|---| | `Action` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string action of the event: AddUser, RemoveUser | | `User` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId for the user. | | `callback` | [User.SubscriptionHandler](/scripting/api/sansar.simulation/user.subscriptionhandler) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |
```csharp signature public Sansar.Script.IEventSubscription Subscribe( string Action, Sansar.Script.SessionId User, Action callback, bool persistent ) ``` Subscribes to User Events. | Parameter | Type | Description | |---|---|---| | `Action` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string action of the event: AddUser, RemoveUser | | `User` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId for the user. | | `callback` | [Action<UserData>](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. | | `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. | **Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.
## Used in examples - [StatsExample.cs](/scripting/examples/stats-example) - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [BroadcastUsers.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BroadcastUsers.cs) - `CameraShakeExample.cs` - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs) - [CoroutineEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineEventExample.cs) - [CoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) …and 14 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/user --- # User.SubscriptionHandler Kind: Delegate · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Delegate Namespace Sansar.Simulation
Subscribe to receive events when users enter or leave the experience, or change their chat name. ```csharp [System.Obsolete("Use subscription callbacks of type Action", false)] public delegate void User.SubscriptionHandler( string Action, Sansar.Script.SessionId User, string Data ) ``` | Parameter | Type | Description | |---|---|---| | `Action` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string action of the event: AddUser, RemoveUser | | `User` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId for the user. | | `Data` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Deprecated. |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/user.subscriptionhandler --- # UserData Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0
Class Namespace Sansar.Simulation Inherits Sansar.Script.EventData
Subscribe to receive events when users enter or leave the experience. ```csharp public class UserData : Sansar.Script.EventData ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [Action](#action) · [Data](#data) · [User](#user) | | **Methods** | [ToString](#tostring) | ## Properties ### Action
```csharp signature public string Action { get; } ``` string action of the event: AddUser, RemoveUser
### Data
```csharp signature public string Data { get; } ``` Deprecated.
### User
```csharp signature public Sansar.Script.SessionId User { get; } ``` Sansar.Script.SessionId for the user.
## Methods ### ToString
```csharp signature public override string ToString() ``` A string representation of this object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.
Remarks The format of this string may change between releases.
## Used in examples - [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys) - [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [BroadcastUsers.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BroadcastUsers.cs) - `CameraShakeExample.cs` - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - [CommandExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandExample.cs) - [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs) - [CoroutineEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineEventExample.cs) - [CoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineExample.cs) - [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs) - [HttpClientExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/HttpClientExample.cs) …and 9 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.simulation/userdata --- # Sansar.Utility > Types in the Sansar.Utility namespace. Generic collections and JSON serialization helpers. | Type | Kind | Summary | |---|---|---| | [GenericEnumerable<T>](/scripting/api/sansar.utility/genericenumerable-1) | Class | The GenericEnumerable takes a delegate which accesses items in a Array-like collection by index and allows iteration through enumeration. | | [GenericEnumerable<T>.GetItem](/scripting/api/sansar.utility/genericenumerable-1.getitem) | Delegate | Delegate which returns an item by index. | | [JsonSerializationData](/scripting/api/sansar.utility/jsonserializationdata) | Class | The result of a serialization request. | | [JsonSerializationData<T>](/scripting/api/sansar.utility/jsonserializationdata-1) | Class | The result of a serialization request. | | [JsonSerializer](/scripting/api/sansar.utility/jsonserializer) | Class | Converts objects to and from javascript object notation strings | | [JsonSerializerOptions](/scripting/api/sansar.utility/jsonserializeroptions) | Struct | Options which control the serialization and deserialization process |

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility --- # GenericEnumerable Kind: Class · Namespace: Sansar.Utility · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Utility Inherits IEnumerable<T>
The GenericEnumerable takes a delegate which accesses items in a Array-like collection by index and allows iteration through enumeration. ```csharp public class GenericEnumerable : IEnumerable where T : class ``` **Type parameters:** `T`: The type of objects returned by [`GenericEnumerable.GetItem`](/scripting/api/sansar.utility/genericenumerable-1.getitem) ## Remarks This is used by some API methods to allow for enumerations on some colletions. ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [GenericEnumerable](#genericenumerable) | | **Properties** | [Count](#count) | | **Methods** | [GetEnumerator](#getenumerator) · [System\#Collections\#IEnumerable\#GetEnumerator](#systemcollectionsienumerablegetenumerator) | ## Constructors ### GenericEnumerable
```csharp signature public GenericEnumerable( uint count, GenericEnumerable.GetItem getItem ) ``` Initializes the enumerable with an item count and an accessor delegate. | Parameter | Type | Description | |---|---|---| | `count` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | Total number of items in the collection. | | `getItem` | [GenericEnumerable<T>.GetItem](/scripting/api/sansar.utility/genericenumerable-1.getitem) | Delegate which retrieves an item from a collection by index. |
Remarks If the item count changes or items change index the enumeration may be invalidated.
## Properties ### Count
```csharp signature public uint Count { get; } ``` The total number of items in the collection. **Value:** [uint](https://learn.microsoft.com/dotnet/api/system.uint32) — The total number of items in the collection.
Remarks Set by the constructor.
## Methods ### GetEnumerator
```csharp signature public IEnumerator GetEnumerator() ``` Returns an enumerator that iterates through the collection. **Returns:** [IEnumerator<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1) — An enumerator that can be used to iterate through the collection.
Remarks If the item count changes or items change index the enumeration may be invalidated.
### System\#Collections\#IEnumerable\#GetEnumerator
```csharp signature IEnumerator System.Collections.IEnumerable.GetEnumerator() ``` Returns an enumerator that iterates through the collection. **Returns:** [IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.ienumerator) — An enumerator that can be used to iterate through the collection.
Remarks If the item count changes or items change index the enumeration may be invalidated.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility/genericenumerable-1 --- # GenericEnumerable.GetItem Kind: Delegate · Namespace: Sansar.Utility · Assembly: Sansar.Script.dll · Script API 47.10.0
Delegate Namespace Sansar.Utility
Delegate which returns an item by index. ```csharp public delegate T GenericEnumerable.GetItem( uint index ) where T : class ``` | Parameter | Type | Description | |---|---|---| | `index` | [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The index of the item to retrieve. Items in the range \[0..[`GenericEnumerable.Count`](/scripting/api/sansar.utility/genericenumerable-1#count)) exist, though they may be null. | **Returns:** T — The item or null. ## Remarks Indexing outside the bounds of the collection may return null or thow an exception.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility/genericenumerable-1.getitem --- # JsonSerializationData Kind: Class · Namespace: Sansar.Utility · Assembly: Sansar.Script.dll · Script API 47.10.0 The result of a serialization request. ```csharp public class JsonSerializationData : Sansar.Script.OperationCompleteEvent ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [JsonSerializationData](#jsonserializationdata) | | **Properties** | [JsonString](#jsonstring) · [Object](#object) | ## Constructors ### JsonSerializationData
```csharp signature public JsonSerializationData() ```

No description in the API snapshot.

## Properties ### JsonString
```csharp signature public string JsonString { get; } ``` The Json string.
### Object
```csharp signature public object Object { get; } ``` The object.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility/jsonserializationdata --- # JsonSerializationData Kind: Class · Namespace: Sansar.Utility · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Utility Inherits JsonSerializationData
The result of a serialization request. ```csharp public class JsonSerializationData : JsonSerializationData ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [JsonSerializationData](#jsonserializationdata) | | **Properties** | [Object](#object) | ## Constructors ### JsonSerializationData
```csharp signature public JsonSerializationData() ```

No description in the API snapshot.

## Properties ### Object
```csharp signature public T Object { get; } ``` The object.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility/jsonserializationdata-1 --- # JsonSerializer Kind: Class · Namespace: Sansar.Utility · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar.Utility
Converts objects to and from javascript object notation strings ```csharp public static class JsonSerializer ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [Deserialize](#deserialize) · [Serialize](#serialize) | ## Methods ### Deserialize
```csharp signature public static void Deserialize( string value, Action> done ) ``` Converts the given string to an object. | Parameter | Type | Description | |---|---|---| | `value` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string in json notation. | | `done` | [Action<JsonSerializationData<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the conversion is complete. | **Type parameters:** `T`: The type to create.
```csharp signature public static void Deserialize( string value, JsonSerializerOptions options, Action> done ) ``` Converts the given string to an object. | Parameter | Type | Description | |---|---|---| | `value` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The string in json notation. | | `options` | [JsonSerializerOptions](/scripting/api/sansar.utility/jsonserializeroptions) | Options to control the deserialization. | | `done` | [Action<JsonSerializationData<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the conversion is complete. | **Type parameters:** `T`: The type to create.
### Serialize
```csharp signature public static void Serialize( T value, Action> done ) ``` Converts the given object to a Json string | Parameter | Type | Description | |---|---|---| | `value` | T | The object to be converted | | `done` | [Action<JsonSerializationData<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the conversion is complete. | **Type parameters:** `T`: The type of the object to convert. This can usually be inferred.
```csharp signature public static void Serialize( T value, JsonSerializerOptions options, Action> done ) ``` Converts the given object to a Json string | Parameter | Type | Description | |---|---|---| | `value` | T | The object to be converted | | `options` | [JsonSerializerOptions](/scripting/api/sansar.utility/jsonserializeroptions) | Options to control the serialization. | | `done` | [Action<JsonSerializationData<T>>](https://learn.microsoft.com/dotnet/api/system.action-1) | The action to call when the conversion is complete. | **Type parameters:** `T`: The type of the object to convert. This can usually be inferred.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility/jsonserializer --- # JsonSerializerOptions Kind: Struct · Namespace: Sansar.Utility · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar.Utility
Options which control the serialization and deserialization process ```csharp public struct JsonSerializerOptions ``` ## Members at a glance | Kind | Members | |---|---| | **Properties** | [SerializeReferences](#serializereferences) | ## Properties ### SerializeReferences
```csharp signature [get: System.Runtime.CompilerServices.IsReadOnly] public bool SerializeReferences { get; set; } ``` Controls how references are serialized. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — When true references are maintained instead of serializing the objects directly.
Remarks Referential loops with this setting false will throw an exception.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar.utility/jsonserializeroptions --- # Color Kind: Struct · Namespace: Sansar · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar
The Color class holds RGBA values that define a color. ```csharp public struct Color ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [Color](#color) | | **Fields** | [Black](#black) · [Blue](#blue) · [Clear](#clear) · [Cyan](#cyan) · [Gray](#gray) · [Green](#green) · [Magenta](#magenta) · [Red](#red) · [White](#white) · [Yellow](#yellow) | | **Properties** | [A](#a) · [B](#b) · [G](#g) · [R](#r) | | **Methods** | [Lerp](#lerp) · [Parse](#parse) · [ToRGB](#torgb) · [ToRGBA](#torgba) · [ToString](#tostring) · [TryParse](#tryparse) | | **Operators** | [op\_Addition](#op_addition) · [op\_Division](#op_division) · [op\_Implicit](#op_implicit) · [op\_Multiply](#op_multiply) · [op\_Subtraction](#op_subtraction) | ## Constructors ### Color
```csharp signature public Color(Mono.Simd.Vector4f v) ``` Creates a new color with the supplied values. | Parameter | Type | Description | |---|---|---| | `v` | Mono.Simd.Vector4f | Initializes the color from a `Vector4f`. |
```csharp signature public Color(float r, float g, float b) ``` Creates a new solid color with the supplied values. | Parameter | Type | Description | |---|---|---| | `r` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The red component. | | `g` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The green component. | | `b` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The blue component. |
Remarks The alpha component is set to 1.
```csharp signature public Color(float r, float g, float b, float a) ``` Creates a new color with the supplied values. | Parameter | Type | Description | |---|---|---| | `r` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The red component. | | `g` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The green component. | | `b` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The blue component. | | `a` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The alpha component. |
## Fields ### Black
```csharp signature public static readonly Color Black ``` Black
### Blue
```csharp signature public static readonly Color Blue ``` Blue
### Clear
```csharp signature public static readonly Color Clear ``` Clear
### Cyan
```csharp signature public static readonly Color Cyan ``` Cyan
### Gray
```csharp signature public static readonly Color Gray ``` Gray
### Green
```csharp signature public static readonly Color Green ``` Green
### Magenta
```csharp signature public static readonly Color Magenta ``` Magenta
### Red
```csharp signature public static readonly Color Red ``` Red
### White
```csharp signature public static readonly Color White ``` White
### Yellow
```csharp signature public static readonly Color Yellow ``` Yellow
## Properties ### A
```csharp signature public float A { get; set; } ``` The alpha component of the color.
Remarks Alpha is 1 by default.
### B
```csharp signature public float B { get; set; } ``` The blue component of the color.
### G
```csharp signature public float G { get; set; } ``` The green component of the color.
### R
```csharp signature public float R { get; set; } ``` The red component of the color.
## Methods ### Lerp
```csharp signature public Color Lerp(ref Color c, float amount) ``` Performs a linear interpolation between two colors. | Parameter | Type | Description | |---|---|---| | `c` | [Color](/scripting/api/sansar/color) | The second color. | | `amount` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Value from \[0..1\] indicating the weight for the second color. | **Returns:** [Color](/scripting/api/sansar/color) — A color that is linearly interpolated between the two sources.
Remarks This method performs the linear interpolation as: a + (c-a) \* amount. An amount value of 0 returns the original color, and 1.0 returns color c.
### Parse
```csharp signature public static Color Parse(string colorString) ``` Parse a Color from a string. | Parameter | Type | Description | |---|---|---| | `colorString` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string of the format (R,G,B) or (R,G,B,A) | **Returns:** [Color](/scripting/api/sansar/color) — The Color parsed from the string. **Throws** [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): If colorString is null. **Throws** [`FormatException`](https://learn.microsoft.com/dotnet/api/system.formatexception): If the string is not a valid color or its components are not valid floats.
Example ```csharp Color myColor = Color.Parse("(0.5,1.0,0.8)"); ```
### ToRGB
```csharp signature public string ToRGB() ``` Generates a string RGB representation of the color. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The RGB color as a string.
Remarks RGB values are based on a scale from 0 to 255.
### ToRGBA
```csharp signature public string ToRGBA() ``` Generates a string RGBA representation of the color. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The RGBA color as a string.
### ToString
```csharp signature public override string ToString() ``` Generates a string representation of the color. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The color as a string.
```csharp signature public string ToString(string format) ``` Generates a string representation of the color. | Parameter | Type | Description | |---|---|---| | `format` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Format to use for each of the coordinates. | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The color as a string.
### TryParse
```csharp signature public static bool TryParse(string colorString, out Color color) ``` Attempt to parse a Color from a string | Parameter | Type | Description | |---|---|---| | `colorString` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string of the format (R,G,B) or (R,G,B,A) | | `color` | [Color](/scripting/api/sansar/color) | The color that will be set if colorString represents a valid color. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if successfully parsed a color, false if not.
Example ```csharp Color myColor; if (Color.Parse("(0.5,1.0,0.8)", out myColor) { // myColor is set } ```
## Operators ### op_Addition
```csharp signature public static Color operator +(Color a, Color b) ``` Performs color addition. | Parameter | Type | Description | |---|---|---| | `a` | [Color](/scripting/api/sansar/color) | The first Color. | | `b` | [Color](/scripting/api/sansar/color) | The second Color. | **Returns:** [Color](/scripting/api/sansar/color) — A new color that is the sum of the arguments.
### op_Division
```csharp signature public static Color operator /(Color c, float s) ``` Divides color components by a scalar. | Parameter | Type | Description | |---|---|---| | `c` | [Color](/scripting/api/sansar/color) | The color. | | `s` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scalar. | **Returns:** [Color](/scripting/api/sansar/color) — Returns a new color with value \[c.R/s, c.G/s, c.B/s, c.A/s\]
### op_Implicit
```csharp signature public static implicit operator Color(Mono.Simd.Vector4f v) ``` Converts a Mono.Simd.Vector4f to a Color. | Parameter | Type | Description | |---|---|---| | `v` | Mono.Simd.Vector4f | Vector to convert |
```csharp signature public static implicit operator Mono.Simd.Vector4f(Color c) ``` Converts a Color to a Mono.Simd.Vector4f | Parameter | Type | Description | |---|---|---| | `c` | [Color](/scripting/api/sansar/color) | Color to convert |
### op_Multiply
```csharp signature public static Color operator *(Color c, float s) ``` Performs a color scalar multiplication. | Parameter | Type | Description | |---|---|---| | `c` | [Color](/scripting/api/sansar/color) | The color. | | `s` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scalar. | **Returns:** [Color](/scripting/api/sansar/color) — Returns a new color with value \[c.R\*s, c.G\*s, c.B\*s, c.A\*s\]
```csharp signature public static Color operator *(float s, Color c) ``` Performs a color scalar multiplication. | Parameter | Type | Description | |---|---|---| | `s` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scalar. | | `c` | [Color](/scripting/api/sansar/color) | The color. | **Returns:** [Color](/scripting/api/sansar/color) — Returns a new color with value \[s\*c.R, s\*c.G, s\*c.B, s\*c.A\]
### op_Subtraction
```csharp signature public static Color operator -(Color a, Color b) ``` Performs color subtraction. | Parameter | Type | Description | |---|---|---| | `a` | [Color](/scripting/api/sansar/color) | The first Color. | | `b` | [Color](/scripting/api/sansar/color) | The second Color. | **Returns:** [Color](/scripting/api/sansar/color) — A new color that is the difference of the arguments.
## Used in examples - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Scene/Light.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Light.cs) - [ScriptLibrary/Scene/LightOnOff.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/LightOnOff.cs) - [ScriptLibrary/Scene/ProgressBar.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/ProgressBar.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar/color --- # Mathf Kind: Class · Namespace: Sansar · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar
Floating point math constants and utilities. ```csharp public static class Mathf ``` ## Remarks Provides common floating point constants static methods. ## Members at a glance | Kind | Members | |---|---| | **Fields** | [DegreesPerRadian](#degreesperradian) · [E](#e) · [PI](#pi) · [PiOverTwo](#piovertwo) · [RadiansPerDegree](#radiansperdegree) · [RootTwo](#roottwo) · [RootTwoOverTwo](#roottwoovertwo) · [TwoOverPi](#twooverpi) · [TwoPi](#twopi) | | **Methods** | [Clamp](#clamp) · [IsApproximatelyEqualAbsolute](#isapproximatelyequalabsolute) | ## Fields ### DegreesPerRadian
```csharp signature public const float DegreesPerRadian ``` Conversion factor to convert radians to degrees.
### E
```csharp signature public const float E ``` E
### PI
```csharp signature public const float PI ``` Pi
### PiOverTwo
```csharp signature public const float PiOverTwo ``` Pi divided by two.
### RadiansPerDegree
```csharp signature public const float RadiansPerDegree ``` Conversion factor to convert degrees to radians.
### RootTwo
```csharp signature public const float RootTwo ``` The square root of two.
### RootTwoOverTwo
```csharp signature public const float RootTwoOverTwo ``` The square root of 2 divided by two.
### TwoOverPi
```csharp signature public const float TwoOverPi ``` Two divided by pi.
### TwoPi
```csharp signature public const float TwoPi ``` Two times pi.
## Methods ### Clamp
```csharp signature public static float Clamp(float x, float min, float max) ``` Clamps a float to the specified range | Parameter | Type | Description | |---|---|---| | `x` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The float to compare. | | `min` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The minimum of the clamp range. | | `max` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The maximum of the clamp range. | **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — x if x is within \[min,max\] otherwise min or max, whichever is closer to the value of x.
### IsApproximatelyEqualAbsolute
```csharp signature public static bool IsApproximatelyEqualAbsolute(float a, float b) ``` Compares the two given floats and returns true if they are approximately equal | Parameter | Type | Description | |---|---|---| | `a` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The first float to compare. | | `b` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The second float to compare. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — true if the float are approximately equal, false otherwise.
Remarks Checks if the absolute value of the difference of the values is small.
## Used in examples - [MoverExample2.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - `MoverExample4.cs` - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) - [ScriptLibrary/Scene/KeyframedMotion.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/KeyframedMotion.cs) - [ScriptLibrary/Scene/Mover.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Mover.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar/mathf --- # Quaternion Kind: Struct · Namespace: Sansar · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar
Represents a quaternion orientation. ```csharp public struct Quaternion ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [Quaternion](#quaternion) | | **Fields** | [Identity](#identity) | | **Properties** | [Item](#item) · [W](#w) · [X](#x) · [Y](#y) · [Z](#z) | | **Methods** | [Dot](#dot) · [FromAngleAxis](#fromangleaxis) · [FromEulerAngles](#fromeulerangles) · [FromLook](#fromlook) · [FromLookOrthoNormal](#fromlookorthonormal) · [GetEulerAngles](#geteulerangles) · [Inverse](#inverse) · [Length](#length) · [LengthSquared](#lengthsquared) · [Normalized](#normalized) · [Parse](#parse) · [ShortestRotation](#shortestrotation) · [ToAngleAxis](#toangleaxis) · [ToString](#tostring) · [TryParse](#tryparse) | | **Operators** | [op\_Implicit](#op_implicit) · [op\_Multiply](#op_multiply) · [op\_UnaryNegation](#op_unarynegation) | ## Constructors ### Quaternion
```csharp signature public Quaternion( [System.Runtime.CompilerServices.IsReadOnly] ref Mono.Simd.Vector4f v ) ``` Creates a new quaternion with the supplied values. | Parameter | Type | Description | |---|---|---| | `v` | Mono.Simd.Vector4f | Initializes the quaternion from a `Vector4f`. |
```csharp signature public Quaternion(float x, float y, float z, float w) ``` Creates a new quaternion with the supplied values. | Parameter | Type | Description | |---|---|---| | `x` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The x coordinate. | | `y` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The y coordinate. | | `z` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The z coordinate. | | `w` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The w coordinate. |
## Fields ### Identity
```csharp signature public static readonly Quaternion Identity ``` The identity quaternion.
## Properties ### Item
```csharp signature public float this [int index] { get; set; } ``` Allows getting coordinates by index. | Parameter | Type | Description | |---|---|---| | `index` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | 0=>X, 1=>Y, 2=>Z, 3=>W |
### W
```csharp signature public float W { get; set; } ``` The W coordinate of the quaternion.
### X
```csharp signature public float X { get; set; } ``` The X coordinate of the quaternion.
### Y
```csharp signature public float Y { get; set; } ``` The Y coordinate of the quaternion.
### Z
```csharp signature public float Z { get; set; } ``` The Z coordinate of the quaternion.
## Methods ### Dot
```csharp signature public float Dot( [System.Runtime.CompilerServices.IsReadOnly] ref Quaternion b ) ``` Performs a scalar or dot product. | Parameter | Type | Description | |---|---|---| | `b` | [Quaternion](/scripting/api/sansar/quaternion) | The second quaternion. | **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — Returns X\*b.X+Y\*b.Y+Z\*b.Z+W\*b.W
### FromAngleAxis
```csharp signature public static Quaternion FromAngleAxis( float angle, [System.Runtime.CompilerServices.IsReadOnly] ref Vector axis ) ``` Generates the corresponding quaternion. | Parameter | Type | Description | |---|---|---| | `angle` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Angle of rotation in radians | | `axis` | [Vector](/scripting/api/sansar/vector) | A normalized axis of rotation | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — The corresponding quaternion.
### FromEulerAngles
```csharp signature public static Quaternion FromEulerAngles( [System.Runtime.CompilerServices.IsReadOnly] ref Vector a ) ``` Generates the corresponding quaternion. | Parameter | Type | Description | |---|---|---| | `a` | [Vector](/scripting/api/sansar/vector) | A vector of angles in radians. | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — The corresponding quaternion.
Remarks Rotates first around X (local/global coincide), then around new local Y, and finally around new local Z.
### FromLook
```csharp signature public static Quaternion FromLook(Vector facing, Vector up) ``` Creates a new rotation with the specified direction and up vectors. | Parameter | Type | Description | |---|---|---| | `facing` | [Vector](/scripting/api/sansar/vector) | The direction to look. | | `up` | [Vector](/scripting/api/sansar/vector) | The up direction. | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — A new quaternion representing this rotation.
### FromLookOrthoNormal
Added in 35.0.0
```csharp signature public static Quaternion FromLookOrthoNormal( [System.Runtime.CompilerServices.IsReadOnly] ref Vector facing, [System.Runtime.CompilerServices.IsReadOnly] ref Vector up, [System.Runtime.CompilerServices.IsReadOnly] ref Vector left ) ``` Creates a new rotation with the specified direction and up vectors. | Parameter | Type | Description | |---|---|---| | `facing` | [Vector](/scripting/api/sansar/vector) | The direction to look. | | `up` | [Vector](/scripting/api/sansar/vector) | The up direction. | | `left` | [Vector](/scripting/api/sansar/vector) | The left direction. | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — A new quaternion representing this rotation.
Remarks The 3 given vectors must be orthonormal. See [`Vector.Orthonormalize`](/scripting/api/sansar/vector#orthonormalize)
### GetEulerAngles
```csharp signature public Vector GetEulerAngles() ``` Converts this rotation to a vector of euler angles **Returns:** [Vector](/scripting/api/sansar/vector) — A vector of angles in radians corresponding to this quaternion.
Remarks Returns angles which can be passed to [`Quaternion.FromEulerAngles`](/scripting/api/sansar/quaternion#fromeulerangles) to create this quaternion.
### Inverse
```csharp signature public Quaternion Inverse() ``` Gets the Inverse of the quaternion. **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — A quaternion inverse, such that q \* q.Inverse() == q.Inverse() \* q == Quaternion.Identity
Remarks Results are undefined if the length of the quaternion is close to 0.
### Length
```csharp signature public float Length() ``` Calculates the length of this quaternion. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The length of the quaternion.
### LengthSquared
```csharp signature public float LengthSquared() ``` Calculates the length squared of this quaternion. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The magnitude of the vector.
### Normalized
```csharp signature public Quaternion Normalized() ``` Returns a quaternion with the same orientation and unit length. **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — A quaternion with the same orientation and unit length.
Remarks Results are undefined if the length of the quaternion is close to 0.
### Parse
```csharp signature public static Quaternion Parse(string quaternionString) ``` Parse a Quaternion from a string. | Parameter | Type | Description | |---|---|---| | `quaternionString` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string of the format "\[X,Y,Z,W\]" | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — The Quaternion parsed from quaternionString. **Throws** [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): If quaternionString is null. **Throws** [`FormatException`](https://learn.microsoft.com/dotnet/api/system.formatexception): If the string is not a valid quaternion or its components are not valid floats.
Example ```csharp Quaternion myQuat = Quaternion.Parse("[0.0,0.0,0.0,1.0]"); ```
### ShortestRotation
```csharp signature public static Quaternion ShortestRotation( [System.Runtime.CompilerServices.IsReadOnly] ref Vector from, [System.Runtime.CompilerServices.IsReadOnly] ref Vector to ) ``` Generates the shortest rotation quaternion to rotate from one vector to another. | Parameter | Type | Description | |---|---|---| | `from` | [Vector](/scripting/api/sansar/vector) | Vector rotating from. | | `to` | [Vector](/scripting/api/sansar/vector) | Vector rotating to. | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — The corresponding quaternion.
Remarks This function assumes that the passed in vectors are normalized.
### ToAngleAxis
```csharp signature public void ToAngleAxis(out float angle, out Vector axis) ``` Gets the angle-axis representation | Parameter | Type | Description | |---|---|---| | `angle` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Angle of rotation in radians | | `axis` | [Vector](/scripting/api/sansar/vector) | A normalized axis of rotation |
Remarks For the Quaternion Identity (no rotation) the axis is undefined and will be given as (0,0,1)
### ToString
```csharp signature public override string ToString() ``` Generates a string representation of the quaternion. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The quaternion as a string.
```csharp signature public string ToString(string format) ``` Generates a string representation of the quaternion. | Parameter | Type | Description | |---|---|---| | `format` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Format to use for each of the coordinates. | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The quaternion as a string.
### TryParse
```csharp signature public static bool TryParse( string quaternionString, out Quaternion quaternion ) ``` Try to parse a Quaternion from a string. | Parameter | Type | Description | |---|---|---| | `quaternionString` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string of the format "\[X,Y,Z,W\]" | | `quaternion` | [Quaternion](/scripting/api/sansar/quaternion) | The quaternion that will be set if quaternionString represents a valid quaternion. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if successfully parsed a quaternion, false if not.
Example ```csharp Quaternion myQuat; if (Quaternion.TryParse("[0.0,0.0,0.0,1.0]", out myQuat) { // myQuat is set. } ```
## Operators ### op_Implicit
```csharp signature public static implicit operator Quaternion(Mono.Simd.Vector4f v) ``` Converts a Mono.Simd.Vector4f to a quaternion. | Parameter | Type | Description | |---|---|---| | `v` | Mono.Simd.Vector4f | The vector to convert |
```csharp signature public static implicit operator Mono.Simd.Vector4f(Quaternion v) ``` Converts a quaternion to a Mono.Simd.Vector4f. | Parameter | Type | Description | |---|---|---| | `v` | [Quaternion](/scripting/api/sansar/quaternion) | The quaternion to convert |
### op_Multiply
```csharp signature public static Quaternion operator *( [System.Runtime.CompilerServices.IsReadOnly] ref Quaternion a, [System.Runtime.CompilerServices.IsReadOnly] ref Quaternion b ) ``` Multiplies two quaternions. | Parameter | Type | Description | |---|---|---| | `a` | [Quaternion](/scripting/api/sansar/quaternion) | The first quaternion | | `b` | [Quaternion](/scripting/api/sansar/quaternion) | The second quaternion | **Returns:** [Quaternion](/scripting/api/sansar/quaternion) — Returns the composed orientation for the two quaternions.
### op_UnaryNegation
Deprecated
```csharp signature [System.Obsolete] public static Quaternion operator -(Quaternion q) ``` Negates a quaternion | Parameter | Type | Description | |---|---|---| | `q` | [Quaternion](/scripting/api/sansar/quaternion) | The quaternion to negate |
Remarks Note this is not a quaternion inverse, it is a component-wise multiplication by -1. For a quaternion inverse use [`Quaternion.Inverse`](/scripting/api/sansar/quaternion#inverse)
## Used in examples - [MoverExample2.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - `MoverExample4.cs` - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) - [ScriptLibrary/Scene/HintText.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/HintText.cs) - [ScriptLibrary/Scene/KeyframedMotion.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/KeyframedMotion.cs) - [ScriptLibrary/Scene/Mover.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Mover.cs)

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar/quaternion --- # Vector Kind: Struct · Namespace: Sansar · Assembly: Sansar.Script.dll · Script API 47.10.0
Struct Namespace Sansar
The Vector class represents a 3 dimensional vector. ```csharp public struct Vector ``` ## Members at a glance | Kind | Members | |---|---| | **Constructors** | [Vector](#vector) | | **Fields** | [Back](#back) · [Down](#down) · [Forward](#forward) · [Left](#left) · [ObjectBack](#objectback) · [ObjectDown](#objectdown) · [ObjectForward](#objectforward) · [ObjectLeft](#objectleft) · [ObjectRight](#objectright) · [ObjectUp](#objectup) · [One](#one) · [Right](#right) · [Up](#up) · [Zero](#zero) | | **Properties** | [Item](#item) · [W](#w) · [X](#x) · [Y](#y) · [Z](#z) | | **Methods** | [AngleTo](#angleto) · [Cross](#cross) · [Dot](#dot) · [Dot3](#dot3) · [Dot4](#dot4) · [Length](#length) · [LengthSquared](#lengthsquared) · [Lerp](#lerp) · [Normalized](#normalized) · [Orthonormalize](#orthonormalize) · [Parse](#parse) · [Rotate](#rotate) · [ToString](#tostring) · [ToString4](#tostring4) · [TryParse](#tryparse) | | **Operators** | [op\_Addition](#op_addition) · [op\_Division](#op_division) · [op\_Implicit](#op_implicit) · [op\_Multiply](#op_multiply) · [op\_Subtraction](#op_subtraction) | ## Constructors ### Vector
```csharp signature public Vector( [System.Runtime.CompilerServices.IsReadOnly] ref Mono.Simd.Vector4f v ) ``` Creates a new vector with the supplied values. | Parameter | Type | Description | |---|---|---| | `v` | Mono.Simd.Vector4f | Initializes the vector from a `Vector4f`. W should be 0 and is assumed to be 0 for most operations. |
```csharp signature public Vector(float all) ``` Creates a new vector with all values set to the given value. | Parameter | Type | Description | |---|---|---| | `all` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The value for all coordinates. |
Remarks W will be set to 0.
```csharp signature public Vector(float x, float y, float z, float w) ``` Creates a new vector with the supplied values. | Parameter | Type | Description | |---|---|---| | `x` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The x coordinate. | | `y` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The y coordinate. | | `z` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The z coordinate. | | `w` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The w coordinate. W defaults to 0 and is assumed to be 0 for most operations. |
## Fields ### Back
Deprecated
```csharp signature [System.Obsolete("Use ObjectBack for correct back vector.", false)] public static readonly Vector Back ``` Deprecated back vector.
### Down
Deprecated
```csharp signature [System.Obsolete("Use ObjectDown for correct down vector.", false)] public static readonly Vector Down ``` Deprecated down vector.
### Forward
Deprecated
```csharp signature [System.Obsolete("Use ObjectForward for correct forward vector.", false)] public static readonly Vector Forward ``` Deprecated forward vector.
### Left
Deprecated
```csharp signature [System.Obsolete("Use ObjectLeft for correct left vector.", false)] public static readonly Vector Left ``` Deprecated left vector.
### ObjectBack
Added in 36.0.1
```csharp signature public static readonly Vector ObjectBack ``` The default world back vector.
### ObjectDown
Added in 36.0.1
```csharp signature public static readonly Vector ObjectDown ``` The default world down vector.
### ObjectForward
Added in 36.0.1
```csharp signature public static readonly Vector ObjectForward ``` The default world forward vector.
### ObjectLeft
Added in 36.0.1
```csharp signature public static readonly Vector ObjectLeft ``` The default world left vector.
### ObjectRight
Added in 36.0.1
```csharp signature public static readonly Vector ObjectRight ``` The default world right vector.
### ObjectUp
Added in 36.0.1
```csharp signature public static readonly Vector ObjectUp ``` The default world up vector.
### One
```csharp signature public static readonly Vector One ``` A vector with all components 1.
### Right
Deprecated
```csharp signature [System.Obsolete("Use ObjectRight for correct right vector.", false)] public static readonly Vector Right ``` Deprecated right vector.
### Up
Deprecated
```csharp signature [System.Obsolete("Use ObjectUp for correct up vector.", false)] public static readonly Vector Up ``` Deprecated up Vector
### Zero
```csharp signature public static readonly Vector Zero ``` A vector with all components 0.
## Properties ### Item
```csharp signature public float this [int index] { get; set; } ``` Allows getting coordinates by index. | Parameter | Type | Description | |---|---|---| | `index` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | 0=>X, 1=>Y, 2=>Z, 3=>W |
### W
```csharp signature public float W { get; set; } ``` The W coordinate of the vector.
Remarks W should be 0 and is assumed to be 0 for most operations.
### X
```csharp signature public float X { get; set; } ``` The X coordinate of the vector.
### Y
```csharp signature public float Y { get; set; } ``` The Y coordinate of the vector.
### Z
```csharp signature public float Z { get; set; } ``` The Z coordinate of the vector.
## Methods ### AngleTo
```csharp signature public float AngleTo( [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Returns the angle in radians between this vector and the given vector. | Parameter | Type | Description | |---|---|---| | `b` | [Vector](/scripting/api/sansar/vector) | The angle to compare. | **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The smallest angle in radians between the two vectors.
### Cross
```csharp signature public Vector Cross( [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Calculates the cross product of 2 3D vectors. | Parameter | Type | Description | |---|---|---| | `b` | [Vector](/scripting/api/sansar/vector) | The second vector. | **Returns:** [Vector](/scripting/api/sansar/vector) — a X b
### Dot
```csharp signature public float Dot( [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Performs a 3-component scalar or dot product. | Parameter | Type | Description | |---|---|---| | `b` | [Vector](/scripting/api/sansar/vector) | The second vector. | **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — Returns X\*b.X+Y\*b.Y+Z\*b.Z
### Dot3
```csharp signature public float Dot3( [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Performs a 3-component scalar or dot product. | Parameter | Type | Description | |---|---|---| | `b` | [Vector](/scripting/api/sansar/vector) | The second vector. | **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — Returns X\*b.X+Y\*b.Y+Z\*b.Z
### Dot4
```csharp signature public float Dot4( [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Performs a 4-component scalar or dot product. | Parameter | Type | Description | |---|---|---| | `b` | [Vector](/scripting/api/sansar/vector) | The second vector. | **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — Returns X\*b.X+Y\*b.Y+Z\*b.Z+W\*b.W
### Length
```csharp signature public float Length() ``` Calculates the magnitude of this vector. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The 3D vector length.
### LengthSquared
```csharp signature public float LengthSquared() ``` Calculates the square magnitude of this vector. **Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The square of the 3D vector length.
### Lerp
```csharp signature public Vector Lerp( [System.Runtime.CompilerServices.IsReadOnly] ref Vector b, float amount ) ``` Performs a linear interpolation between two vectors. | Parameter | Type | Description | |---|---|---| | `b` | [Vector](/scripting/api/sansar/vector) | The second vector. | | `amount` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Value from \[0..1\] indicating the weight for the second vector. | **Returns:** [Vector](/scripting/api/sansar/vector) — A vector that is linearly interpolated between the two sources.
Remarks This method performs the linear interpolation as: a + (b-a) \* amount. An amount value of 0 returns vector a, and 1 returns vector b.
### Normalized
```csharp signature public Vector Normalized() ``` Returns a vector with the same orientation and unit length. **Returns:** [Vector](/scripting/api/sansar/vector) — A vector with the same orientation and unit length.
### Orthonormalize
Added in 35.0.0
```csharp signature public static Vector Orthonormalize(ref Vector forward, ref Vector up) ``` Normalizes the two vectors and returns the normalized cross product. | Parameter | Type | Description | |---|---|---| | `forward` | [Vector](/scripting/api/sansar/vector) | The facing ve | | `up` | [Vector](/scripting/api/sansar/vector) | | **Returns:** [Vector](/scripting/api/sansar/vector)
### Parse
```csharp signature public static Vector Parse(string vectorString) ``` Parse a Vector from a string. | Parameter | Type | Description | |---|---|---| | `vectorString` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string of the format <X,Y,Z> or <X,Y,Z,W> | **Returns:** [Vector](/scripting/api/sansar/vector) — The Vector parsed from the string. **Throws** [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): If vectorString is null. **Throws** [`FormatException`](https://learn.microsoft.com/dotnet/api/system.formatexception): If the string is not a valid vector or its components are not valid floats.
Example ```csharp Vector myVector = Vector.Parse("<1,2.34,5.6>"); ```
### Rotate
```csharp signature public Vector Rotate( [System.Runtime.CompilerServices.IsReadOnly] ref Quaternion q ) ``` Returns a new vector which is this vector rotated by the given quaternion. | Parameter | Type | Description | |---|---|---| | `q` | [Quaternion](/scripting/api/sansar/quaternion) | The quaternion rotation. | **Returns:** [Vector](/scripting/api/sansar/vector)
### ToString
```csharp signature public override string ToString() ``` Generates a string representation of the vector. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The vector as a string.
```csharp signature public string ToString(string format) ``` Generates a string representation of the vector. | Parameter | Type | Description | |---|---|---| | `format` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Format to use for each of the coordinates. | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The vector as a string.
### ToString4
```csharp signature public string ToString4(string format) ``` Generates a string representation of the vector, including the W parameter. | Parameter | Type | Description | |---|---|---| | `format` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Format to use for each of the coordinates. | **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The vector as a string.
### TryParse
```csharp signature public static bool TryParse(string vectorString, out Vector vector) ``` Attempt to parse a Vector from a string | Parameter | Type | Description | |---|---|---| | `vectorString` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string of the format <X,Y,Z> or <X,Y,Z,W> | | `vector` | [Vector](/scripting/api/sansar/vector) | The vector that will be set if vectorString represents a valid vector. | **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if successfully parsed a vector, false if not.
Example ```csharp Vector myVector; if (Vector.Parse("<1,2.34,5.6>", out myVector) { // myVector is set } ```
## Operators ### op_Addition
```csharp signature public static Vector operator +( [System.Runtime.CompilerServices.IsReadOnly] ref Vector a, [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Performs vector addition. | Parameter | Type | Description | |---|---|---| | `a` | [Vector](/scripting/api/sansar/vector) | The first Vector. | | `b` | [Vector](/scripting/api/sansar/vector) | The second Vector. | **Returns:** [Vector](/scripting/api/sansar/vector) — A new vector that is the sum of the arguments.
### op_Division
```csharp signature public static Vector operator /( [System.Runtime.CompilerServices.IsReadOnly] ref Vector a, float b ) ``` Divides vector components by a scalar. | Parameter | Type | Description | |---|---|---| | `a` | [Vector](/scripting/api/sansar/vector) | The vector. | | `b` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scalar. | **Returns:** [Vector](/scripting/api/sansar/vector) — Returns a new vector with value \[a.X/b, a.Y/b, a.Z/b, a.W/b\]
### op_Implicit
```csharp signature public static implicit operator Vector( [System.Runtime.CompilerServices.IsReadOnly] ref Mono.Simd.Vector4f v ) ``` Converts a Mono.Simd.Vector4f to a vector. | Parameter | Type | Description | |---|---|---| | `v` | Mono.Simd.Vector4f | The vector to convert |
```csharp signature public static implicit operator Mono.Simd.Vector4f( [System.Runtime.CompilerServices.IsReadOnly] ref Vector v ) ``` Converts a vector to a Mono.Simd.Vector4f | Parameter | Type | Description | |---|---|---| | `v` | [Vector](/scripting/api/sansar/vector) | The vector to convert |
### op_Multiply
```csharp signature public static Vector operator *( [System.Runtime.CompilerServices.IsReadOnly] ref Vector a, float b ) ``` Performs a vector scalar multiplication. | Parameter | Type | Description | |---|---|---| | `a` | [Vector](/scripting/api/sansar/vector) | The vector. | | `b` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scalar. | **Returns:** [Vector](/scripting/api/sansar/vector) — Returns a new vector with value \[a.X\*b, a.Y\*b, a.Z\*b, a.W\*b\]
```csharp signature public static Vector operator *( float a, [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Performs a vector scalar multiplication. | Parameter | Type | Description | |---|---|---| | `a` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scalar. | | `b` | [Vector](/scripting/api/sansar/vector) | The vector. | **Returns:** [Vector](/scripting/api/sansar/vector) — Returns a new vector with value \[a\*b.X, a\*b.Y, a\*b.Z, a\*b.W\]
### op_Subtraction
```csharp signature public static Vector operator -( [System.Runtime.CompilerServices.IsReadOnly] ref Vector a, [System.Runtime.CompilerServices.IsReadOnly] ref Vector b ) ``` Performs vector subtraction. | Parameter | Type | Description | |---|---|---| | `a` | [Vector](/scripting/api/sansar/vector) | The first Vector. | | `b` | [Vector](/scripting/api/sansar/vector) | The second Vector. | **Returns:** [Vector](/scripting/api/sansar/vector) — A new vector that is the difference of the arguments.
## Used in examples - [FollowThePath.cs](/scripting/examples/follow-the-path) - [MoverExample1.cs](/scripting/examples/mover-examples) - [MoverExample2.cs](/scripting/examples/mover-examples) - [MoverExample3.cs](/scripting/examples/mover-examples) - [RandomMovement.cs](/scripting/examples/random-movement) - [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs) - `CameraShakeExample.cs` - [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs) - `MoverExample4.cs` - [ReactionsExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ReactionsExample.cs) - [ScriptLibrary/Quest/QuestObjectBase.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectBase.cs) - [ScriptLibrary/Scene/Dispenser.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Dispenser.cs) …and 8 more examples in the snapshot.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar/vector --- # VectorExtensions Kind: Class · Namespace: Sansar · Assembly: Sansar.Script.dll · Script API 47.10.0
Class Namespace Sansar
Additional methods for Mono.Simd.Vector4f. ```csharp public static class VectorExtensions ``` ## Members at a glance | Kind | Members | |---|---| | **Methods** | [Cos](#cos) · [CosSlow](#cosslow) · [SelectWithMask](#selectwithmask) · [Sin](#sin) · [SinSlow](#sinslow) · [SinZeroPiOverTwo](#sinzeropiovertwo) | ## Methods ### Cos
```csharp signature public static Mono.Simd.Vector4f Cos(this Mono.Simd.Vector4f x) ``` Returns the approximate cosine of the four floats in the vector. | Parameter | Type | Description | |---|---|---| | `x` | Mono.Simd.Vector4f | A vector of 4 floats. | **Returns:** Mono.Simd.Vector4f — The approximate cosine of each element.
Remarks Uses [`VectorExtensions.Sin`](/scripting/api/sansar/vectorextensions#sin)
### CosSlow
```csharp signature public static Mono.Simd.Vector4f CosSlow(this Mono.Simd.Vector4f v1) ``` Returns the cosine each element of the vector. | Parameter | Type | Description | |---|---|---| | `v1` | Mono.Simd.Vector4f | A vector of 4 floats. | **Returns:** Mono.Simd.Vector4f — The cosine of each element.
Remarks Uses [`Math.Cos`](https://learn.microsoft.com/dotnet/api/system.math.cos). The results are more accurate than [`VectorExtensions.Cos`](/scripting/api/sansar/vectorextensions#cos) but take approximately 3x the time to calculate.
### SelectWithMask
```csharp signature public static Mono.Simd.Vector4f SelectWithMask( this Mono.Simd.Vector4i mask, Mono.Simd.Vector4f sourceIfTrue, Mono.Simd.Vector4f sourceIfFalse ) ``` Creates a new vector4f from the given vectors, selecting a component from sourceIfTrue if the corresponding component in the mask is -1 and from sourceIfFalse if 0. | Parameter | Type | Description | |---|---|---| | `mask` | Mono.Simd.Vector4i | The mask vector. | | `sourceIfTrue` | Mono.Simd.Vector4f | The vector containing the elements that are selected if the mask is true. | | `sourceIfFalse` | Mono.Simd.Vector4f | The vector containing the elements that are selected if the maks is false. | **Returns:** Mono.Simd.Vector4f — A new vector with elements selected from the source vectors based on the mask.
Remarks Each element in the mask must be 0 or -1 or the results are undefined. Courtesy of Mark++, http\://markplusplus.wordpress.com/2007/03/14/fast-sse-select-operation/
Example ```csharp Vector4f left = new Vector4f(1, 2, 3, 4); Vector4f right = new Vector4f(5, 6, 7, 8); // Select X and Z from right and Y and W from left Vector4i mask = new Vector4i(0, -1, 0, -1); var result = mask.SelectWithMask(left, right); Assertions.AlmostEqual((Vector)new Vector4f(5, 2, 7, 4), result); ```
### Sin
```csharp signature public static Mono.Simd.Vector4f Sin(this Mono.Simd.Vector4f a) ``` Returns the approximate sine of the four floats in the vector. | Parameter | Type | Description | |---|---|---| | `a` | Mono.Simd.Vector4f | A vector of 4 floats | **Returns:** Mono.Simd.Vector4f — A fast approximation of the sine of each of the 4 floats.
Remarks Uses [`VectorExtensions.SinZeroPiOverTwo`](/scripting/api/sansar/vectorextensions#sinzeropiovertwo)
### SinSlow
```csharp signature public static Mono.Simd.Vector4f SinSlow(this Mono.Simd.Vector4f v1) ``` Returns the sine each element of the vector. | Parameter | Type | Description | |---|---|---| | `v1` | Mono.Simd.Vector4f | A vector of 4 floats. | **Returns:** Mono.Simd.Vector4f — The sine of each element.
Remarks Uses [`Math.Sin`](https://learn.microsoft.com/dotnet/api/system.math.sin). The results are more accurate than [`VectorExtensions.Sin`](/scripting/api/sansar/vectorextensions#sin) but take approximately 3x the time to calculate.
### SinZeroPiOverTwo
```csharp signature public static Mono.Simd.Vector4f SinZeroPiOverTwo( this Mono.Simd.Vector4f x ) ``` Returns the approximate sine of each element in the vector. | Parameter | Type | Description | |---|---|---| | `x` | Mono.Simd.Vector4f | A vector of 4 floats. | **Returns:** Mono.Simd.Vector4f — The approximate sine of each element.
Remarks Results only valid if each element is in \[0 and Pi/2\]. For unconstrained input use [`VectorExtensions.Sin`](/scripting/api/sansar/vectorextensions#sin). Calculated using the Maclaurin series as sin(x) = x - (x^3)/3! + (x^5)/5! - (x^7)/7! + (x^9)/9!

Generated from the Sansar 47.10.0 client ScriptApi snapshot.

Source: https://docs.sansar.com/scripting/api/sansar/vectorextensions --- # Allowed .NET APIs > The .NET namespaces, types and members Sansar scripts can use. Scripts can use only the .NET namespaces, types and members listed here. Generated from the Sansar 47.10.0 client's access.html. ## Mono.Simd access.html lists no individual types for this namespace. ## System.Collections.Generic - [Comparer<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.comparer-1) - [Dictionary<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2): `Add`, `Clear`, `Comparer`, `ContainsKey`, `ContainsValue`, `Count`, `GetEnumerator`, `Item`, `Keys`, `OnDeserialization`, `TryGetValue`, `Values` - [EqualityComparer<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.equalitycomparer-1) - [HashSet<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1): `Add`, `Clear`, `Comparer`, `Contains`, `CopyTo`, `Count`, `CreateSetComparer`, `ExceptWith`, `GetEnumerator`, `IntersectWith`, `IsProperSubsetOf`, `IsProperSupersetOf`, `IsSubsetOf`, `IsSupersetOf`, `OnDeserialization`, `Overlaps`, `Remove`, `RemoveWhere`, `SetEquals`, `SymmetricExceptWith`, `TrimExcess`, `UnionWith` - [KeyNotFoundException](https://learn.microsoft.com/dotnet/api/system.collections.generic.keynotfoundexception) - [KeyValuePair<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2): `Key`, `KeyValuePair`, `ToString`, `Value` - [LinkedList<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.linkedlist-1): `AddAfter`, `AddBefore`, `AddFirst`, `AddLast`, `Clear`, `Contains`, `CopyTo`, `Count`, `Find`, `FindLast`, `First`, `GetEnumerator`, `Last`, `OnDeserialization`, `Remove`, `RemoveFirst`, `RemoveLast` - [LinkedListNode<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.linkedlistnode-1) - [List<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) - [Queue<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.queue-1): `Clear`, `Contains`, `CopyTo`, `Count`, `Dequeue`, `Enqueue`, `GetEnumerator`, `Peek`, `Queue`, `ToArray`, `TrimExcess` - [SortedDictionary<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.sorteddictionary-2) - [SortedList<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2) - [SortedSet<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedset-1): `Add`, `Clear`, `Comparer`, `Contains`, `CopyTo`, `Count`, `CreateSetComparer`, `ExceptWith`, `GetEnumerator`, `GetViewBetween`, `IntersectWith`, `IsProperSubsetOf`, `IsProperSupersetOf`, `IsSubsetOf`, `IsSupersetOf`, `Max`, `Min`, `OnDeserialization`, `Overlaps`, `Remove`, `RemoveWhere`, `Reverse`, `SetEquals`, `SymmetricExceptWith`, `UnionWith` - [Stack<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.stack-1): `Clear`, `Contains`, `CopyTo`, `Count`, `GetEnumerator`, `Peek`, `Pop`, `Push`, `Stack`, `ToArray`, `TrimExcess` ## System.Collections.ObjectModel - [ObservableCollection<T>](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1) - [ReadOnlyObservableCollection<T>](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1) ## System.Collections.Specialized - [BitVector32](https://learn.microsoft.com/dotnet/api/system.collections.specialized.bitvector32) - [CollectionsUtil](https://learn.microsoft.com/dotnet/api/system.collections.specialized.collectionsutil) - [HybridDictionary](https://learn.microsoft.com/dotnet/api/system.collections.specialized.hybriddictionary) - [ListDictionary](https://learn.microsoft.com/dotnet/api/system.collections.specialized.listdictionary) - [NameObjectCollectionBase](https://learn.microsoft.com/dotnet/api/system.collections.specialized.nameobjectcollectionbase): `BaseAdd`, `BaseClear`, `BaseGet`, `BaseGetAllKeys`, `BaseGetAllValues`, `BaseGetKey`, `BaseHasKeys`, `BaseRemove`, `BaseRemoveAt`, `BaseSet`, `Count`, `GetEnumerator`, `IsReadOnly`, `Keys`, `OnDeserialization` - [NameValueCollection](https://learn.microsoft.com/dotnet/api/system.collections.specialized.namevaluecollection): `Add`, `AllKeys`, `Clear`, `CopyTo`, `Get`, `GetKey`, `GetValues`, `HasKeys`, `InvalidateCachedArrays`, `Item`, `Remove`, `Set` - [NotifyCollectionChangedEventArgs](https://learn.microsoft.com/dotnet/api/system.collections.specialized.notifycollectionchangedeventargs) - [OrderedDictionary](https://learn.microsoft.com/dotnet/api/system.collections.specialized.ordereddictionary): `Add`, `AsReadOnly`, `Clear`, `Contains`, `CopyTo`, `Count`, `GetEnumerator`, `Insert`, `IsReadOnly`, `Item`, `Keys`, `OnDeserialization`, `Remove`, `RemoveAt`, `Values` - [StringCollection](https://learn.microsoft.com/dotnet/api/system.collections.specialized.stringcollection) - [StringDictionary](https://learn.microsoft.com/dotnet/api/system.collections.specialized.stringdictionary) - [StringEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.specialized.stringenumerator) ## System.Collections - [ArrayList](https://learn.microsoft.com/dotnet/api/system.collections.arraylist) - [BitArray](https://learn.microsoft.com/dotnet/api/system.collections.bitarray): `And`, `BitArray`, `Clone`, `CopyTo`, `Count`, `Get`, `GetEnumerator`, `IsReadOnly`, `IsSynchronized`, `Item`, `Length`, `Not`, `Or`, `Set`, `SetAll`, `SyncRoot`, `Xor` - [CaseInsensitiveComparer](https://learn.microsoft.com/dotnet/api/system.collections.caseinsensitivecomparer) - [CaseInsensitiveHashCodeProvider](https://learn.microsoft.com/dotnet/api/system.collections.caseinsensitivehashcodeprovider) - [CollectionBase](https://learn.microsoft.com/dotnet/api/system.collections.collectionbase) - [Comparer](https://learn.microsoft.com/dotnet/api/system.collections.comparer): `Compare`, `Comparer` - [DictionaryBase](https://learn.microsoft.com/dotnet/api/system.collections.dictionarybase) - [DictionaryEntry](https://learn.microsoft.com/dotnet/api/system.collections.dictionaryentry): `DictionaryEntry`, `Key`, `Value` - [Hashtable](https://learn.microsoft.com/dotnet/api/system.collections.hashtable): `Add`, `Clear`, `Clone`, `comparer`, `Contains`, `ContainsKey`, `ContainsValue`, `CopyTo`, `Count`, `EqualityComparer`, `GetEnumerator`, `GetHash`, `hcp`, `IsFixedSize`, `IsReadOnly`, `IsSynchronized`, `Item`, `KeyEquals`, `Keys`, `OnDeserialization`, `Remove`, `Synchronized`, `SyncRoot`, `Values` - [Queue](https://learn.microsoft.com/dotnet/api/system.collections.queue) - [ReadOnlyCollectionBase](https://learn.microsoft.com/dotnet/api/system.collections.readonlycollectionbase) - [SortedList](https://learn.microsoft.com/dotnet/api/system.collections.sortedlist) - [Stack](https://learn.microsoft.com/dotnet/api/system.collections.stack) - [StructuralComparisons](https://learn.microsoft.com/dotnet/api/system.collections.structuralcomparisons) ## System.ComponentModel.DataAnnotations - [MaxLengthAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.dataannotations.maxlengthattribute) - [RangeAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.dataannotations.rangeattribute) - [StringLengthAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.dataannotations.stringlengthattribute) ## System.ComponentModel - [CategoryAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.categoryattribute) - [DefaultValueAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.defaultvalueattribute): `Equals`, `GetHashCode`, `SetValue`, `Value` - [DescriptionAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.descriptionattribute) - [DisplayNameAttribute](https://learn.microsoft.com/dotnet/api/system.componentmodel.displaynameattribute) - [PropertyChangedEventArgs](https://learn.microsoft.com/dotnet/api/system.componentmodel.propertychangedeventargs) - [PropertyChangingEventArgs](https://learn.microsoft.com/dotnet/api/system.componentmodel.propertychangingeventargs) ## System.Diagnostics - [DebuggerBrowsableAttribute](https://learn.microsoft.com/dotnet/api/system.diagnostics.debuggerbrowsableattribute) - [DebuggerHiddenAttribute](https://learn.microsoft.com/dotnet/api/system.diagnostics.debuggerhiddenattribute) - [Stopwatch](https://learn.microsoft.com/dotnet/api/system.diagnostics.stopwatch) ## System.Linq - [Enumerable](https://learn.microsoft.com/dotnet/api/system.linq.enumerable): `Aggregate`, `All`, `Any`, `AsEnumerable`, `Average`, `Cast`, `Concat`, `Contains`, `Count`, `DefaultIfEmpty`, `Distinct`, `ElementAt`, `ElementAtOrDefault`, `Empty`, `Except`, `First`, `FirstOrDefault`, `GroupBy`, `GroupJoin`, `Intersect`, `Join`, `Last`, `LastOrDefault`, `LongCount`, `Max`, `Min`, `OfType`, `OrderBy`, `OrderByDescending`, `Range`, `Repeat`, `Reverse`, `Select`, `SelectMany`, `SequenceEqual`, `Single`, `SingleOrDefault`, `Skip`, `SkipWhile`, `Sum`, `Take`, `TakeWhile`, `ThenBy`, `ThenByDescending`, `ToArray`, `ToDictionary`, `ToList`, `ToLookup`, `Union`, `Where`, `Zip` - [EnumerableExecutor<T>](https://learn.microsoft.com/dotnet/api/system.linq.enumerableexecutor-1) - [EnumerableExecutor](https://learn.microsoft.com/dotnet/api/system.linq.enumerableexecutor) - [EnumerableQuery<T>](https://learn.microsoft.com/dotnet/api/system.linq.enumerablequery-1) - [EnumerableQuery](https://learn.microsoft.com/dotnet/api/system.linq.enumerablequery) - [Lookup<T>](https://learn.microsoft.com/dotnet/api/system.linq.lookup-2) - [Queryable](https://learn.microsoft.com/dotnet/api/system.linq.queryable): `Aggregate`, `All`, `Any`, `AsQueryable`, `Average`, `Cast`, `Concat`, `Contains`, `Count`, `DefaultIfEmpty`, `Distinct`, `ElementAt`, `ElementAtOrDefault`, `Except`, `First`, `FirstOrDefault`, `GroupBy`, `GroupJoin`, `Intersect`, `Join`, `Last`, `LastOrDefault`, `LongCount`, `Max`, `Min`, `OfType`, `OrderBy`, `OrderByDescending`, `Reverse`, `Select`, `SelectMany`, `SequenceEqual`, `Single`, `SingleOrDefault`, `Skip`, `SkipWhile`, `Sum`, `Take`, `TakeWhile`, `ThenBy`, `ThenByDescending`, `Union`, `Where`, `Zip` ## System.Reflection - [DefaultMemberAttribute](https://learn.microsoft.com/dotnet/api/system.reflection.defaultmemberattribute) ## System.Runtime.CompilerServices - [CallerLineNumberAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.callerlinenumberattribute) - [CallerMemberNameAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.callermembernameattribute) - [CompilerGeneratedAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.compilergeneratedattribute) - [ExtensionAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.extensionattribute) - [IsReadOnlyAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.isreadonlyattribute) - [IteratorStateMachineAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.iteratorstatemachineattribute) - [RuntimeHelpers](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.runtimehelpers): `Equals`, `InitializeArray` - [TupleElementNamesAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.tupleelementnamesattribute) ## System.Runtime.ConstrainedExecution - [ReliabilityContractAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.constrainedexecution.reliabilitycontractattribute) ## System.Runtime.InteropServices - [ComVisibleAttribute](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.comvisibleattribute) ## System.Security.Principal - [SecurityIdentifier](https://learn.microsoft.com/dotnet/api/system.security.principal.securityidentifier): `CompareTo` ## System.Security - [SecuritySafeCriticalAttribute](https://learn.microsoft.com/dotnet/api/system.security.securitysafecriticalattribute) ## System.Text - [Encoding](https://learn.microsoft.com/dotnet/api/system.text.encoding): `ASCII`, `BigEndianUnicode`, `BodyName`, `Clone`, `CodePage`, `Convert`, `DecoderFallback`, `Default`, `EncoderFallback`, `Encoding`, `EncodingName`, `Equals`, `GetDecoder`, `GetEncoder`, `GetEncoding`, `GetEncodings`, `GetHashCode`, `GetPreamble`, `GetString`, `HeaderName`, `IsAlwaysNormalized`, `IsBrowserDisplay`, `IsBrowserSave`, `IsMailNewsDisplay`, `IsMailNewsSave`, `IsReadOnly`, `IsSingleByte`, `RegisterProvider`, `Unicode`, `UTF32`, `UTF7`, `UTF8`, `WebName`, `WindowsCodePage` - [StringBuilder](https://learn.microsoft.com/dotnet/api/system.text.stringbuilder): `Append`, `AppendFormat`, `AppendLine`, `Capacity`, `Chars`, `Clear`, `EnsureCapacity`, `Length`, `MaxCapacity`, `Remove`, `Replace`, `StringBuilder`, `ToString` ## System.Threading - [Interlocked](https://learn.microsoft.com/dotnet/api/system.threading.interlocked) ## System - [ArgIterator](https://learn.microsoft.com/dotnet/api/system.argiterator) - [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception): `Message`, `ParamName` - [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) - [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception): `ActualValue`, `Message` - [ArithmeticException](https://learn.microsoft.com/dotnet/api/system.arithmeticexception) - [Array](https://learn.microsoft.com/dotnet/api/system.array): `AsReadOnly`, `BinarySearch`, `Clear`, `Clone`, `ConstrainedCopy`, `ConvertAll`, `Copy`, `CopyTo`, `CreateInstance`, `Empty`, `Exists`, `Find`, `FindAll`, `FindIndex`, `FindLast`, `FindLastIndex`, `ForEach`, `GetEnumerator`, `GetLongLength`, `GetUpperBound`, `GetValue`, `IndexOf`, `Initialize`, `IsFixedSize`, `IsReadOnly`, `IsSynchronized`, `LastIndexOf`, `Length`, `LongLength`, `Rank`, `Resize`, `SetValue`, `Sort`, `SyncRoot`, `TrueForAll` - [ArraySegment<T>](https://learn.microsoft.com/dotnet/api/system.arraysegment-1): `Array`, `ArraySegment`, `Count`, `Equals`, `GetHashCode`, `Offset`, `op_Equality`, `op_Inequality` - [ArrayTypeMismatchException](https://learn.microsoft.com/dotnet/api/system.arraytypemismatchexception) - [Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) - [BitConverter](https://learn.microsoft.com/dotnet/api/system.bitconverter): `DoubleToInt64Bits`, `GetBytes`, `Int64BitsToDouble`, `ToBoolean`, `ToChar`, `ToDouble`, `ToInt16`, `ToInt64`, `ToSingle`, `ToString`, `ToUInt16` - [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [Byte](https://learn.microsoft.com/dotnet/api/system.byte): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [Char](https://learn.microsoft.com/dotnet/api/system.char) - [CLSCompliantAttribute](https://learn.microsoft.com/dotnet/api/system.clscompliantattribute) - [Convert](https://learn.microsoft.com/dotnet/api/system.convert): `ChangeType`, `FromBase64CharArray`, `FromBase64String`, `GetTypeCode`, `IsDBNull`, `ToBase64CharArray`, `ToBoolean`, `ToByte`, `ToChar`, `ToDateTime`, `ToDecimal`, `ToDouble`, `ToInt16`, `ToInt32`, `ToInt64`, `ToSByte`, `ToSingle`, `ToString`, `ToUInt16`, `ToUInt32`, `ToUInt64` - [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) - [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) - [Decimal](https://learn.microsoft.com/dotnet/api/system.decimal): `Add`, `Ceiling`, `Compare`, `CompareTo`, `Decimal`, `Divide`, `Equals`, `Floor`, `FromOACurrency`, `GetBits`, `GetHashCode`, `GetTypeCode`, `Multiply`, `Negate`, `op_Addition`, `op_Decrement`, `op_Division`, `op_Equality`, `op_Explicit`, `op_GreaterThan`, `op_GreaterThanOrEqual`, `op_Implicit`, `op_Increment`, `op_Inequality`, `op_LessThan`, `op_LessThanOrEqual`, `op_Modulus`, `op_Multiply`, `op_Subtraction`, `op_UnaryNegation`, `op_UnaryPlus`, `Remainder`, `Round`, `Subtract`, `ToByte`, `ToDouble`, `ToInt16`, `ToInt32`, `ToInt64`, `ToOACurrency`, `ToSByte`, `ToSingle`, `ToString`, `ToUInt16`, `ToUInt32`, `ToUInt64`, `Truncate` - [Delegate](https://learn.microsoft.com/dotnet/api/system.delegate): `Clone`, `Combine`, `CombineImpl`, `CreateDelegate`, `Delegate`, `DynamicInvoke`, `DynamicInvokeImpl`, `Equals`, `GetHashCode`, `GetInvocationList`, `GetMethodImpl`, `Method`, `op_Equality`, `op_Inequality`, `Remove`, `RemoveAll`, `RemoveImpl`, `Target` - [DivideByZeroException](https://learn.microsoft.com/dotnet/api/system.dividebyzeroexception) - [Double](https://learn.microsoft.com/dotnet/api/system.double): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `IsInfinity`, `IsNaN`, `IsNegativeInfinity`, `IsPositiveInfinity`, `op_Equality`, `op_GreaterThan`, `op_GreaterThanOrEqual`, `op_Inequality`, `op_LessThan`, `op_LessThanOrEqual`, `ToString` - [Enum](https://learn.microsoft.com/dotnet/api/system.enum) - [Exception](https://learn.microsoft.com/dotnet/api/system.exception): `Data`, `GetBaseException`, `GetType`, `HelpLink`, `HResult`, `InnerException`, `Message`, `Source`, `StackTrace`, `TargetSite`, `ToString` - [FlagsAttribute](https://learn.microsoft.com/dotnet/api/system.flagsattribute) - [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) - [Guid](https://learn.microsoft.com/dotnet/api/system.guid): `CompareTo`, `Equals`, `GetHashCode`, `Guid`, `NewGuid`, `op_Equality`, `op_Inequality`, `ToByteArray`, `ToString` - [IndexOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.indexoutofrangeexception) - [InsufficientMemoryException](https://learn.microsoft.com/dotnet/api/system.insufficientmemoryexception) - [Int16](https://learn.microsoft.com/dotnet/api/system.int16): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [Int32](https://learn.microsoft.com/dotnet/api/system.int32): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [Int64](https://learn.microsoft.com/dotnet/api/system.int64): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [InvalidCastException](https://learn.microsoft.com/dotnet/api/system.invalidcastexception) - [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) - [Math](https://learn.microsoft.com/dotnet/api/system.math): `Abs`, `BigMul`, `Ceiling`, `DivRem`, `Floor`, `IEEERemainder`, `Log`, `Max`, `Min`, `Round`, `Sign`, `Truncate` - [MathF](https://learn.microsoft.com/dotnet/api/system.mathf) - [MemberAccessException](https://learn.microsoft.com/dotnet/api/system.memberaccessexception) - [MulticastDelegate](https://learn.microsoft.com/dotnet/api/system.multicastdelegate): `CombineImpl`, `DynamicInvokeImpl`, `Equals`, `GetHashCode`, `GetInvocationList`, `GetMethodImpl`, `MulticastDelegate`, `op_Equality`, `op_Inequality`, `RemoveImpl` - [MulticastNotSupportedException](https://learn.microsoft.com/dotnet/api/system.multicastnotsupportedexception) - [NotFiniteNumberException](https://learn.microsoft.com/dotnet/api/system.notfinitenumberexception): `OffendingNumber` - [NotImplementedException](https://learn.microsoft.com/dotnet/api/system.notimplementedexception) - [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) - [Nullable<T>](https://learn.microsoft.com/dotnet/api/system.nullable-1) - [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable) - [NullReferenceException](https://learn.microsoft.com/dotnet/api/system.nullreferenceexception) - [Object](https://learn.microsoft.com/dotnet/api/system.object): `Equals`, `GetHashCode`, `Object`, `ReferenceEquals`, `ToString` - [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception): `Message`, `ObjectName` - [ObsoleteAttribute](https://learn.microsoft.com/dotnet/api/system.obsoleteattribute) - [OutOfMemoryException](https://learn.microsoft.com/dotnet/api/system.outofmemoryexception) - [ParamArrayAttribute](https://learn.microsoft.com/dotnet/api/system.paramarrayattribute) - [Progress<T>](https://learn.microsoft.com/dotnet/api/system.progress-1): `OnReport`, `Progress` - [Random](https://learn.microsoft.com/dotnet/api/system.random) - [RuntimeFieldHandle](https://learn.microsoft.com/dotnet/api/system.runtimefieldhandle): `Equals`, `GetHashCode`, `op_Equality`, `op_Inequality`, `Value` - [RuntimeTypeHandle](https://learn.microsoft.com/dotnet/api/system.runtimetypehandle): `Equals`, `GetHashCode`, `GetModuleHandle`, `op_Equality`, `op_Inequality`, `Value` - [SByte](https://learn.microsoft.com/dotnet/api/system.sbyte): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [SerializableAttribute](https://learn.microsoft.com/dotnet/api/system.serializableattribute) - [Single](https://learn.microsoft.com/dotnet/api/system.single): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `IsInfinity`, `IsNaN`, `IsNegativeInfinity`, `IsPositiveInfinity`, `op_Equality`, `op_GreaterThan`, `op_GreaterThanOrEqual`, `op_Inequality`, `op_LessThan`, `op_LessThanOrEqual`, `ToString` - [String](https://learn.microsoft.com/dotnet/api/system.string) - [StringComparer](https://learn.microsoft.com/dotnet/api/system.stringcomparer): `Compare`, `Create`, `CurrentCulture`, `CurrentCultureIgnoreCase`, `Equals`, `GetHashCode`, `InvariantCulture`, `InvariantCultureIgnoreCase`, `Ordinal`, `OrdinalIgnoreCase`, `StringComparer` - [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan): `Add`, `Compare`, `CompareTo`, `Days`, `Duration`, `Equals`, `FromDays`, `FromHours`, `FromMilliseconds`, `FromMinutes`, `FromSeconds`, `FromTicks`, `GetHashCode`, `Hours`, `Milliseconds`, `Minutes`, `Negate`, `op_Addition`, `op_Equality`, `op_GreaterThan`, `op_GreaterThanOrEqual`, `op_Inequality`, `op_LessThan`, `op_LessThanOrEqual`, `op_Subtraction`, `op_UnaryNegation`, `op_UnaryPlus`, `Parse`, `ParseExact`, `Seconds`, `Subtract`, `Ticks`, `TimeSpan`, `ToString`, `TotalDays`, `TotalHours`, `TotalMilliseconds`, `TotalMinutes`, `TotalSeconds`, `TryParse`, `TryParseExact` - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-1) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-2) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-3) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-4) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-5) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-6) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-7) - [Tuple<T>](https://learn.microsoft.com/dotnet/api/system.tuple-8) - [Tuple](https://learn.microsoft.com/dotnet/api/system.tuple) - [Type](https://learn.microsoft.com/dotnet/api/system.type): `Attributes`, `ContainsGenericParameters`, `DeclaringMethod`, `DeclaringType`, `DefaultBinder`, `Equals`, `FindInterfaces`, `FindMembers`, `GenericParameterAttributes`, `GenericParameterPosition`, `GenericTypeArguments`, `GetArrayRank`, `GetConstructor`, `GetConstructors`, `GetDefaultMembers`, `GetEnumName`, `GetEnumNames`, `GetEnumUnderlyingType`, `GetEnumValues`, `GetEvent`, `GetEvents`, `GetField`, `GetFields`, `GetGenericArguments`, `GetGenericParameterConstraints`, `GetGenericTypeDefinition`, `GetHashCode`, `GetInterface`, `GetInterfaceMap`, `GetMember`, `GetMembers`, `GetMethod`, `GetMethods`, `GetNestedType`, `GetNestedTypes`, `GetProperties`, `GetProperty`, `GetType`, `GetTypeArray`, `GetTypeCode`, `GetTypeCodeImpl`, `GetTypeFromCLSID`, `GetTypeFromHandle`, `GetTypeFromProgID`, `GetTypeHandle`, `HasElementType`, `InvokeMember`, `IsAbstract`, `IsAnsiClass`, `IsArray`, `IsAssignableFrom`, `IsAutoClass`, `IsAutoLayout`, `IsByRef`, `IsClass`, `IsCOMObject`, `IsConstructedGenericType`, `IsContextful`, `IsContextfulImpl`, `IsEnum`, `IsEnumDefined`, `IsEquivalentTo`, `IsExplicitLayout`, `IsGenericParameter`, `IsGenericType`, `IsGenericTypeDefinition`, `IsImport`, `IsInstanceOfType`, `IsInterface`, `IsLayoutSequential`, `IsMarshalByRef`, `IsMarshalByRefImpl`, `IsNested`, `IsNestedAssembly`, `IsNestedFamANDAssem`, `IsNestedFamily`, `IsNestedFamORAssem`, `IsNestedPrivate`, `IsNestedPublic`, `IsNotPublic`, `IsPointer`, `IsPrimitive`, `IsPublic`, `IsSealed`, `IsSecurityCritical`, `IsSecuritySafeCritical`, `IsSecurityTransparent`, `IsSerializable`, `IsSpecialName`, `IsSubclassOf`, `IsUnicodeClass`, `IsValueType`, `IsValueTypeImpl`, `IsVisible`, `MakeArrayType`, `MakeByRefType`, `MakeGenericType`, `MakePointerType`, `MemberType`, `op_Equality`, `op_Inequality`, `ReflectedType`, `ReflectionOnlyGetType`, `StructLayoutAttribute`, `ToString`, `Type`, `TypeHandle`, `TypeInitializer` - [UInt16](https://learn.microsoft.com/dotnet/api/system.uint16): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [UInt64](https://learn.microsoft.com/dotnet/api/system.uint64): `CompareTo`, `Equals`, `GetHashCode`, `GetTypeCode`, `ToString` - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-1) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-2) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-3) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-4) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-5) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-6) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-7) - [ValueTuple<T>](https://learn.microsoft.com/dotnet/api/system.valuetuple-8) - [ValueTuple](https://learn.microsoft.com/dotnet/api/system.valuetuple) - [ValueType](https://learn.microsoft.com/dotnet/api/system.valuetype) - [Version](https://learn.microsoft.com/dotnet/api/system.version): `CompareTo` Source: https://docs.sansar.com/scripting/allowed-dotnet-apis --- # Patch notes - [47.12.0](/patch-notes/47-12-0) (2026-11-20): Four big things arrive in 47.12.0, and you'll run into the first two almost everywhere you go. - [47.11.0](/patch-notes/47-11-0) (2026-11-08): Use scripted world menus in VR and navigate a clearer Lookbook. Build worlds with rain, changing atmosphere, wet surfaces, custom HUDs and synchronized visual effects, with more world-building… - [47.10.0](/patch-notes/47-10-0) (2026-11-01): Dictate text in the Windows client, switch between saved accounts, and choose where your next visit begins. Bring your worlds through day and night with changing lighting, then shape the action with… - [47.9.0](/patch-notes/47-9-0) (2026-10-18): Find Gaussian splats in their own Store category, and create editable scenes through the Sansar Client API. - [47.8.3](/patch-notes/47-8-3) (2026-10-12): Bugs fixed: Crashes or freezes when entering or moving around worlds with mirrors. - [47.8.2](/patch-notes/47-8-2) (2026-10-12): Expanded Sansar Client API capabilities let external applications, including AI-controlled players, travel, chat, shop and interact in Sansar. - [47.8.1](/patch-notes/47-8-1) (2026-10-11): Find your way around My Worlds with separate tabs and a badge for pending invitations. - [47.8.0](/patch-notes/47-8-0) (2026-10-11): Edit your world together with guest builders, with voice and text chat during live edit sessions. - [47.7.0](/patch-notes/47-7-0) (2026-10-07): Organize your inventory with folders, and use expanded Sansar Client API features to customize avatars, configure interactions and import Gaussian splats. - [47.6.1](/patch-notes/47-6-1) (2026-10-01): Bugs fixed: Some purchased scenes not reopening in the editor. - [47.6.0](/patch-notes/47-6-0) (2026-10-01): Automate world building on Windows with the new Sansar Client API, from importing Blender assets to publishing worlds. - [47.5.0](/patch-notes/47-5-0) (2026-09-26): Toggle for eye-tracking added to settings panel. - [47.3.0](/patch-notes/47-3-0) (2026-09-21): Teleport effect when teleporting in or out of a world. - [47.2.0](/patch-notes/47-2-0) (2026-09-15): Streamline load skipped entirely on AMD GPUs. - [47.1.0](/patch-notes/47-1-0) (2026-09-11): Ghost-lights have been exorcised. - [46.6.2](/patch-notes/46-6-2) (2026-03-03): Custom avatars can now support blend shapes/shape keys on import; defaults have not been updated to include these yet. - [46.5.1](/patch-notes/46-5-1) (2026-01-21): Added player camera smoothing with settings toggle - [46.3.4](/patch-notes/46-3-4) (2025-12-06): Fixes: Multiple crash/freeze issues when changing worlds with media loaded. - [46.3.2](/patch-notes/46-3-2) (2025-12-01): 4 different Media streams can now be supported in the same world and objects displaying them - [46.2.2](/patch-notes/46-2-2) (2025-11-01): Bug Fixes: Audio now works correctly with 4 channel microphones., - [46.1.11](/patch-notes/46-1-11) (2025-10-24): New launcher created you must redownload from the website and it should handle everything, recommended to do a clean install but not necessary. - [46.1.5](/patch-notes/46-1-5) (2025-09-02): Diffractive glass effect for transparent UI panels. - [46.1.2](/patch-notes/46-1-2) (2025-07-24): Server upgrades and backend inventory work. (no visible changes) - [46.1.1](/patch-notes/46-1-1) (2025-05-24): Final major update to reflections. They have now reached their final form. - [46.0.10](/patch-notes/46-0-10) (2025-04-24): Respawn button added to Desktop and VR in the 'Go' Panel - [46.0.0](/patch-notes/46-0-0) (2025-03-21): Significantly improved quality of screen-space reflections along with improved performance. - [45.0.30](/patch-notes/45-0-30) (2024-07-31): Scroll wheel now changes camera speed in edit mode. - [45.0.28](/patch-notes/45-0-28) (2024-03-30): Bug Fixes: Fixed some broken links in game - [45.0.25](/patch-notes/45-0-25) (2024-02-19): HotFixes for last patch - [45.0.22](/patch-notes/45-0-22) (2024-02-16): REFLECTIONS ADDED! Must be enabled in settings 'Graphics/VR' as this is considered resource-intensive. The reflectivity of objects is controlled by the existing Roughness maps; some objects may need… - [45.0.20](/patch-notes/45-0-20) (2024-02-09): Driving mode created: you must now jump, crouch, or teleport to exit any sitpoint to allow scripts to use regular movement controls for vehicles. - [45.0.19](/patch-notes/45-0-19) (2024-01-29): Added advanced settings panel. - [45.0.17](/patch-notes/45-0-17) (2024-01-25): T Teleport Defaulted to OFF - [45.0.16](/patch-notes/45-0-16) (2024-01-16): Improved avatar LOD 0 range to be further out. - [45.0.14](/patch-notes/45-0-14) (2024-01-10): Bugfix: Minor shader fixes. - [45.0.12](/patch-notes/45-0-12) (2024-01-09): Bugfix: Fix for diffracted water not diffracting - [45.0.11](/patch-notes/45-0-11) (2024-01-09): Added a media screen to backpack, will only show existing media in world does not contain a media script of its own - [45.0.9](/patch-notes/45-0-9) (2024-01-03): Basejump from freecam location with 'T' - [45.0.8](/patch-notes/45-0-8) (2023-12-22): Added new backpack items and item removal controls - [45.0.5](/patch-notes/45-0-5) (2023-10-10): A fix for the snapshot function creating SDR images that were too washed out when HDR is enabled. - [45.0.1](/patch-notes/45-0-1) (2023-09-29): Improved handling of HDR should only be visible with it enabled in pc settings - [45.0.0](/patch-notes/45-0-0) (2023-09-20): The Displacement Shader Update is here! - [44.3.0](/patch-notes/44-3-0) (2023-06-12): IJKL keyboard control for the camera. Helps players with no mouse - [44.2.2](/patch-notes/44-2-2) (2023-02-12): Small fixit patch - [44.2.0](/patch-notes/44-2-0) (2023-02-19): Added TV Mode, Game Streaming Mode, and Guest Mode - [44.1.0](/patch-notes/44-1-0) (2023-02-03): Individual volume controls V1 - [44.0.0](/patch-notes/44-0-0) (2023-01-17): Bug Fixes: Edit mode list type crash - [43.5.5](/patch-notes/43-5-5) (2022-06-16): Small update for VR arm bug - [43.5.0](/patch-notes/43-5-0) (2022-06-07): Small Update for re-enable Auto-Occlusion in Edit Mode Source: https://docs.sansar.com/patch-notes --- # Sansar 47.12.0 patch notes Released November 20, 2026. Four big things arrive in 47.12.0, and you'll run into the first two almost everywhere you go. **Weather comes to Sansar.** Worlds can now storm. Volumetric clouds roll across the sky on the wind and throw shadows on the ground, rain comes down, lightning strikes and lights up the clouds and the ground, and thunder rolls in after each flash. You hear all of it: wind, thunder, and rain on roofs, metal, water, foliage and glass. Everyone in the world sees the same bolt at the same moment. Creators build it all in the new **Scene Weather** panel, with eight presets that run from Clear to Night storm. You can't fly up into the clouds yet; that's on our list for a future release. **Attach objects to avatars, and carry your friends.** Scripts can now attach objects to avatar bones, so a world can put a hat on your head, a pack on your back or a prop in your hand, and it stays with you on desktop and in VR. Here's the fun part: attached objects can have seats, and that means avatars can carry other avatars. Pick someone up and walk off with them, or wear something other avatars can sit on. This is only the beginning, with more to come for attachments in future releases. **Combat is built in.** Scripts now have native combat: hit volumes on objects and avatars, health and other attributes, effects and statuses, and fast projectiles that the world itself moves and hit-tests, streaking by as glowing tracers on desktop and in VR. Who knows what kind of chaos creators are going to build with this. It's going to be great. **The toon shader is here.** Give surfaces a cartoon look with new toon materials: lighting that falls in cel-shaded bands, rim light and outlines. Use it on one object or style a whole world. There's a lot more in the list below. ## New - Sansar has a new speech animation system that moves the mouths of residents and Sansar AI characters as they speak. It will keep improving over time and opens up possibilities for future capabilities. - Custom avatars with face weights keep lip sync with no changes. - Avatars with face weights now blink and move their eyes naturally, even when they aren't speaking. - Choose how many nearby faces animate with **Animated faces** in Graphics settings. **Auto** follows your graphics quality. - Watch volumetric clouds roll across the sky with wind and ground shadows, and storms with lightning strikes, in-cloud flashes and crawling bolts that light up the clouds and the ground. Every visitor sees the same bolts at the same moment. - Weather is chosen per scene. Worlds that don't use it look and perform as before. - You can't fly into the clouds yet. That's on our list for the future. - Hear the weather: rain on roofs, metal, water, foliage and glass, wind, and thunder that rolls in after each lightning flash. Set its level with the new **Weather** volume in Audio settings, and turn on **Soften loud sounds** to lower thunder and round off sharp sounds. - Turn clouds off for yourself with **Clouds** under Settings → Graphics → Environment. The world's sky, rain and wetness stay, and other visitors are unaffected. - Author weather in edit mode with **Tools → Scene Weather**: sky, clouds, lightning, rain, wetness, weather volumes and sound in one panel, with undo and eight presets (Clear, Fair, Overcast, Storm, Night storm, Dawn, Twilight and Clear midnight). Weather is saved with the scene and published with the world. - Light scenes with the new **Atmosphere** sky: a computed sky with sun, moon, stars, twilight and night that follows the scene's time of day. Skybox remains the default. - Set your VR brightness separately from desktop. In VR, the brightness row reads **Adjust brightness (VR)**. - Make the VR Settings panel larger with **Settings panel size (VR only)**, from 100% to 200%. - Clear a world's Nearby chat for everyone as its owner, with the new **Chat Clear** button in the Moderation panel on desktop and in VR, or by typing `%%chat-clear`. - Chat Clear applies to the world instance you are in. - Give surfaces a cartoon look with toon materials: **Toon: Standard**, **Toon: Emissive** and **Toon: Standard + Emissive**, with banded lighting, rim light and outlines. - Mask dirt in grass with the blue channel of the **Grass Density Map**: at 0 the grass shows the surface's own **Grass Albedo Map** and **Grass Normal Map**, at 1 it shows dirt as before, and values in between blend the two. - Reduce the triangle count of static meshes with the new **Decimation** property in edit mode, and generate Mesh collision from a mesh's render geometry with its own **Decimation** setting. - Not available for meshes with blend shapes. - Show both eyes side by side, or either eye, in the desktop window while in VR with the `-vrMirrorMode` launch option (`LeftEye`, `BothEyes` or `RightEye`). Headsets still show the left eye by default. - Keep private notes on each AI NPC in the NPC creator, up to 2,000 characters. Notes never change how the NPC talks. - Attach objects to avatar bones from scripts with new `ObjectPrivate.AttachTo` overloads and `AvatarBone`, and inspect them with `AgentPrivate.HasBone`, `AgentPrivate.GetBoneTransform`, `AgentPrivate.GetAttachedObjects` and `AttachmentInfo.Bone`. Attached objects follow the avatar on desktop and in VR, and seats on attached objects can carry seated avatars. - Head attachments are hidden from the wearer's own first-person and VR view. Attached seats can be sat on but not grabbed, and don't collide. Avatars without the requested bone refuse the attachment; check with `HasBone` first. - Build combat with `ScenePrivate.Combat`: create a `CombatArena`, register objects and avatars as targets with hit volumes, cast rays and spheres, test overlaps, define attributes, effects and statuses, and launch volleys with `CombatArena.LaunchProjectiles`. Projectiles are moved and hit-tested by the world, and drawn as glowing tracers on desktop and in VR in styles set with `CombatArena.DefineProjectileStyle`. - An arena belongs to the script that created it and is removed when that script stops. - Script the sky with `ScenePrivate.SetClouds`, `ScenePrivate.ClearClouds` and `ScenePrivate.GetCloudsOverride`, and lightning with `ScenePrivate.SetLightning`, `ScenePrivate.ClearLightning`, `ScenePrivate.GetLightningOverride` and `ScenePrivate.AddLightningEvents`. Clearing an override returns to the scene's saved weather. - Each instance of a world runs its own weather. - A `LightningEventType.Strike` event's `Position` sets where the bolt starts in the clouds, so it can reach the ground up to 300 m from that point. - Script weather sound with `ScenePrivate.SetWeatherSound`, `ScenePrivate.ClearWeatherSound` and `ScenePrivate.GetWeatherSoundOverride`. - Choose how a megaphone is announced with `ScenePrivate.SetMegaphone` and `MegaphoneFeedback`: a chat line (`Chat`), a notification for other players instead (`Toast`), or nothing (`None`). - Give desktop players a scene-camera view with a free cursor using `Client.SetActiveCamera` with `ScriptCameraOptions`, optionally following the player along chosen world axes with dead zones, smoothing and bounds. Players can still walk, run and jump in `AgentControlOnly` mode. Check whether a player is on desktop or in VR with `Client.InputMode` and `Client.SubscribeToInputModeChanged`. - Show a Back button on scripted menus with new `UIMenu.Show` and `UIMenu.ShowStyled` overloads that take `showBackButton`. Back reports `SelectedIndex` -1 and `SelectedItem` "back", and the menu stays open. Passive menus never show Back. - Keep an attached object at the visible end of a stretch-to-hit beam with `AttachOptions.FollowParentStretchEnd`, turn it to face the hit surface with `AttachOptions.OrientToHitNormal`, and hide it when nothing is hit with `AttachOptions.HideWhenNoHit`. - Add up to 64 entries to script list parameters, up from 20. - Scripts already in a scene keep the 20-entry limit until you update them. - Add solid or trigger collision volumes, and sit points, to existing objects through the Sansar Client API, without reimporting the model. - Each body takes one sit point. - Create scene cameras and edit their field of view, set Atmosphere sky properties, and apply weather presets and weather volumes through the Sansar Client API. - Replace a placed model through the Sansar Client API after a material preset renamed one of its parts, or when the replacement's mesh was renamed. Map old mesh names to new ones when they can't be matched automatically. - Read object rotations in nearby-object listings, clear Nearby chat with a moderation command, and read frame-time statistics through the Sansar Client API. ## Changes - Custom grass density maps now control dirt with their blue channel. Maps whose blue channel is 0, such as maps painted only in red and green, no longer show dirt; paint blue at full value to keep the previous look. This applies as soon as visitors update, without rebuilding the world. The default density map looks the same as before. - World scripts can attach objects to any avatar in their world without asking the player first. Objects the script created are removed when the player leaves. - Script resource lists now keep empty entries in place: an empty slot arrives as `null` at the same index as in the editor. Scripts that stop at the first `null` may now stop early. - `Mover` commands on an object a player is holding now fail with "object is held", and grabbing an object cancels its queued moves. New commands work again after release. - Dynamic objects whose collision is made of scaled parts now collide at their visible size once their collision is converted to hulls. If you compensated for the old size, check these objects after rebuilding. - When recompiling scripts that pass bare `default` as the callback to `UIMenu.Show` or `UIMenu.ShowStyled`, use `handler: default` or `null` instead to avoid an ambiguous call. - Turn every volume slider up without distortion: a limiter now keeps Sansar's combined output from clipping. - Ray-Traced Lighting now shows reflections through and of glass panes, refracting glass, smooth transparent surfaces and grass in reflections, handles many lights and distant avatars more efficiently, and turns on without a hitch. **Ambient Occlusion** is disabled while it is on. - In VR, **Ray-Traced Lighting** and **Frame Generation** show Off and can't be changed. Your desktop choices return when you leave VR. - Sansar switches to desktop mode when your headset's system menu stays open for a few seconds, and returns to VR when you come back. - VR renders at your chosen resolution on graphics cards with less video memory, and DLSS works on high-resolution headsets. - Script hint text in VR now stays in view when you turn your head. - See other players' held objects, VR hands and avatars carried on held seats move smoothly instead of in steps. Avatars sitting on a seat someone is carrying stay locked to it. - When aiming a held object at your cursor on desktop, your hand now raises to the aim faster and no longer snaps to your hip and back. - Settings are reorganized into **Graphics** and **Advanced/VR** tabs. VR options sit under a VR heading on Advanced/VR, and **Clouds** under a new Environment section on Graphics. - Settings now tells you when VSync is limiting your frame rate below **Max foreground FPS**. - Follow shader preparation on the startup screen with a percentage and progress bar, with no black window between startup and login. - Frames take less time to prepare, for smoother frame rates. - All Sansar program files are now digitally signed, so Sansar can run on PCs that only allow signed software. - Hide and lock settings changed since your last save now survive editor resynchronization; only undo history resets. - An open properties panel now updates when a script's list parameters are changed elsewhere, such as through the Sansar Client API. - The AI NPC creator now shows a lasting warning when Test Conversation fails, and won't save a new or changed agent link that is known not to work. - Sansar Client API scene saves and builds now say why an upload failed, and removing an object without children no longer requires including children. ## Bugs fixed - Crashes when opening a script's properties in edit mode. - Crashes when creating a world right after a "World already exists" error. - Crashes when selecting an object that had just been removed in edit mode. - Crashes when leaving edit mode while a web media surface was loading, and when a media surface appeared after web media had failed to start. - Crashes when leaving a view while typing in a text field, such as Lookbook search, AI NPC fields or player search. - Crashes when entering edit mode while in VR, and Sansar not closing cleanly when quit while in VR. - Crashes while emote reaction thumbnails were loading. - Crashes when quitting with unsaved Lookbook changes while an item transform tool was active, and when pressing a key as Sansar closed after a graphics error. - Sansar hanging on quit after many inventory updates. - Worlds freezing or crashing while loading their scripts. - Passing a held object from one VR hand to the other dropping it. - Errors when releasing a held object in VR without turning your hand. - Sansar staying in desktop mode after SteamVR's first headset report, and a delay at startup when SteamVR is installed without a headset connected. - Scripted moving objects briefly turning dark while their outlines stayed visible. - Lookbook item transform controls being cut off at high display scaling. - Pressing Ctrl+Z while a material editor Apply was still preparing undoing only part of it, and a canceled or applied material preview's texture reappearing. - Very small rotation edits, under 0.01°, being ignored in edit mode. - `List` script parameters receiving the wrong type. - Adding a trigger volume through the Sansar Client API to an object that already had a collider crashing Sansar. - Sansar Client API light edits failing with a revision conflict, and lights offering component removal they don't support. - Sansar Client API view captures stalling the live view for up to a second. - Sansar Client API nearby-object listings reporting Keyframed objects with **Can Grab** as not grabbable. Source: https://docs.sansar.com/patch-notes/47-12-0 --- # Sansar 47.11.0 patch notes Released November 8, 2026. Use scripted world menus in VR and navigate a clearer Lookbook. Build worlds with rain, changing atmosphere, wet surfaces, custom HUDs and synchronized visual effects, with more world-building controls available to external applications through the Sansar Client API. ## New - Use scripted world menus in VR: point and pull the trigger to choose, and hold the controller stick to scroll long lists. - Show shared or player-specific text, progress bars and countdowns on desktop and in VR with `ScenePrivate.Hud` and `Client.UI.Hud`. - These displays do not take input. Images and interactive controls are not supported. - Add rain with wind and smooth fades, and define up to 32 dry shelter boxes with `ScenePrivate.SetPrecipitation` and `ScenePrivate.SetPrecipitationExclusions`. - Rain and shelter settings must be restored by startup scripts. - Make opaque surfaces and avatars wet and dry inside up to eight scripted regions with `ScenePrivate.SetSurfaceWetness` and `ScenePrivate.SetSurfaceWetnessRegions`; rain shelters stay dry. - Wetness is opt-in. Animated ripples are not available. - Blend fog, exposure and bloom for everyone or for one player with `ScenePrivate.SetAtmosphere`, `AgentPrivate.SetAtmosphere` and their clearing methods. Clearing an override blends back to the underlying scene settings. - Start and stop synchronized vertex animation texture (VAT) and flipbook effects with `RenderMaterial.PlayAnimation` and `RenderMaterial.StopAnimation`, including effects already in progress when a player joins. - Scroll, offset, scale and mirror supported material textures from scripts with `MaterialProperties.UvMode`, `MaterialProperties.ScrollSpeed`, `MaterialProperties.UvOffset` and `MaterialProperties.UvScale`; check support with `RenderMaterial.SupportsUvTransform`. - Animate the proportions of scriptable meshes, including billboard and lollipop materials, with `MeshComponent.SetRenderScale`. - This changes appearance only; collision, child placement and positions read by scripts do not change. - Stretch visual beams to the nearest eligible collision hit with `MeshComponent.SetRenderStretchToHit`, with options for length limits, ignored objects and what happens when nothing is hit. - Supports up to 32 enabled, unrigged scriptable meshes per client. For camera-facing materials, only lollipops that inherit orientation, stretch along local Z and have an origin on that axis are supported. - Attach runtime objects to other objects, including held parents, with `ObjectPrivate.AttachTo`, `ObjectPrivate.Detach` and `ObjectPrivate.GetAttachment`, with optional timed transitions. - Attached children cannot collide or be grabbed. Children must have a single body or be script-movable objects without colliders; held children and avatar-bone attachments are not supported. - Let the desktop third-person camera turn toward the player's heading automatically from scripts with `Client.SetCameraAutoCenter`. It starts after one second without camera input and leaves pitch under manual control. - First person and VR ignore this mode. Leaving a seat, switching directly to another seat or leaving the world turns it off; sideways and backward movement while standing pause recentering. - Test VR views and controls without a headset using simulated VR in the Windows client. External applications, automation tools and AI-controlled players can drive its head, hands and controls through the Sansar Client API. - Sansar Client API access requires **Allow local API access** and is local to your Windows account and sign-in session. - Simulated VR is off by default; launch with `-simulateVR true` to enable it. API entry, exit, pose and input controls apply only to the simulator; reading VR state also works with a real headset. - Import bone-animated and rigged GLB props through the Sansar Client API, inspect their clips and play them with the in-world `AnimationComponent` API. - Supports one shared skin, up to 255 joints and named bone clips using LINEAR or STEP interpolation. Apply bone, armature and ancestor scale before export; moving unskinned nodes, morph animation, CUBICSPLINE channels, extra joint/weight sets and separate collision files are unsupported. - Bake VAT assets with the bundled Blender tools and import signed OpenEXR maps through the Sansar Client API for VAT and displacement materials. - OpenEXR support is limited to VAT and displacement maps; other texture processing types still require PNG. Deep and multipart EXR files are unsupported. - Create spawn points and audio components through the Sansar Client API, and check for a missing spawn point before building a scene. - Audio uses sounds from the signed-in account's inventory, subject to ownership and content permissions. Removing audio components and moving or removing embedded spawn components are unsupported; a spawn point can be moved or removed through its owning object. - Set static-mesh scriptability, initial visibility, draw distances and scale, and configure atmosphere, time of day, skyboxes and color grading textures through the Sansar Client API. - Skybox and color grading textures must come from inventory the account owns, with the appropriate texture type. - Bind `ClusterResource` and `TextureResource` script inputs, and lists of supported values and resources, through the Sansar Client API with inventory ownership and content permission checks. - List writes replace the whole list and follow the script parameter's limits, up to 20 entries. Resource lists support `SoundResource`, `ClusterResource` and `TextureResource`. - Replace the visual source of Dynamic and Keyframed objects through the Sansar Client API while keeping their scripts, settings, transforms and identities. - Collision must match unless the application explicitly chooses to keep the existing collider; the replacement's appearance may then differ from its collision. Imports with joints, multiple shapes per entity or imported meshless entities remain unsupported. - Find scenes more quickly through the Sansar Client API: list names first, then resolve only the selected scene's saved source. ## Changes - Navigate Lookbook with larger category tabs, a direct Accessories shortcut, item-source controls beside the items, and clearer preview labels and camera hints. **BROWSE STORE** opens all categories; **SHOP THIS CATEGORY** opens the current category beside your avatar. - Hold Shift while dragging a ring with the desktop editor's Rotate tool to rotate in 15-degree steps from the starting pose; release Shift for smooth rotation. - Choose the highlighted or first matching result with Enter in searchable editor property pickers, or press Escape to close the picker and keep the current value. With no matches, Enter leaves the picker open. - Undo and redo resource-picker choices, skybox and color grading choices, and **Add > Script** in edit mode. - Update Sansar and reopen edit sessions started before this release before editing materials. Material editing requires matching, updated clients and edit sessions. - Open scenes with complex hidden static collision shapes sooner: their display meshes are prepared when shown instead of on every scene open. - Showing **Physics shapes** can still pause while a complex shape's display is prepared. - Bake lighting even when available graphics memory is insufficient: light bakes use the CPU. A stalled GPU bake now reports failure, and quitting after it no longer waits indefinitely for that bake. - When objects approach the world boundary, scene objects now return to their original placement and objects created by scripts are deleted; avatars return to the nearest spawn point. - Eye adaptation now follows the underexposure and overexposure correction rates saved with the scene. - A saved rate of zero stops adaptation in that direction except on camera cuts. - Static meshes now appear according to their saved minimum draw distance after the world is rebuilt. - Read the last held pose for `ControlPointType.DesktopGrab` after a desktop grab ends with `AgentPrivate.GetControlPointPosition` and `AgentPrivate.GetControlPointOrientation`; `AgentPrivate.GetControlPointEnabled` continues to indicate whether that control point is enabled. ## Bugs fixed - Crashes in worlds containing interactive screens on objects that are not static. - Crashes in Lookbook. - Worlds crashing while their scripts load. - Freezes while opening edit mode on accounts with many material presets. - Crashes when switching a material's shader, combining objects or closing a scene while material loads are pending. - Crashes when item source or permission information fails to load during material-preset permission changes or listing creation. - Crashes when entering VR with a scene open in edit mode. - Crashes after quitting, including after copying materials, and shutdown hangs while a network address lookup is pending. - Startup hangs when another application launches Sansar with an input pipe left open. - Launch tools that send startup configuration through standard input must now opt in with `-configPipe true`. - Ray-Traced Lighting being enabled below High graphics quality. - It remains limited to supported DirectX 12 hardware at High quality on desktop and is unavailable in VR. Returning to High restores the saved setting. - Fine reflective details on metallic surfaces being blurred by Ray-Traced Lighting. - Thin dark lines along the horizon at the sides of the VR view. - Returning from VR in first person after previously choosing third person on desktop. - Scripted menus disappearing after switching between desktop and VR, long titles hiding their choices, and passive menus blocking clicks through to the world. - VR buttons activating when a press was released away from the panel. - Scoreboard, hint and progress-bar updates interrupting desktop mouse-look or blocking world clicks. - Quest error dialogs and the VR login Terms of Service dialog appearing without buttons. - Settings controls, including Apply and Cancel, falling off the bottom of the window at 150% display scale. - Misplaced or invalid panels when starting minimized or switching workspaces while minimized. - Escape opening the main menu instead of dismissing an editor context menu. - Shift, Ctrl or Alt appearing released when one side of the keyboard was released while the other remained held. - Lookbook Randomize removing clothing when a complete compatible outfit was unavailable. - Canceling an unchanged Lookbook Transform discarding redo history or adding an empty undo step. - The first tutorial slide appearing blank. - Dismissing a failed world-visit message closing edit mode and discarding unsaved changes, or leaving Lookbook stuck trying to depart. - Repeated close requests showing overlapping warnings while the Item Material Editor was open. - Searchable editor pickers showing empty lists, failing to apply None or Generic to mixed selections, or crashing during rapid selection and confirmation. - Quest, objective and quest-character property labels showing incorrect names. - Undo and redo losing script parameter edits after undoing a script attachment, including during collaborative editing. - Pending material edits overriding a later Undo, older copy operations replacing newer clipboard contents, and Cancel failing to restore a material preview correctly. - Scenes appearing saved even though newer edits were made while a Save was finishing, and collaborators seeing an unsaved scene as saved after joining or after skybox and color grading changes. - Collaborators receiving different skybox or color grading selections when downloads finished in a different order, and refused saves leaving the editor stuck in Saving. - Selected textures and their permissions must finish loading before Save can succeed. Texture loading has a two-minute limit; use Save to retry a failed load, then save again after it succeeds, or replace or reset the selection. - Builds and cubemap exports capturing partially applied edits while editing continued. - Authored texture scrolling, flipbooks and displacement animations starting at a different phase for late joiners. - Scripted material and `Mover` transitions falling behind after a late join or a frame hitch, and repeated relative `Mover` rotations accumulating errors. - Seat scripts retaining a phantom occupant when a player sat directly on another seat without standing; the old seat now receives `SitEventType.End`. - A script listening to both seats can still receive the new seat's start event before the old seat's end event. - Held objects visibly jumping for other players when released on desktop. - Gaussian splats disappearing exactly at their minimum or maximum draw distance. - Imported glTF midtones appearing too dark, transparent base colors being applied twice, and emissive colors or strength importing incorrectly. - Reimport assets to receive these corrections; existing imports keep their saved appearance. Imported emissive intensity is capped at 32, with a notice when capped. - Rendering resources accumulating during repeated window resizes, and graphics memory growing each time scripted rain was switched on or off. - Sansar Client API camera aiming missing its target in first or third person; aiming still respects the camera's pitch limits. - Human edits and Sansar Client API edits to different objects leaving the editor stuck requiring resynchronization. Recovery also waits for an active drag or tool to finish. - Recovery preserves confirmed unsaved scene contents and the camera, but resets undo history and local hide and lock state. If final edits cannot be confirmed, API writes stay paused and a warning advises preserving the affected values before reopening. - Sansar Client API material application reporting failure after the edit had applied, and failed material-save jobs remaining unfinished. - Materials without their original texture imports cannot be saved as presets; failures now explain which maps are unavailable. - Long Sansar Client API building sessions refusing further work after completed snapshots had filled their request history. - Sansar Client API template copies failing on saved scenes, older group formats, large templates or templates that were still loading. - The first ground-fog density change through the Sansar Client API being refused after opening a scene. - Sansar Client API close requests that timed out before closing started preventing later attempts to leave the editor. - Sansar Client API tools reporting a busy or not-yet-ready client as stopped or as a bad request, and reporting a temporary account-connection failure as a generic authentication failure. Source: https://docs.sansar.com/patch-notes/47-11-0 --- # Sansar 47.10.0 patch notes Released November 1, 2026. Dictate text in the Windows client, switch between saved accounts, and choose where your next visit begins. Bring your worlds through day and night with changing lighting, then shape the action with scripted flight and camera effects. Connect external applications, automation tools and AI-controlled players to more of Sansar through the general-purpose Sansar Client API. ## Make your next visit your own - Dictate text in the Windows client: hold **Ctrl + backtick** on desktop, toggle the chat microphone button, or use **Hold to dictate** on the VR keyboard. - Control it with **Enable voice dictation**. Audio stays on your device, and your voice is not broadcast while dictating. - Password dictation inserts lowercase words with punctuation removed and single spaces between words. - Keep up to eight accounts ready with **Remember me**, then sign in with one click from the desktop login screen. - Use **Switch account** to keep an account saved; **Log out** removes it. Saving a ninth account replaces the oldest saved account. - Start in a world you choose after login or leaving Lookbook: select **Custom world** under Settings → General → Starting World and paste a world link. - Missing or inaccessible worlds fall back to Home. First-time setup and explicit launch destinations still take precedence. - Check what you entered in a password field: hold the eye button to reveal the text, then release to hide it. Mouse and VR controller input are supported. - Reach the login screen sooner, with login artwork shown during startup and fewer flashes from brief shader compilation. You can also start Sansar and log in without waiting for Windows crash reports: they now upload in the background on the next start. ## Watch your worlds change with the light - Take your worlds through day/night cycles with changing sunlight and sky lighting. Read and control the time and mode from scripts with `ScenePrivate.GetTimeOfDay`, `ScenePrivate.SetTimeOfDay`, `ScenePrivate.GetTimeOfDayMode` and `ScenePrivate.SetTimeOfDayMode`. - In dark scenes using time-of-day lighting, colors gradually shift toward blue-gray. - For changing bounced sunlight, rebuild the scene with **Fixed time** or **Day-night cycle** enabled. Scenes built with **Off** retain their baked sunlight when scripts enable time-of-day lighting. - Watch light bounce from changing lights and emissive objects with **Real-time probe lighting**, with separate desktop and VR controls. - Add ray-traced lighting, shadows and reflections with **Ray-Traced Lighting** in advanced graphics settings. - Off by default; requires High graphics quality and supported DirectX 12 ray-tracing hardware. It is unavailable in VR. - Set the mood world-wide or per player by overriding color grading with `ScenePrivate.SetColorLut` and `AgentPrivate.SetColorLut`. - Overrides apply to the current world instance; post-processing volumes with their own color LUT still take precedence. - Using Bindless Rendering now requires Shader Model 6.6 support. ## Flight, camera effects and finer creator control - Choose whether flight is allowed world-wide or per player with `ScenePrivate.SetAllowFlight`, `AgentPrivate.SetAllowFlight` and their override-clearing methods. - Manage flight in worlds you own, or as staff, with `%%flight-on`, `%%flight-off`, `%%flight-clear` and their `-all` variants. - Add rumble, jitter, sway and impacts with scripted camera effects using `Client.ShakeCamera` and `ScenePrivate.ShakeCameraAtPosition`. - Choose Off, Reduced or Full under Settings → Social → Camera comfort → Camera shake. VR uses smaller position-only movement with no rotation. - Tune timed movement and rotation with different smoothing using new `Mover.AddMove` and `Mover.AddMoveOffset` overloads, while keeping one duration and completion event. - When recompiling scripts that pass bare `default` as the fifth argument to these methods, use `handler: default`, `null` or an explicitly typed callback instead to avoid an ambiguous call. - Shape fur and grass from scripts: adjust colors, length, density and thickness with `RenderMaterial` and `MaterialProperties`. - Add your own **Grass Dirt Map** to grass materials. - Bring wind animation to your Velvet Fur materials. - Find what you need in editor property dropdowns by searching scripts, script classes, sounds, objects, animations and emotes, skyboxes and audio materials. - Read the texture-size visualization with help from a new color legend in the diagnostics toolbox. - The `/scale` chat command is now reserved for staff. World scripts can still change avatar scale with `AgentPrivate.SetScaleFactor` and `AgentPrivate.SetScaleFactorAnimated`. ## Connect through the Sansar Client API The Sansar Client API provides general-purpose functionality for external applications, automation tools and AI-controlled players. - Launch Sansar, log in or out, and switch accounts through logout and login. - Access is local to your Windows account and sign-in session, with **Allow local API access** enabled. Login and logout work from Home or a world; logout is unavailable in the editor or during first-avatar selection. - Choose a starter look and complete first-time avatar setup through the Sansar Client API, then continue to Home. - List scene templates and create a world from a built template through the Sansar Client API, with an option to open the copied scene in the editor. - Use built library templates or your own built scenes; new worlds default to private and unlisted. If world creation fails after the scene is copied, the copy is kept. - Capture your current Avatar Editor view or body and face presets through the Sansar Client API without changing the live view or saving the look. ## Your avatar, from Lookbook to VR - Return to saved looks in Lookbook: fixed some looks failing to open with "problem downloading the avatar". - Jump and land as a small avatar: fixed the sliding after running jumps in worlds with **Scale Movement With Avatar** enabled. - Hold grab while seated in VR without your hands pushing the seat or vehicle you're sitting in. - Other physical parts of a seat and objects you hold can still push it. - Your VR hand reach now matches your avatar's height. ## Stay in touch and see where you're going - Hear a notification for unread direct messages, with an on/off option in Audio settings. - Hear a positional whoosh with avatar arrival and departure effects in worlds, controlled by Scene and Master volume. - World-loading text is crisper in desktop mode. - See destination previews more clearly: portal glow now dims during the preview. - Keep up with friends through more reliable location updates. ## Fixes - Logging out during world travel now returns you to the login screen. - Fixed empty Welcome and Verify Email boxes appearing while the login screens were busy. - Keep your script debug console output after VR switches or interface theme reloads, and reopen the console when you return to desktop. - Fixed hangs or crashes when quitting Sansar, including a hidden process that prevented it from reopening. - After a graphics-device reset, Sansar now shows an error and closes instead of freezing. - Unsaved editor changes are discarded when the graphics device stops responding. - Fixed the Parallels virtual machine shutting down when you entered a world on Apple Silicon Macs. - Fixed a crash when opening a scene in edit mode. - Fixed instability in worlds with moving or resizing lights. - Fixed corrupted Gaussian splat details while loading. - Fixed post-processing volumes failing to activate reliably when your camera entered them. - Fixed positional sounds changing their wall muffling when another sound started, including loops played with `PlaySoundAtPosition`. - The event delete dialog in My Worlds now includes the missing explanations: it names the event and scene and tells you whether the scene will be kept. - Fixed bottom-anchored windows overlapping reserved interface areas. - Fixed imports appearing to succeed when asset files could not be saved locally. - Valid nearby scripted interactions through the Sansar Client API are no longer refused on objects with offset pivots. Normal reach, line-of-sight and permission checks still apply. - Access inventory metadata and permission operations, and attach scenes to worlds, through the Sansar Client API on new accounts; these operations were previously unavailable. - Fixed cropped, black-padded or washed-out avatar previews and camera-override screenshots requested through the Sansar Client API at sizes larger than the desktop window. - Offscreen rendering is capped at 8,294,400 pixels (4K UHD), or the window's pixel count if larger; each capture operation's size limits still apply. Source: https://docs.sansar.com/patch-notes/47-10-0 --- # Sansar 47.9.0 patch notes Released October 18, 2026. Find Gaussian splats in their own Store category, and create editable scenes through the Sansar Client API. ## New - Find Gaussian splats in the Store's new Splats category. Existing splat listings have moved there, and new splat listings go there automatically. - Inspect Gaussian splat statistics in the editor and in worlds through the Sansar Client API. - Create editable scenes through the Client API, from scratch or from saved templates the signed-in account has permission to use. - Pick up, carry, drop and throw physical objects through the Client API in desktop mode, following normal reach and interaction rules. - Receive nearby players' voice audio separately for each speaker through the Client API, respecting existing mute, volume and distance settings. - List direct-message conversations, read message history and control read status through the Client API. - Receive notifications for incoming friend requests through the Client API. - Retrieve a world's current thumbnail image through the Client API. ## Changes - Import Gaussian splat PLY files from more World Labs export layouts, with clearer errors for unsupported or invalid files. - Keep submitting automated building tasks through the Client API when task history fills up; the oldest completed tasks are cleared automatically. - Keep your diagnostics panels' open or closed state when you travel between worlds or restart, subject to each world's diagnostics permissions. - You can no longer use the media panel in edit mode. ## Bugs fixed - Small Gaussian splats appearing black, and splats leaving ghost images or streaks on older graphics cards. - Gaussian splats losing saved draw distances when recreated or loaded into a world, and hidden splats becoming visible when recreated in the editor. - `DataStore` version conflicts returning the value the script tried to write instead of the value actually stored, and store and delete calls ignoring `RetrieveData`. - Grab and release script events reporting the avatar in `HeldObjectData.ObjectId` instead of the held object. - Scripts that relied on the old value can find the holder through `HeldObjectInfo.SessionId`. - Client API editor screenshots failing while checking whether visible textures were ready. - Imported sounds being rejected when assigned to script inputs through the Client API. - Compilation failures in the shipped rotation, open/close, pedestal spawning and collision sound sample scripts. Source: https://docs.sansar.com/patch-notes/47-9-0 --- # Sansar 47.8.3 patch notes Released October 12, 2026. ## Bugs fixed - Crashes or freezes when entering or moving around worlds with mirrors. - Crashes when saving your avatar after simulating clothing in the Avatar Editor. - Crashes while idle in a world. Source: https://docs.sansar.com/patch-notes/47-8-3 --- # Sansar 47.8.2 patch notes Released October 12, 2026. Expanded Sansar Client API capabilities let external applications, including AI-controlled players, travel, chat, shop and interact in Sansar. ## New - Travel between worlds, move avatars, control the camera and take screenshots through the Client API. - Use the Client API for text chat and direct messages, scripted menus and offers, and nearby interactions within normal reach and line-of-sight limits. - Search the Store, buy items, send gifts and tips, and spawn or remove supported inventory items in worlds through the Client API. - Manage friends, mute or block people, favorite worlds, and change supported settings and saved looks through the Client API. - Browse and manage events, RSVP and interact with quests through the Client API. ## Changes - Your avatar’s hand reach now adjusts as you move your headset in VR. - Move to Folder is no longer available in the editor inventory. ## Bugs fixed - The interface becoming unresponsive on Steam Deck. - Incorrect display brightness and contrast on Steam Deck. Source: https://docs.sansar.com/patch-notes/47-8-2 --- # Sansar 47.8.1 patch notes Released October 11, 2026. Find your way around My Worlds with separate tabs and a badge for pending invitations. ## New - Browse My Worlds using separate My worlds, Shared with me and Scenes without worlds tabs, and spot pending invitations with a badge. ## Bugs fixed - Freezes when adding a Gaussian splat to a scene. - Voice, volume controls and Nearby chat being unavailable when opening a collaborative editing session before anyone else joined. - Collaborators missing from the Nearby people list during collaborative editing. - Unnecessary scene reloads and long pauses when another collaborator deleted an unrelated object. - Instability when My Worlds refreshed while thumbnails were still loading. - Leave and Decline buttons in Shared with me having clipped labels and missing backgrounds. Source: https://docs.sansar.com/patch-notes/47-8-1 --- # Sansar 47.8.0 patch notes Released October 11, 2026. Edit your world together with guest builders, with voice and text chat during live edit sessions. ## New - Invite guest builders to a live edit session for a world you own, with voice and text chat. Manage invitations in the Collaborators panel and find shared scenes under "Shared with me" in My Worlds. - The owner must be present. Only the owner can save, build or publish. - Guests can move, duplicate, configure and delete objects already in the scene, but cannot add items from the owner's inventory or their own. - Each builder can undo and redo only their own edits. ## Bugs fixed - Scene fog color changing slightly each time a scene was loaded. Source: https://docs.sansar.com/patch-notes/47-8-0 --- # Sansar 47.7.0 patch notes Released October 7, 2026. Organize your inventory with folders, and use expanded Sansar Client API features to customize avatars, configure interactions and import Gaussian splats. ## New - Organize your inventory into folders up to eight levels deep, and keep multiple folder windows open at once. - Drive scripted vehicles (scripts using `AgentPrivate.Client.SubscribeToCommand`) with WASD, the left VR controller stick or the gamepad left stick while seated; physical numberpad keys also work while standing. - Control new rendering optimizations on supported graphics cards with the Bindless Rendering option in Advanced Settings. - Restart Sansar after changing this setting. - Use the Client API in the Avatar Editor to import bodies and wearables, fit clothing, adjust appearance and materials, preview outfits, and save and wear looks. - Configure grab points for each hand through the Client API, including grip position, rotation, Stays in Hand and Aim at Cursor. - Import audio into inventory and assign or clear sounds on script inputs through the Client API. - Import Gaussian splats from PLY files, place and duplicate them, and inspect and edit their properties through the Client API. ## Changes - Gaussian splats can no longer be added to the Scene Library. - Upload Gaussian splats from PLY files up to just under 2 GiB through the Client API. - Check whether visible Gaussian splats have finished loading before taking editor screenshots through the Client API. - Get clearer errors for invalid property values during Client API editing, including valid values and limits. ## Bugs fixed - Crashes when travelling between worlds with media, and when closing Sansar. - Memory use increasing when re-entering VR. - Editor selection highlights and transform controls disappearing or showing the wrong tint behind glass and water. - Client API saves and builds of large scenes failing while data was still transferring. - Gaussian splat selection boxes and Client API camera framing not matching the visible splat. - Scripted vehicle controls staying active after leaving a seat or losing focus. - Scripted vehicle commands held on one input device being canceled by another device. - Missed `AgentPrivate.Client.SubscribeToCommand` events when scripts had overlapping command subscriptions. Source: https://docs.sansar.com/patch-notes/47-7-0 --- # Sansar 47.6.1 patch notes Released October 1, 2026. ## Bugs fixed - Some purchased scenes not reopening in the editor. - Edit sessions failing to close cleanly when leaving the editor. - Both fixes also shipped in a later 47.6.0 build. This update makes sure everyone who installed 47.6.0 early receives them. Source: https://docs.sansar.com/patch-notes/47-6-1 --- # Sansar 47.6.0 patch notes Released October 1, 2026. Automate world building on Windows with the new Sansar Client API, from importing Blender assets to publishing worlds. ## New - The new Sansar Client API on Windows lets external applications import Blender assets, place and edit objects, adjust materials and lighting, add C# scripts, capture screenshots, and save, build and publish worlds. This also enables AI-powered world building. - Sign in normally and enable **Allow local API access** in Settings > Social > Privacy to allow local applications to use the API. - Update compatible static assets you own through the Client API while preserving their placement, scripts and material edits. - Import textures and replace material textures through the Client API without reimporting geometry. - Upload and replace world listing images through the Client API. - Set position, rotation and scale in the avatar item editor with numeric controls; use the toggle to show or hide the values. - Use two-sided options for wind-animated opaque materials, Fur Shell and Velvet Fur. - Use Cubemap Window materials on rigged meshes. ## Changes - Wear Wind/Cloth garments with updated cloth simulation and collision that better follows avatar leg shapes and seated poses. - Wind animation pauses in the avatar editor. - Textures stream better on opaque and cutout materials. ## Bugs fixed - Transparent surfaces rendering incorrectly in mirrors. - Avatar arrival effects not matching the avatar's full scale. - Unreliable controller connections and control bindings in OpenXR. - Incompatible materials being pasted into mirror material slots. Source: https://docs.sansar.com/patch-notes/47-6-0 --- # Sansar 47.5.0 patch notes Released September 26, 2026. ## New - Toggle for eye-tracking added to settings panel. - Calibration function for eye-tracking. Found in the settings panel. ## Changes - Individual sliders for shell and blade length added to the grass shader. ## Bugs fixed - Assets not unloaded from VRAM when leaving the HomeSpace - Speaking indicators not activating when a user has the megaphone. - Individual volume controls cease to function when the user has the megaphone. - Mirrors missing their mask in worlds. - Worlds will have to be re-baked if affected. and in some cases the mirror recreated - Atmospheric march collapses when a mirror is currently rendering. - User imported objects not retaining their icon when added to the scene backpack. - Some cases custom items need to be reapplied to the scene inventory. - Transparency being lost on custom icons applied to inventory objects. - Icons that have been previously uploaded won't gain their transparency from just re-uploading, they have to be changed even if it's one pixel. - Media doesn't initialize when using the Media interaction panel when setting an URL if media isn't already playing. - Lookbook UI disappears when minimising the game window. - Accessories detaching when switching from accessories to clothing view in the lookbook. - Mis-aligned 'teleport to' icon. - Mirrors can not be selected by clicking in the editor. - Mirrors as components lacking transform gizmos. - Mirror fallbacks only rendering in the left eye. - Virtual keyboard spawning behind the social panel. - VR projection issue when drawing grass fins. - Grass shell/fin/blade drawing in diagnostic modes. - Inconsistent normal direction applied to grass blades in stereo. - Avatar dissolve-in effect becoming stuck when entering VR mode during scene load. - Underwater distortion effect wasn't stereo correct. - Virtual Texturing downgrading textures prematurely of meshes in 'fading' state. - Caret disappearing at reduced UI scale values. Source: https://docs.sansar.com/patch-notes/47-5-0 --- # Sansar 47.3.0 patch notes Released September 21, 2026. ## New things - Teleport effect when teleporting in or out of a world. - V1 work in progress NPC creation tool ## Changes - Asset import log is less spammy. - Grass shader default grass normals changed to uniform up to avoid confusion. - Add 'Teleport to friend' button to social UI rows rather then nested in the three-dot menu. - Gaussian splats may now render on very old GPUs. - They may not perform well as older GPUs don't support some of the optimizations. ## Bugs fixed - Depth biasing issue when cubemap windows intersect mirrors. - Grass always trampled at 0,0,0 - Missing gizmos in Lookbook transform mode. - Missing option to filter PostFX volumes in the Scene Objects panel. - Sky contribution missing from diffracted water. - Splats not included in cubemap captures. Source: https://docs.sansar.com/patch-notes/47-3-0 --- # Sansar 47.2.0 patch notes Released September 15, 2026. - Streamline load skipped entirely on AMD GPUs. - More robust texture streaming support checks to also gate on feedback shader support. - Correction to view space projection in history calcs of several shader vertex stages. - Cubemap generation now captures all render passes, not just the opaque bin. - Remember correct size of social panel when closed with the nearby draw opened. - Lookbook UI scaling issue when using 4K / High DPI and ultrawide monitors. - Two-sided materials now draw both sides correctly. - Aberant transparent overdraw across mirror surfaces. - Image corruption in VR when looking at transparent surfaces. - Social panel Nearby drawer open status now persists between worlds and client sessions. - Client deadlock when loading gaussian splat containing worlds. - Black screen issue on older cards including Pascal. - Visible wobble across transparent surfaces when DLSS enabled. - UI becoming unresponsive after travelling through a portal. - UI scaling issue in edit mode. - Crash when leaving a scene that contains a mirror when in VR mode. - Freeze when typing \ into the Media panel URL. Changes: - Input smoothing now only applied to hand-tracking mode only, not controllers. - Mirror fallback cubemap image size increased from 128 to 512. Source: https://docs.sansar.com/patch-notes/47-2-0 --- # Sansar 47.1.0 patch notes Released September 11, 2026. Patch Notes V47.1.0 ## General Updates - Ghost-lights have been exorcised. - The graphics backend has been upgraded from DX11 to DX12, unlocking a major wave of rendering, performance, and feature upgrades. - MIRRORS have arrived in Sansar, including VR support and scripting support. - OpenXR runtime support has been added and is now the default VR runtime. - Major networking improvements across the client and services. - Fly speed is now adjustable. - While flying, the scroll wheel adjusts fly speed when moving and reverts to camera distance when stationary. - Loading Hints have been added to load screens, with a settings toggle to turn them off. - Added desktop avatar look-in-camera-direction mode. - Added avatar ragdoll support, plus script API - Portals can now show a preview of the scene they lead to. - Worlds must be re-saved / re-baked before portal previews will appear. - In World Clickable Media Added. - Only a certain type of screen are clickable and is local to you, World owners will need to use existing system to make changes for everyone - Added built in local Media Screen Browser to the UI ## Creator Updates - Large asset uploads should no longer fail on the first attempt. - The import window now shows more upload progress information and supports larger uploads. - Gaussian Splats have been added, with PLY import and in-world support. - glTF / GLB support has been added for model imports and in-world workflows. - Added a per-scene creator-managed backpack. - Any item from your inventory can now be added to the scene backpack by right clicking them and clicking add to library. - New backpack management UI added to edit - Added Interactive Media Screens for in-world web and media interaction. - New placeable mirror system object for clickable screens - Added LUT support as a new uploadable asset type. - Unreal and HaldCLUT LUT formats are supported, and LUTs can be assigned in the Scene Settings UI. - Added PostFX volumes for localized visual effects and LUT overrides. - New PostFX volume system object added - PostFX volumes can override the scene LUT and select an effect type. The first effect is underwater, with more potentially to come later. - Material pasting now supports multiple selected objects at once. - Added collision volume diagnostics for Static, Dynamic, Keyframed, Avatar, Trigger, and Audio volumes, with visibility toggles and disabled-by-default behavior in edit mode. - This mode only works in runtime, you must use edit modes existing tools - Added cubemap capture / export from the current camera position in edit mode, with EXR support for HDRI / HDR color capture. - Fixed an edit-mode camera regression caused by previous input smoothing changes. ## Shader Updates - Added Global Wind - Wind direction and speed can be configured in Scene Settings, and wind-enabled shaders now respond to procedural wind. - Flow-maps can be used to define per-texel wind response and anisotropic stiffness on wind-enabled surfaces. - Added new shaders: Fur: Long, Fur: Velvet, Wind: Standard, Wind: Standard + UV Animation, Grass, Glitter/Sparkle and Wind/Cloth: Skirt. - Grass density and distribution can be controlled with Density and Noise maps. - Wind/Cloth: Skirt makes imported skirts react to both wind and movement. - Added the Cubemap Window shader for outside-in cubemap window effects on flat surfaces using door projection. - Button added to make these from in edit mode. - Reworked alpha rendering to remove the smearing that afflicted transparent surfaces in motion. ## Avatar / Lookbook Updates - You can now apply up to five accessories to a Look instead of being limited to one accessory from each category. - Accessories can now be attached to any bone, new dropdown box for selecting the attachment point. - Uploading is still connected to the accessory type and store ignores the new selected bone. - Scaling limits for accessory items have been increased. - Avatar morph sliders can now be bidirectional. - Improved inventory loading reliability. ## VR Updates - OpenXR enables eye, finger, and hand tracking where supported by your headset and software environment. - Move / run: hold a left thumb-to-middle-finger pinch, then move your left hand from its starting position. The displacement drives the normal virtual left stick, head-relative. There is no separate run gesture; speed comes from the normal stick magnitude. - Turn: hold a right thumb-to-middle-finger pinch, then move your right hand horizontally. It respects the existing snap/smooth turn setting. - Grab: close either hand into a fist to grab; open it to release. - Mute: left thumb-to-ring-finger pinch toggles voice mute. - Jump: right thumb-to-ring-finger pinch. - UI click: point at UI and perform an index pinch. - Open application menu: hold a left index pinch for 0.5 seconds while not pointing at a UI panel. - Dynamic Foveated / Variable Rate Shading is supported on eye-tracked headsets. - The VR runtime can be changed in Advanced Settings if you run into problems. - Full-body tracking has been improved. - VR UI now renders with correct depth culling again when render resolution is below 100%. - Improved OpenXR headset re-entry reliability, including a second-headset black-screen / session wedge fix. - Fixed a VR per-eye shadow darkening artifact during head movement. - Social panel scaling in fixed-size mode and VR beams rendering correctly over UI. - Improved VR UI interaction with cursor snapping for small controls, haptic and audio click feedback, and a thinner hand-tracked pointer beam. - Wrist menu resized ## Graphics / Performance Updates - Scene lighting now bakes on the GPU for DXR-compatible GPUs, reducing bake times from minutes to seconds. - Mitigate black patches in baked GI caused by NaN and negative specular. - Systems without hardware ray tracing will continue to use the existing CPU baker. - HDR has been reworked and is now out of beta. - Added Virtual Texture Streaming to reduce VRAM usage in heavier scenes at the cost of some performance. - Virtual Texture Streaming can be toggled in Advanced Settings. - Added DLSS upscaling and Frame Generation. - Upscaling method can be selected in the Graphics settings panel. - DLSS is the default upscaler on supported Nvidia hardware. - On non-Nvidia cards, the original Built-In upscaling method remains the available option. - Frame Generation is currently supported in desktop mode only, not VR. - Added optional NRD denoising for reflections. It offers higher quality, but is disabled by default because it is more expensive. - Comprehensive graphics pipeline performance work has reduced waste and improved overall efficiency. - Umbra Occlusion culling system has been replaced with custom Hi-Z culling. - Fixed a periodic camera rotation / hitch issue. ## Script API Additions - Added scripting API support to add and remove scene backpack items for everyone or for specific users. - Added `UI.Menu` / `UIMenu` for script-driven menu panels. - Added avatar ragdoll scripting, including enable / disable, bounce, and impulse controls. - Added `RagdollRegion` enum values for targeting specific body regions. - Added `ScenePrivate` methods to add, remove, and clear Scene Backpack Library items globally or per-agent. - Mirrors are now scriptable through `MirrorComponent`. ## Scene Library `ScenePrivate` can now add, remove, and clear Scene Library items for everyone or for an individual user's current session: `AddToSceneLibrary`, `RemoveFromSceneLibrary`, `ClearSceneLibrary`, and their `ForAgent` equivalents. ```csharp ScenePrivate.AddToSceneLibrary(resource, "Rubber Ducky"); ``` ## Ragdolls `AgentPrivate` now provides `SetRagdollEnabled`, `GetRagdollEnabled`, `ApplyRagdollImpulse`, `ApplyRagdollImpulseToRegions`, `SetRagdollBounce`, and `GetRagdollBounce`. Use `RagdollRegion` values such as `LeftArm`, `RightLeg`, `Torso`, `Head`, or `AllRegions` to target an impulse. ```csharp agent.SetRagdollEnabled(true, 3.0f); agent.ApplyRagdollImpulseToRegions( new Vector(-250.0f, 0.0f, 0.0f), RagdollRegion.LeftArm | RagdollRegion.LeftLeg); ``` ## Scriptable Menus `Agent.Client.UI.Menu` adds `Show`, `ShowStyled`, and `Hide` for script-controlled screen menus. Read `SelectedItem` or `SelectedIndex` after a selection; menus support 1-32 items, custom colors, placement, and click-through display mode. ```csharp agent.Client.UI.Menu.Show("Choose a team", "", "", new object[] { "Red", "Blue" }, 50.0f, 50.0f, true, true); ``` ## Mirrors Scriptable `MirrorComponent` can now be enabled or disabled globally with `SetIsEnabled`, or for one user's current session with `SetIsEnabledForAgent`. ## Social / Voice / UI Updates / Settings - Chat, Nearby, Friends, and Messaging have been reworked into a unified Social UI. - Region chat is now integrated directly into Social. - Added moderation tools to the Social UI. - Chat session rows now show unread badges. - Voice volume preferences are now remembered more reliably. - New Social settings include Recording indicators visibility. - General settings now include loading hints, chat-open-by-default, avatar look-at, and desktop field-of-view options. - Graphics and VR settings now include Upscaling, VR upscaling, Reflection denoising, Desktop Frame Generation, Mirrors toggle, Mirror distance, - Advanced settings now include VR runtime selection and Virtual Texturing. - UI panels are now easier to grab for resizing. - Microphone crackling has been resolved. - Voice attenuation when using the secondary voice output device has been corrected. - Volume level indicators for other speaking avatars have returned. - Fixed voice indicators not scaling with avatars. - UI panels can no longer become stuck behind the edit or diagnostic ribbons. - Transparent tool-tips have been corrected. - Several UI panel ordering issues have been fixed, including panels drawing in reverse order below the world origin. - Private chat read handling fixed so DMs should no longer get stuck or stop updating correctly. - UI sounds should no longer continue playing after changing volume settings. - Color emoji now render correctly in the UI and chat. - Fixed closed UI-panel ghosting after panels are dismissed. - Fixed Hovertext bug while in F10 camera suit. Source: https://docs.sansar.com/patch-notes/47-1-0 --- # Sansar 46.6.2 patch notes Released March 3, 2026. Patch Notes V46.6.2 "Body and Mind Update" ## Highlight Updates ## Body and Face Sliders - Custom avatars can now support blend shapes/shape keys on import; defaults have not been updated to include these yet. - Creators will need to upload avatars with blend shapes, and they will appear 1:1 in-game. A naming convention is available to organize them, but if it is not used, a custom category will appear. (Docs to follow soon) - If an avatar was uploaded with these in the past, it may appear in Lookbook but may not function correctly. - Improved body and face slider responsiveness. - Face presets are now hidden for custom avatars where presets do not apply. ## Material Asset - You may now save materials from any object to your inventory. Saved materials may be applied to other objects either from context menus or by dragging and dropping them onto your target item. - Ownership is respected, so you can only list materials in the store if you uploaded them yourself or if the item was previously bought with resale allowed. - Legacy objects you own or bought from the store will pass down permissions and licenses to any materials saved from them, such as whether they can be sold, resale cost, or edited state. - We have tried to provide maximum freedom within your own edit mode while also keeping permissions and license rights fair to the original owner. A material should track a license wherever it goes. - Material asset icons feature one of three circle indicators in the top-right corner. - 'Full Use': A filled circle indicates a full-permission asset you can list for sale or apply to an object you later list for sale. - 'Partial Use': A partially filled circle indicates partial permission states. - 'Restricted Use': An empty circle denotes restricted items that cannot be listed. - New context menu added for material-based actions: saving, copying, and pasting. - Copy/paste materials between objects. Copying all materials or only a single slot is supported, both from context menus and within the materials editor UI. - Material clipboard is maintained between scenes to allow copy/pasting materials between objects in different scenes. ## General Updates - Runtime avatar scaling via Script API (you can change the size of visitors on the fly). - Moderation panel added to allow world owners better control. - Added Discord Rich Presence integration and settings panel. - Diagnostics mode is always available to world owners and admins, even if off for visitors. - Streaming detection modal added: a red recording dot appears above a player who is using streaming software. - Web updates for the streaming media system to improve stability; additional codecs added. - Voice chat echo cancellation improved. - You can now set a different audio device to handle voices vs. other in-game sounds. - Added 3 new backpack items: Audio Beats Heart, Soccar Ball, Basketball. - Improved culling behavior when exiting the scene AABB. ## Store Updates - Store search improvements to allow fair display of items; it now tries to prioritize a result from each possible creator before showing repeats/color variations. - In-game and web store fixes: results should display better and use title, description, and tags much better. - Web store main page changed from Recently Added to a daily rotating random pick of assets. (Recently Added is still a filter.) - Categories should be displaying better now. ## Quality of Life Updates - Custom Properties support and naming for Blender exports. This will allow you to set Sansar shader and material properties as part of the model before exporting from Blender. - Renamable material slots in edit mode. - Per-object Occluder/Occlude toggles in edit mode to selectively exclude individual objects from culling. - Text in the script debug panel is now selectable and copyable. - Copy/paste of materials also works between Lookbook and edit mode. - Improved import feedback when an invalid shader is requested when using custom Blender settings. ## Bug Fixes - Crash fix for when you closed the materials window with another object selected. - Material duplication trick removed (replaced with actual workflow). - Fixed voice chat issues that could cause fading, crackling and instability under jitter/packet loss conditions. - Fixed a full-volume "pop" that could occur when starting a new media stream. - Fixed VR Lookbook camera upward drift. - Lookbook freecam freakout removed. - Fixed incorrect camera pitch direction behavior when loading into edit. - Fixed incorrect camera pitch direction behavior on zooming in and out. - Fixed culling-related visibility issues and corrected occluder/occludee reflection property names. - Fixed media GI corruption cases caused by invalid light transport/emission data. - Fixed GI 'black square' corruption when multiple media surface channels are sharing light probes. - Crash when attempting to load the avatar carousel on first start. ## Script API Additions - **AgentPrivate.SetScaleFactor(float scaleFactor)** Sets the runtime scale factor instantly. The scale is clamped to [0.01, 100.0]. `// Scale avatar to 2x size` `AgentPrivate agent = ScenePrivate.FindAgent(agentInfo);` `agent.SetScaleFactor(2.0f);` - **AgentPrivate.SetScaleFactorAnimated(float scaleFactor, float seconds)** Sets the runtime scale factor with a smooth transition over the given duration. Uses a smoothstep (ease in/out) curve for natural-looking growth/shrink. `// Grow to 3x over 2 seconds` `agent.SetScaleFactorAnimated(3.0f, 2.0f);` `// Shrink to half size over 1 second` `agent.SetScaleFactorAnimated(0.5f, 1.0f);` - **AgentPrivate.GetScaleFactor()** Returns the current runtime scale factor (1.0 = normal). Source: https://docs.sansar.com/patch-notes/46-6-2 --- # Sansar 46.5.1 patch notes Released January 21, 2026. Patch Notes V46.5.1 ## General Updates - Added player camera smoothing with settings toggle - Added debug visualisation mode to show texture sizes. - mini guide found here: [Diagnostics Toolbar](/create/world-editor/diagnostics-toolbar#texture-size) - Added Max Client Texture Size selector to the settings panel, This forces textures to only go up to your selected size in any world, works in VR. (only affects you) - Auto mode will adjust this setting in real time to balance texture sizes against your systems VRAM availability - It's on for default for everybody at the point the update dropped. No difference between desktop and VR mode in behaviour, - There are some caveats, - It won't work on an Intel GPU (AMD or Nvidia only), but Intel GPUs don't support VR anyway. - If you do start it on an Intel GPU regardless, it will look at total VRAM, more than 8GB limits to 4k, otherwise limits to 2k. - It won't work on Linux if anyone tries it there. - It will detect if it's running on a gamestream instance and textures will always be set to 4k. - Ff you start it on a SteamDeck it will limit textures to 1k. - Added UI Scale slider to the settings panel. - Added toggle to use the Windows Settings scale value when calculating UI scale. (Use with the other UI scale to achieve desired results) - Added additional Editor settings to allow customizing Culling bake parameters. (helps stop objects from being culled even when seen) ## Bug Fixes - Issue with Uv Rotate value being saved incorrect on objects with multiple material slots. - Issue where Uv Rotate was jumping between two points with camera distance. - Fixed Mouse becoming unusable when force teleported. - Crash fix for disconnecting headsets. - Crash fix for old returning users with outdated avatars or missing assets, prompted to make new avi instead. ## Script API Additions - Exposed the following shader properties to user scripting: `Sansar.Simulation.MaterialProperties` - Scroll Albedo. - Scroll Normal/Roughness. - Scroll Metalness. - Scroll Ambient Occlusion. - Scroll Displacement. - Scroll Displacement Factor. - Receive reflections. - VAT Loop Animation. - VAT Ping-Pong Animation. - VAT Blend Animation Loop. - Blend Displacement Flipbook. - Blend On Displacement Loop. - Loop Displacement Flipbook. - Ping-Pong Displacement Flipbook. - Loop Flipbook. - Apply UV Offset to Diffuse layers. - Apply UV Offset to Ambient Occlusion. - Apply UV Offset to Emissive. - Draw Afterimages. - Audio React - Emissive Color. - Audio React - Emissive Brightness. - Audio React - Adaptive Displacement. - Audio React - Displacement on Low. - Audio React - Displacement on Mid. - Audio React - Displacement on High. - Audio React - Flipbook Frame. - Audio React - Adaptive Flash Emissive. - Audio React - Flash Emissive on Low. - Audio React - Flash Emissive on Mid. - Audio React - Flash Emissive on High. Source: https://docs.sansar.com/patch-notes/46-5-1 --- # Sansar 46.3.4 patch notes Released December 6, 2025. ## Fixes - Multiple crash/freeze issues when changing worlds with media loaded. - Crash when toggling the media disablement toggle in the settings panel - Multiple issues involving the in-world quick-buy UI panels and flow for both VR and Desktop mode. - Missing UI color picker panel when in VR mode. - PlaySound lifecycle management issue that caused further sounds to cease to play when many events fired at once resulted in an excess of events waiting to be cleaned up in the STOPPING state. - UI scaling now ignores the Windows desktop scaling setting value when looking up the current display DPI. ## Changes - Media disablement in the main settings menu toggle now immediately closes streams when set to disabled rather than requiring a world change to take effect. Source: https://docs.sansar.com/patch-notes/46-3-4 --- # Sansar 46.3.2 patch notes Released December 1, 2025. ## General Updates - 4 different Media streams can now be supported in the same world and objects displaying them - Settings for these streams are found in the media shader settings as the 'stream index' and also in the audio components settings menu. - New settings added to the scene settings panel added to support the new media channels. - Chromium updated to v142. ## Shader Updates - Improved performance for diffraction shaders. - Stream selection added to Audio reactive - Additional displacement mode toggles for audio reactive shaders. - LOW MID HIGH Freq ranges and 'Adaptive' for displacement effects. - Added the additional loop behaviour controls previously added to the regular flipbook shaders to the Billboard shader to bring it's functionality up to parity. ## Script API Changes Sansar.Simulation.StreamChannel (Enum) - `StreamChannel.MediaChannel2` - Media Surface 2 - `StreamChannel.MediaChannel3` - Media Surface 3 - `StreamChannel.MediaChannel4` - Media Surface 4 Sansar.Simulation.ScenePrivate (Class) - `ScenePrivate.OverrideIndexedMediaSource` - `ScenePrivate.PerformIndexedMediaAction` Sansar.Simulation.AgentPrivate (Class) - `AgentPrivate.OverrideIndexedMediaSource` - `AgentPrivate.PerformIndexedMediaAction` Search your Client ScriptAPI folder for more info ## Bug Fixes - Reworked UI scaling to fix several UI scaling and positional issues. Now scales by DPI for consistent element sizes across different displays. - This should solve a lot of scaling UI issues including the Hair color picker and info on interactable items. - UI being locked out of further interactions when attempting to open a store panel in VR mode. - Crash when interacting with the properties of a script that is the grandchild of the object currently being inspected. - 'Pop' sounds when abruptly stopping playback of an audio track. - Load screen music not smoothly fading out when loaded. - Audio crash when removing a DSP, seen as a random crash for some. - Reflections not rendering. Source: https://docs.sansar.com/patch-notes/46-3-2 --- # Sansar 46.2.2 patch notes Released November 1, 2025. ## Bug Fixes - Audio now works correctly with 4 channel microphones., - Leak issue that caused frame-rate to tank after playing many impact sound events. - An issue where VATs imported since the update have their displacement scales set to zero., - Avatar VATs should now scale correctly in both lookbook and in the world., - VAT animations set to play once would loop back to the first frame when stopping now stops on last frame. ## Shader updates - Audio reactive shader (Emissive + UV Animation) More variants in future. Toggle to apply volume to brightness. Toggle to apply volume to displacement strength. Toggle to apply RGB colors based on audio analysis. Toggle to advance flipbook frame to the beat of the music. (You can leave step-rate on 0 for this to work right). Toggle to flash on the beat (plus individual low/med/high band toggles) You can mix and match options for varying effects. Source: https://docs.sansar.com/patch-notes/46-2-2 --- # Sansar 46.1.11 patch notes Released October 24, 2025. ## General Updates - New launcher created you must redownload from the website and it should handle everything, recommended to do a clean install but not necessary. - Echo Cancellation of media and mics added and Automatic Gain Control for voice chat, should drastically help with people who use speakers - Increased strength and quality of UI blur effect for a more pleasing result - Floating UI elements are now anti-aliased - Audio backend (FMOD) has been updated to the latest version. ## Shader Updates - 'Indexed' flipbook shaders that allow switching between 4 individual flipbooks using the scripting API named **"Index: Standard + UV Animation"** and **"Index: Standard Two Sided + UV Animation"** - New VAT shader variant **"VAT: Standard + Alpha Mask"** - Added properties to enable looping subsets of larger VATs - Added script API function to set these at runtime - VAT and Displacement animations now behave correctly when worn on an avatar There is a visual issue in lookbook when scaled to the large and small extremes but is fine once you save and join a world. ## Bug Fixes - Automatically update advanced color management properties when dragging the client window between monitors with differing capabilities - Fix for bottom/right of game window glowing orange in high-bloom worlds - UI opacity now behaves more predictably when reducing the alpha value - Z-fighting issue between UI panels when far from the world origin point resolved - Fixed UI scaling issue when switching from VR to desktop and back - Crash fix when minimizing the client window (thank beans) - Removed erroneous scrollbar from VR mode profile UI - Fixed Giant scaling issue for the hair color picker but still may present a issue on some screen resolutions missing the HUE slider (scaling your window can make it show) - Corrected desktop snapshot behaviour - Fixed audio issues with some objects occluding sound when the camera was behind them. Source: https://docs.sansar.com/patch-notes/46-1-11 --- # Sansar 46.1.5 patch notes Released September 2, 2025. ## General Updates - Diffractive glass effect for transparent UI panels. - Added support for setting individual audio emitters to emit either Left/Right/Both channel audio. - Added 'ICC Color Correction' to the advanced settings panel. - If you are a professional artist with a calibrated display, this will cause Sansar to apply your currently installed ICC profile for color correct rendering. If not using a calibrated display it is best to leave this setting off, but will try to do it's best using your monitors reported EDID data if you do enable it. - (VR Only) Dichromatic colour-blindness adaption mode added to the advanced settings panel. RGB sliders in advanced settings set your individual sensitivity to the RGB primaries. An adjustment period for a minimum of a few hours is required for your brain to make sense of the delta colour simulation. ## Script Updates MAYJOR increase to scripting memory from 32mb to 256mb per scene ## Bug Fixes - The majority of UI panels now render correctly in HDR mode. Some UI elements remain in the wrong colourspace and will be corrected later. - Fix for an issue where disconnecting an audio device while Sansar is open results in the client no-longer outputting any audio. The client will attempt to select another output device if the current one is removed. For brief disconnections that are reconnected soon after the client will attempt to switch back to the original device automatically. - Fix for a resource rebinding issue within the reflection passes. (Reduction in spurious log spam) Source: https://docs.sansar.com/patch-notes/46-1-5 --- # Sansar 46.1.2 patch notes Released July 24, 2025. ## General Updates - Server upgrades and backend inventory work. (no visible changes) - Reduced max culling AABB from 4096 to 4095 to prevent rounding errors from crashing the scene bake. - Increased size of icons in Emote UI. - Fix for an issue where new users with higher-end hardware and certain other common software installed are presented with the lowest possible graphics settings on first launch. - Fix for an issue that can make HDR mode appear too dark when using OLED monitors in TrueBlack400 mode. - Fix for RegionServer crashes caused by the Backpack chair. - Fix for the desktop FPS limit being erroneously applied in VR mode. - Fix for an import failure that can be caused by FBX scenes containing multiple skeleton containing meshes. - Minimum draw distance now fades in when approaching to match the maximum draw distance fade out effect. - Removed some old links and wording from client and launcher. - Left menu icon for volume changed. ## Shader Updates - Screenspace UV effect from the Screenspace shaders now additionally work in VR mode. - Improved performance for diffracted transparent+multibump shader. - Added four new shaders to allow non-shadow-casting objects: - No Shadow: Standard - No Shadow: Standard + Emissive - No Shadow: Standard + Alpha Mask - No Shadow: Standard Two Sided + Alpha Mask Source: https://docs.sansar.com/patch-notes/46-1-2 --- # Sansar 46.1.1 patch notes Released May 24, 2025. ## General Updates - Final major update to reflections. They have now reached their final form. - Significant improvement to quality. - VR reflections now similar to desktop reflections in quality. - Fix for an issue where reflections are inappropriately applied to rough surfaces; Plus some aberrations that can appear in close angled fine details. - Fix for an issue that can cause erroneous culling behaviour if the scene AABB doesn't encompass the world origin. - Rebake your world if it was affected. - Fix for an issue where scenes may appear washed out when HDR is enabled within Windows but not within Sansar. ## Settings Updates - Added a Volume settings quickbar menu to main UI buttons. - Added 'Display Gamma' gamma selection to the graphics settings panel. If you wish to retain the previous 'look', you can achieve that by setting the box to 'Reference 2.4'. If you have HDR enabled in Windows, the gamma selector will be replaced by the HDR toggle, as Windows HDR uses a different colour process. Setting this to the same gamma level as your monitor will enable those accustomed to professional workflows to create more colour correct art. - Many consumer monitors default to 2.2, so setting Sansar to 2.2 in those cases will improve both contrast and black-levels in world. Some professional monitors offer a choice between sRGB or Display P3 modes. These correspond to a gamma of 2.2 or 2.4 respectively. - There are two modes, Reference and Enhanced: Reference is the preferred if you wish to perform colour accurate work within Sansar. Enhanced provides more precision so will achieve the best look and low-level contrast using current OLED monitors set to 10bpc (Deep Colour) mode. ## Shader Updates - Fix for a precision issue that can cause slow VAT animations to stutter and appear less smooth. - Fix for an issue that causes the ambient occlusion map to not show when opaque materials are in depth fading mode. - Fix for a UV scaling issue with the Transparent shader. - Fix for an issue with Pixelize UV Anim shaders where the scroll layer boxes produced incorrect behaviour. - Fix for an issue with the VAT Standard+Emissive skinned shader that can cause flickering while in motion. Source: https://docs.sansar.com/patch-notes/46-1-1 --- # Sansar 46.0.10 patch notes Released April 24, 2025. ## General Updates - Respawn button added to Desktop and VR in the 'Go' Panel ## VR Updates - Added Flying mode to VR - Left controller X button to toggle flymode - Left controller tilt controls vertical movement - Left click stick to toggle the tilt control for up and down allowing use of hand - Left stick controls directional movement ## Shader Updates * New shader "Standard + Environment + Alpha Mask" - Added checkbox to VAT shaders to toggle shadow casting. - Added checkbox to VAT, Alpha Mask and Transparent shaders to enable/disable the material to receive reflections. - Added checkbox for two compatibility modes to skip either the motion vectors or temporal accumulation during shadow rendering on Transparent shaders. - Reflections will now be disabled by default for Transparent shaders. They do not output motion vectors so can cause reflections to flicker and become noisy. - The provided compatibility checkboxes can mitigate the issues in specific instances, the creator can now choose which works best for their creation. - Fix for an issue that caused the 'UV Rotate' and 'Flipbook - Loop' properties to behave as if they contained default values for existing objects. - Fix for an issue where VAT shaders could send incorrect roughness values to the reflections. - Further enhancements for reflections. ## Bugfix - Fix for an issue where the min culling distance feature can cause objects to become invisible if you stand inside them. - Temporary fix for an issue that can cause the VR UI to inappropriately cull when running at a reduced render resolution. A better solution will follow. - Fix for UI PVP Scoreboard not re-appearing in world after leaving and re-entering a world - MaterialEditor in edit mode and the character editor for importing items UI color now syncs and works properly - Default color button functionality changed to send out a 1-time event that changes the colors to default - Multiple transparent panels now display proper colors - Fixed an issue with the character camera spinning around the character on WASD input after exiting a script camera when certain circumstances were met. - Updated UI handling for interaction prompts on objects with sit points. Source: https://docs.sansar.com/patch-notes/46-0-10 --- # Sansar 46.0.0 patch notes Released March 21, 2025. ## General Updates - Significantly improved quality of screen-space reflections along with improved performance. - Reflections have been changed to ON by default due to significant performance increase, option to turn them off in settings remains. - Mesh weighted to the head_attach bone will now be visible in first person and VR. - Requires changes be saved to existing avatars to take effect. - Deep color support. If you have a monitor capable of 10bpc color depth, Sansar is now able to display those extra colors. - This is complementary to the existing HDR support, but HDR is not required. - Payment processing implemented fully, Withdrawals are now functional. - Commission rate dropped from 62% to 0% you now get everything earned minus a small withdraw fee - Adjusted size of inventory and emote icons. - Updated Early Access Badge to better fit the style. - Add V-Sync toggle to the advanced settings panel. (It now also defaults to On. If you use G-Sync make sure it's forced to On in the Nvidia control panel and set to Off in Sansar for optimal performance) - Improved HDR tonemapping. - Added UI customisation options for things like color and transparency to most windows to Settings / UI - General render pipeline optimizations - Occlusion culling optimizations and fixes. - V1 of the customizable UI colors implemented in settings, you can now change the main color and opacity of your UI panels ## Edit Mode Updates - Added editor property for minimum draw distance on a per object basis. - 'Surface Snap' Hotkey changed to ALT+S. - Moved Surface Snap and Local/World transforms selection to the main object transforms panel. ## Shader Updates - Added VAT Standard Shader. ''Vertex Animated Textures'' (See documentation for the Blender export tool). - [VAT Shader Basics](/create/materials/vat-shader-basics) - Added Skybox reflection shader (Standard + Environment). - Added Skybox reflection shader: (Diffractive: Transparent + Multibump + Environment). - New VAT shader variant "VAT: Standard + Emissive" - Expose VAT properties 'VAT - Frame' and 'VAT - Step Rate' to the scripting system. - Shadows now work correctly for the remaining displacement textures. - Added toggle to blend/snap displacement animations when looping back from the last frame to first. - Added option to flipbook shaders to either 'ping-pong', loop or play once. - Added option to displacement shaders to either loop or play once. - Increase range for Displacement scale. - Added UV Offset property for the basic Media shader. - Update the UV Rotate shader property to now use degrees instead of radians. ## Bug Fixes - Fixed banding issue within metallic gradients - Fixed guest and ban list not showing the names in world creation settings. - Fixed GI bake, all scenes should now bake correctly again. If you have scenes affected by this bug, re-baking is required. - Fix for inappropriate reflections on the skin and faces of default avatars. - Fix for misaligned add pass rendering for Transparent+Multibump shader variants. - Shadows now work correctly for the remaining displacement textures. - Surface Snap and world-space adjustment Icons now correctly sync with hotkey use. - Color picker UI snapping behind other panels when clicked fixed. - Avatar Scale slider being unresponsive fixed. - Featured Events on codex not working fixed. - Fixed a crash when pressing F7 while using the '-enableVR false' start parameter. ## VR Changes - Increases the render resolution of the VR UI - Fix for VR hands rendering behind the UI. - Fixed the UI jitter than sometimes occurs when playing in VR. ## Misc Changes - Rewording of some phrases on website. - Payment pages and some Account settings added to website, inc. - setup of payment method for stripe, delete account button for removing stripe details. - Account deletion and Email change buttons added. - Able to now convert USD's back to Sansar$ from the Process Payment wallet. - Many broken docs links fixed, Still more to go to update missing images and pages. Source: https://docs.sansar.com/patch-notes/46-0-0 --- # Sansar 45.0.30 patch notes Released July 31, 2024. ## General Updates - Scroll wheel now changes camera speed in edit mode. - New diagnostic mode for viewing the resolved radiance. (shows GI and bounced lighting effects clearer) - Added hotkeys in edit mode for the world-space adjustment (TAB) and the surface snap gizmos (ALT). ## Script API updates - Adjust lighting range and intensity script API limits to match in editor limits. ## Shader Updates - Add UV offset property to several shaders. (With toggles for AO and diffuse layers) completing the texture adjustment trio scale rotate and move! - Added an additional uv offset toggle for the Emissive pass on relevant shaders. - Fix non-functional 'Fluid Distortion' effect on the Transparent Multibump shader. - Fix 'fluid distortion' effect not applying to the shadow pass of alpha masked + uv anim shaders. - Fix for non-functional uv scale slider in screenspace shaders. ## General Bug Fixes - Questing system back online, may require some testing. - Fix backpack spawn lifetime increased to infinite not working. - Small spelling error in UI. - Fix web listings losing the main picture when editing. ## VR Bug Fixes - Now correctly selects the Oculus controller scheme when connecting a Quest via SteamVR Link. - Now selects the Oculus controller schema when connecting a Pico via Pico Connect. - Attempt to fix the UI jitter reported by some VR users. Source: https://docs.sansar.com/patch-notes/45-0-30 --- # Sansar 45.0.28 patch notes Released March 30, 2024. ## Bug Fixes - Fixed some broken links in game - Fix multiple issues with reflections being too shiny - Sansar Park should appear on codex correctly ## Shader Updates - Multiple bug fixes for 'Fluid Distortion' effect. - Add Scale and Amplitude properties for the 'Fluid Distortion' effect. - Add Luma and Gamma mode toggles to Displacement Media shader. - Add UVScale property to the Billboard and Pixel Billboard shaders. - Sampler change for displacement textures. ## General Updates - Increased backpack item lifetime to unlimited, items will clear on player leaving world or with buttons in backpack. - Discovery of Red and Green channel in roughness maps allowing creation of Anistrophic maps - New world template list now in alphabetical order with your own worlds appearing towards the top - Bundle purchases now directed to the web store Source: https://docs.sansar.com/patch-notes/45-0-28 --- # Sansar 45.0.25 patch notes Released February 19, 2024. HotFixes for last patch - Fix of flying mode not activating - Fix for glowing vignette when reflections are enabled in scenes with strong bloom. - Fix for asset importer error when fbx scenes contain more than a single mesh. - Addition of Clamp setting in new Media: Displacement shaders. - Asset importer bug for rigged items fix. Source: https://docs.sansar.com/patch-notes/45-0-25 --- # Sansar 45.0.22 patch notes Released February 16, 2024. ## General Updates **REFLECTIONS ADDED!** Must be enabled in settings 'Graphics/VR' as this is considered resource-intensive. The reflectivity of objects is controlled by the existing Roughness maps; some objects may need adjustment if using maps that are too shiny. **FLYING MODE ADDED!** Must be enabled by the world owner. Controls: Z to toggle, WASD or arrows for directional movement, C for down, E for up. Flight speed is controlled by avatars' run speed, so scripts can adjust. ## Bug Fixes - VR BugFix: 3rd person camera control now enabled when in a sit point 'driving mode'. - Import BugFix: for the 'spin of death' asset importer crash when the fbx scene is too large. ## Shader Updates - New Shaders: Media: Displacement+UV Animation shader and Two sided variant. This enables the option to use a media stream video for vertex displacement. Screens will need to be high poly for this to work, use sparingly! - Additional Side-by-Side UV split option added to this shader to use the same stream for separate color and displacement information; this must be set up in your video's stream and is a 50/50 side by side split. ## Settings Updates - Reflections toggle added to Graphics/VR options menu. - Flymode toggle added to edit mode scene settings to allow control over flight per world. Defaults to off. - Disable diagnostics toggle added to edit mode. Source: https://docs.sansar.com/patch-notes/45-0-22 --- # Sansar 45.0.20 patch notes Released February 9, 2024. ## General updates - Driving mode created: you must now jump, crouch, or teleport to exit any sitpoint to allow scripts to use regular movement controls for vehicles. WASD mimics numpad inputs of 8,4,5,6 also combining 2 and 5 into S. - A new look has been added to the first time user avatar carousel. - Default gifting amount changed to zero to avoid accidents. - More descriptive error messages along with user advice when FBX import fails due to problems with the node names. ## Bug Fixes - Umbra issue fixed. - Fixed crash caused by long bio names. ## Shader updates - Displacement objects now cast shadows based on displaced verts. ## Settings Updates - Option to disable all media streams added to Advanced Settings. - GPU acceleration enabled for media streams reducing CPU load, This can be disabled in Advanced settings if it causes any side-effects. Source: https://docs.sansar.com/patch-notes/45-0-20 --- # Sansar 45.0.19 patch notes Released January 29, 2024. ## general updates - Added advanced settings panel. - Finished implementation of multi-jump. - UI now draws at native resolution when running with reduced render resolution. - Moved a few settings into the new Advanced menu. ## Additions to settings panel - FSR Adaptive Sharpening when running with reduced render resolution. - Clear cache button in the Advanced Settings. - Max/Min cache size is now configurable from the Advanced Settings. - Force Single instance toggle added (ability to open more than one gameclient) ## VR updates - Resized + relocated VR diagnostics button. - Bugfix: VR keyboard double typing fixed. Source: https://docs.sansar.com/patch-notes/45-0-19 --- # Sansar 45.0.17 patch notes Released January 25, 2024. ## General Updates - T Teleport Defaulted to OFF - Multi-jump created defaulted at 1 jump - Improved network packet handling for v4 packets - New diagnostic modes added: Unlit, Normals and Scale view ## World Build updates - Added T teleport setting: [T key] teleport to freecam now defaults to off and needs to be enabled by owner. - Added Multi-jump setting: amount of jumps is controlled by world owner. - extra diagnostics views added to build mode also. ## VR Updates - Bugfix: Chat panel appearance - Bugfix: VR keyboard being cutoff on login and ingame - Addition of 'Home' button to wrist - VR diagnostic view enabled and mode cycle button added to wrist Source: https://docs.sansar.com/patch-notes/45-0-17 --- # Sansar 45.0.16 patch notes Released January 16, 2024. ## General Updates - Improved avatar LOD 0 range to be further out. Note: Avatar requires a change to be saved in lookbook to take effect ## Backpack updates - Shop button added (just opens store for now) - added sorting to desktop - Added buttons to clear spawned backpack items to VR. - added floating UI panel to VR mode ## Shader Updates - Shader list reordered for new shaders Fresnal, Diffract, Pixelize, Screenspace. to be grouped together as 'specialized shaders' - Small shader updates and tweaks - New Pixel + UV Anim shader. - New Pixel + Alpha Mask shader. - New Screenspace + UV Anim shader. Note: Screenspace shaders are in testing expect changes to be made and any items made with them to need tweaks. Source: https://docs.sansar.com/patch-notes/45-0-16 --- # Sansar 45.0.14 patch notes Released January 10, 2024. ## Bugfix - Minor shader fixes. ## Shader changes - 'Fluid Distortion' wobble effect now also contributes to the diffraction in the 'Multibump + Diffraction' shader. - New color blending checkbox on 'transparent' shaders adds better color blending from the albedo slot and provides richer color in darker areas Source: https://docs.sansar.com/patch-notes/45-0-14 --- # Sansar 45.0.12 patch notes Released January 9, 2024. ## Bugfix - Fix for diffracted water not diffracting ## New Shaders Added - Standard+Emissive+Screenspace Shader added screenspace shader has the UV images remain aligned with the camera regardlessly of models movement Source: https://docs.sansar.com/patch-notes/45-0-12 --- # Sansar 45.0.11 patch notes Released January 9, 2024. ## General Updates - Added a media screen to backpack, will only show existing media in world does not contain a media script of its own ## Bugfix - Fix for "Standard + Emissive + Stereographic" shaders appearing blacked out. - Small fixes and tweaks to the Pixelize and Fresnel shaders. ## New Shaders Added - New "Billboard + Pixelize" shader. - New "Multibump + Diffraction" shader. (To create diffractive waves on water you need only upload a normal map with the waves or ripples you require) Source: https://docs.sansar.com/patch-notes/45-0-11 --- # Sansar 45.0.9 patch notes Released January 3, 2024. ## General Updates - Basejump from freecam location with 'T' - Controller keybinds updates and fixes - Diagnostics enabled in homespace ## Shader Updates - AO texture slots added to Opaque base shaders. - Displacement added to "Billboard" shader. - Bugfix for displacement texture accounting. ## New Shaders added - Fresnel ("Standard + Emissive + Fresnel" & "Standard Two Sided + Emissive + Fresnel") - Pixelize ("Standard + Emissive + Pixelize" & "Standard Two Sided + Emissive + Pixelize") ## Diffraction shaders - "Standard + Diffraction + Alpha Mask" - "Standard Two Sided + Diffraction + Alpha Mask" - "Standard + Diffraction + Alpha Mask + UV Animation" - "Standard Two Sided + Diffraction + Alpha Mask + UV Animation" ## Bugs Fixed - New bugs created enjoy finding them Source: https://docs.sansar.com/patch-notes/45-0-9 --- # Sansar 45.0.8 patch notes Released December 22, 2023. ## General Updates - Added new backpack items and item removal controls - Increased intensity and range for point lights. They can now cover a 4km distance when maxed out. - Added fire 🔥 to the chat emoticons - HDR toggle without restarting the client - No chat panel auto popup - Enabled hand and head aiming when holding any object ## Shader Updates - 'After-images' effect is available for the "Emissive" and "Emissive + UV Animation" shaders. (Togglable effect per material with tuneable decay-rate) - 'Fluid-distortion' affect added to the "Transparent + Multibump" shader. ## Bugs Fixed - Fix for arms rotating inappropriately when sitting in VR - Increased server connection timeouts - affected some users with challenging builds Source: https://docs.sansar.com/patch-notes/45-0-8 --- # Sansar 45.0.5 patch notes Released October 10, 2023. ## General Updates - A fix for the snapshot function creating SDR images that were too washed out when HDR is enabled. - Fix for the harmless 'invalid format' error that showed up when importing new assets. - Displacement aware depth shader for static and opaque+emissive shaders this fixes the shadowed versions of objects being left behind when displaced. - bugfix for blank textures on two of the new shaders when going from edit mode to runtime ## Shader Updates - Fixes for some displacement bugs. It should also interact more accurately with some post and lighting effects. - Add UV Scrolling function to the transmissive+multibump shader. Good for water. - You can now specify negative values for the displacement scale numbers. - Added 'Fix Shimmering' toggle to the alpha UV shaders. - Added 'ClampUVs' toggle to the alpha UV shaders. - Fix for an issue that caused coloured lines to erroneously appear around the edges of many existing alpha emissive materials. Source: https://docs.sansar.com/patch-notes/45-0-5 --- # Sansar 45.0.1 patch notes Released September 29, 2023. - Improved handling of HDR should only be visible with it enabled in pc settings - Added many new emojis to in game chat - Improved script debug logging - Whitelist TupleElementNamesAttribute for scripting - Minor bug fixes Source: https://docs.sansar.com/patch-notes/45-0-1 --- # Sansar 45.0.0 patch notes Released September 20, 2023. The Displacement Shader Update is here! ## General Updates - Added sorting to the scene list in 'deploy' menu - FPS Max raised to 200 (settable) - Greatly Increased AABB ## Shader Updates - Displacement shaders, and Vertex Animation system! - UV rotation for texture maps - Addition of 3 more two-sided shaders - 'ClampUVs' option for flipbook shaders that fixes the problem of flip book frames repeating erroneously - Fluid distortion effect added to UV anim shaders (wiggly textures) ## Settings Updates - Default mic mute state on launch (mute/unmute). - Split render quality and render resolution into separate options. - Allow setting render quality separately for VR and non-VR. - FPS limiter controls (for both foreground and background). - Selectable max texture VRAM usage per avatar. For crisper avatars, or reduced VRAM usage. - Experimental HDR support. Togglable in settings. You must own an HDR monitor, and HDR must be enabled in Windows ## Bugs Fixed - Bugfix Thumbnails sometimes fail to load first time when viewing personal worlds list - Crash fix when changing desktop audio device with VR disabled - Crash fix for viewing the desktop controls overlay with VR disabled on launch - BugFix Tiny avatar Ik sticking to over hanging surfaces - A fix for the audio crackling and distortion that still occurs when minimizing on some machines - Many other small crash fixes many removed gremlins. Source: https://docs.sansar.com/patch-notes/45-0-0 --- # Sansar 44.3.0 patch notes Released June 12, 2023. ## General Updates - IJKL keyboard control for the camera. Helps players with no mouse - Client directory file organization. Moved Dullahan to subfolders - Add launch parameters to force specific VR runtime - OpenVR/Oculus - Scriptable scoreboard alpha version - Improved finger tracking for knuckles controllers - Added two new emissive shaders - New Tiny avatars!!! ## Bugs Fixed - Crash triggered by sitting in first person with VR disabled - Crash triggered by accessing haptics when VR is disabled - Memory leaks within JSON packed web service packets - Fix for several build errors when targeting Linux - Remove keyboard shortcut for diag panel in production builds - Speech graphics scaling fixed at smaller avatar scales - Crash when displaying a large amount of personal worlds - Crash when de-serializing an invalid object - Updated logo for spinning perfection - Prevent media screen connections to [try.sansar.com] - Force v4 sockets by default Source: https://docs.sansar.com/patch-notes/44-3-0 --- # Sansar 44.2.2 patch notes Released February 12, 2023. Small fixit patch - Fix for launching with VR mode disabled - Fix for the border on the avatar info box volume control - Fixed crash when using grip and trigger in VR Source: https://docs.sansar.com/patch-notes/44-2-2 --- # Sansar 44.2.0 patch notes Released February 19, 2023. ## General update - Added TV Mode, Game Streaming Mode, and Guest Mode - New TV Mode character control scheme - VR keyboard typing improvements ## Bug Fixes - Reticle fix for the new UI scaling - Avatar info panel UI scaling fix - Login issue related to steam logins fixed Source: https://docs.sansar.com/patch-notes/44-2-0 --- # Sansar 44.1.0 patch notes Released February 3, 2023. ## General Updates - Individual volume controls V1 - Doubled the maximum 3rd person camera distance - Full body VR tracking improvements - Added the ability to base64 encode launch parameters - Updated the default worlds to the all-new Sansar Park! ## Bug Fixes - Avatar names displayed on top of UI panels - Blocked people are visible when they use dual login - Reduced the maximum grab distance in VR Source: https://docs.sansar.com/patch-notes/44-1-0 --- # Sansar 44.0.0 patch notes Released January 17, 2023. ## Bug Fixes - Edit mode list type crash - Edit mode Trigger Volume crash - DST bug when editing existing events - Prevent blocked users from unmuting each other - Sansar crashes when renaming an object - Recall searches in the Marketplace when going back - Non-English system language fails to load Sansar - Head deformation while dancing ## General Updates - New users should teleport to social hub - Remove login Twitch + Steam registration (Client) - Use the starting world chosen in settings when leaving the lookbook - Disable keyboard shortcuts for simulation in the lookbook - Prevent usage of F1 shortcut while in Cinema Mode - Improve Xbox controller functionality - Support for non-parallel projection VR lenses - Create a keyboard shortcut to hide UI - CTRL+H hides/unhides UI - UI Scaling for large resolutions Source: https://docs.sansar.com/patch-notes/44-0-0 --- # Sansar 43.5.5 patch notes Released June 16, 2022. Small update for VR arm bug Source: https://docs.sansar.com/patch-notes/43-5-5 --- # Sansar 43.5.0 patch notes Released June 7, 2022. Small Update for re-enable Auto-Occlusion in Edit Mode Source: https://docs.sansar.com/patch-notes/43-5-0