Sansar Docs
  • 🚀Welcome to Sansar
  • 📚GLOSSARY
  • 🎏Patch Notes
  • 😇Work in Progress
  • ⚠️Creative Commons License
  • Support
    • General Troubleshooting
      • General FAQ
      • The Sansar Cache
      • The Sansar Log
    • Contact Support
  • Sansar Basics
    • Installation And Compatibility
      • Installing Sansar
      • System Requirements
      • Sansar Compatibility FAQ
      • Sansar on Mac
      • Body Tracking Vive
      • Configuring Firewalls
    • Account Management
      • Account Set Up
      • Avatar Name and ID
      • Adding Payment Method
      • Discord FAQ
      • Steam Integration
      • Subscription FAQ
    • Controls
      • Avatar Hand Gestures in VR
      • FreeCam and CineCam
      • Game Controller Buttons
      • HTC VIVE controls
      • Keyboard Shortcuts for Editing a Scene
      • Keyboard Shortcuts for Styling Your Avatar
      • Keyboard Shortcuts for Visiting an Experience
      • Mouselook Mode
      • Oculus Rift Controls
      • Vive Index Controls
    • Settings
      • General Settings
    • VR Settings
      • VR Settings Menu
      • Calibrating Height in VR
  • Exploring in Sansar
    • Navigate and Explore
      • The Codex
      • Instances
      • Interactive objects
      • The Main Menu
      • The Nexus
      • Portals
      • Quests
      • Quick Start: Exploring in Sansar
    • Socialize And Connect
      • Chat Panel
      • Experience Points, Levels, and Titles.
      • Finding People in Sansar
      • Identifying Interacting With Avatars
      • The People panel
      • User profiles
    • Attending events
      • Deploying Unpublished Event to Event World
      • Adding Events to Your Calendar
      • Attending Events in Sansar
      • Avatar Broadcasting FAQ
      • Creating Your Own Events
      • Redemption Codes
      • Tipping
    • Share Content
      • Streaming Sansar
      • Taking a photo
  • Avatar Creation
    • Avatar Basics
      • Avatar 2.0 FAQ
      • Customizing Your Avatar
      • Avatar Emotes
      • The Avatar Editor
    • Dressing The Avatar
      • Fitting Designer Clothing to your Avatar
      • Setting Custom Emotes
      • Wearing Accessories
      • Wearing Rigged Clothing
    • Managing Avatar Items
      • Importing Avatar-Related Items
      • Editing an inventory item's name
      • Editing an inventory item's image
      • Deleting avatar looks from your inventory
      • Importing a custom emote animation
      • Managing your avatar looks inventory items
    • Avatar Resources
      • Avatar Reference Files
      • Blender - Avatar files
      • Blender - Using Decimate Tool
      • Exporting Custom Avatars From Blender
      • Sansar Skeleton Skinning Details
      • Using Animation Skeleton
  • Creating In Sansar
    • Importing Things to Sansar
      • Supported file types
      • AABB Bounding Box and Item Restrictions
      • Importing Audio
      • Importing a Custom Avatar
      • Importing World Items
      • Importing Collision Volumes
      • Importing Accessories
      • Importing Clothing
      • Importing Emotes
      • Importing Hair
      • Importing Custom Scripts
      • Importing a Skybox
      • Troubleshooting Import Errors
    • Shaders and Materials
      • Shaders Information
      • Materials Information
      • VAT Shader Guides
        • VAT Shader Basics
        • VAT Technical Info
      • Displacement Guides
        • Simple Displacement
        • Advanced Displacement
    • Marvelous Designer Info
      • Marvelous Designer Integration
      • Marvelous Designer Creator Resources
      • Marvelous Import and Export
      • MD Limitations
    • Shader Scripting
    • Materials editing and shaders
    • Creator Tools
      • Creating a World
      • Creating Quests
      • Diagnostics Toolbar
      • Importing Items to Sansar
      • My Worlds Panel
    • Managing Worlds
      • Quick start: Creating experiences in Sansar
      • Deleting an experience or scene
      • Deploying a new scene to an existing experience
      • Editing a scene
      • Experience memos
      • Linking A Scene To A World
      • Managing your scenes and worlds
      • Moderation Tools for World Owners
      • Publishing Options for Your Experiences
      • Renaming a scene
      • Saving and Building A Scene
      • Sharing Your Experiences
      • Visiting your own experience
    • Part Of The World Editor
      • Object Stats Toolbar
      • Object Components
      • Parenting objects
      • Scene Item Inventory
      • Scene Objects Panel
      • Collision Volumes
      • Scene Settings
      • System objects
      • Object Motion Types
    • Working With Scripts
      • Working With Scripts
      • Working With Trigger Volume
      • Referencing Scene Components
      • Intro to Scripting in Sansar
      • Using the Script Console
      • Setting Script Parameters
      • Adding Scripts to an Object
      • Configuring Teleport Scripts
      • Simple Script User Guide
    • Working With Audio and Video
      • Working With Audio
      • Creating Media surface
      • Streaming Web Audio
      • Audio Emitter
      • Sansar Audio FAQ
      • Using Media Streams
      • Ambisonic Sounds
      • High Quality Spacial Audio
      • Audio Resource - Room Tones
      • Previewing Audio and Video in a Scene
      • Using Audio Materials
    • Working With Lights
      • Working With Lights
      • Light Types
      • Global Illumination
  • Sansar Store
    • Using the Sansar Store
      • The Sansar Store
      • Buying Items From The Store
      • Redelivering Lost Purchases
    • Buying and Selling Sansar Dollars
      • Gifting Sansar Dollars
      • Buying Sansar Dollars
      • Converting Sansar Dollars
      • Processing US Dollar Credit
    • Selling Your Content
      • Hidden Store Listings
      • Selling Items in Sansar Store
      • Selling Items in an Experience
      • Allowing Resale Of Items
      • Buyers Permissions
  • Guidelines and Moderation
    • Guidelines and Policies
      • Terms of service
      • Sansar's Discord Server Rules
      • Community Standards
      • Content Guidelines
      • World Publishing Guidelines
      • Store Listing Guidelines
      • Store Banner Guidelines
      • Event Guidelines
      • Privacy Policy
      • Sansar Freeware License Agreement
      • Intellectual Property Infringement Notification
      • Cookie Policy
    • Moderation and Reporting
      • Abuse and Griefing
      • Blocking Avatars
      • Muting Avatars
      • Reporting abuse
      • Reporting issues and bugs
      • Security issues
  • Script API Docs
    • General Information
      • External Script Repository's
      • Sansar Script API
      • Script API Updates
      • Restricted API's
    • Example Scripts
      • Example Scripts in Sansar
      • Cannonball
      • Follow The Path
      • Random Movement
      • Reflective Detector
      • Simple Script
      • Sound Randomizer
      • Stats Example
      • Teleport Hotkeys
      • Visitor Tracker
      • Mover Examples
    • Sansar Namespace
      • Namespace
      • Color
      • Mathf
      • Quarterion
      • Vector
      • Vector Extensions
    • Sansar.Script Namespace
      • AddEntryAttribute
      • CancelData
      • ComponentID
      • CoroutineException
      • Default Attributes
      • Editor Visible Attribute
      • Entries Attribute
      • Event Data
      • ICoroutine
      • IEvent Subscription
      • Instance Interface
      • Locked Attribute
      • Log
      • MaxEntriesAttribute
      • Memory
      • MinEntriesAttribute
      • NonReflectiveAttribute
      • ObjectID
      • OperationCompleteEvent
      • RangeAttribute
      • Reflective
      • Script.Base
      • Script Event Data
      • Script Handle
      • ScriptID
      • SessionID
      • Simple Script Event Data
      • ThrottleException
      • Timer
      • Tooltip Attribute
    • MetaData Namespace
      • Assembly MetaData
      • Script MetaData
    • Sansar Script Testing Namespace
      • Assertion Failure Exception
      • Assertions
    • Sansar Utility Namespace
      • GenericEnumerable <T>
      • GenericEnumerable<T>.GetItem
      • JSON Serialization Data
      • JSON Serialization Data 1
      • JSON Serializer
      • JSON Serializer Options
    • Sansar Simulation Namespace
      • Agent Info
      • Animation
      • Audio Component
      • Camera Control Mode
      • Character Tracker
      • Chat
      • Client
      • Cluster
      • Command Action and Data
      • Component Type
      • Control Point Type
      • Held Object
      • HTTP
      • Interaction
      • Light
      • Media Action
      • Mesh Component
      • Modal Dialogue
      • Move Mode and Mover
      • Objective
      • PlayHandle
      • PlaySettings
      • PlayStatus
      • Quest
      • RayCastHit
      • Rigid Body
      • Scene
      • Scene Public
      • Simple Script
      • Sit Event Type
      • Sit Object Data
      • Sound Resource
      • Stream Channel
      • Tutorial Hint
      • UI
      • User Data
Powered by GitBook
On this page
  • Selling items inside an experience
  • Open a store listing by interacting with an object
  • Finding the Scene Script Library
  • Configuring Store Listing
  • Configuring Interaction
  1. Sansar Store
  2. Selling Your Content

Selling Items in an Experience

PreviousSelling Items in Sansar StoreNextAllowing Resale Of Items

Last updated 1 year ago

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.


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.



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.



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.

Find Scene Script Library in your purchased scripts. No purchase is necessary; it is included by default.
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.
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