# 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](/latest/script-api-docs/example-scripts/simple-script.md) (*SimpleScriptExample.cs*)                                                                                                                                          | This script shows how you can use the new "Simple Script" base class.                                  |
| [Visitor Tracker](/latest/script-api-docs/example-scripts/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](/latest/script-api-docs/example-scripts/follow-the-path.md) (*FollowThePath.cs*)                                                                                                                                            | This script moves a dynamic object along a route of points, in a loop.                                 |
| [Random Movement ](/latest/script-api-docs/example-scripts/random-movement.md)(*RandomMovement.cs*)                                                                                                                                           | This script randomly moves a dynamic object around its starting position.                              |
| [Teleport Hotkeys](/latest/script-api-docs/example-scripts/teleport-hotkeys.md) (*TeleportHotkeys.cs*)                                                                                                                                        | This script allows you to set hotkeys that will teleport users to another experience when pressed.     |
| [Stats Example](/latest/script-api-docs/example-scripts/stats-example.md) (*StatsExample.cs*)                                                                                                                                                 | This script provides useful statistics about the current experience.                                   |
| [Sound Randomizer ](/latest/script-api-docs/example-scripts/sound-randomizer.md)(*SoundRandomizer.cs*)                                                                                                                                        | This script plays randomly from a list of sounds at randomized intervals.                              |
| [Cannonball](/latest/script-api-docs/example-scripts/cannonball.md) (*CannonGameExample.cs*)                                                                                                                                                  | This script throws a cannonball from the avatar.                                                       |
| [Reflective Detector](/latest/script-api-docs/example-scripts/reflective-detector.md) (*ReflectiveDetectorExample.cs*) & [Reflective Tracker](/latest/script-api-docs/example-scripts/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

[Creative Commons License](/latest/creative-commons-license.md)

Have more questions? Join our [Discord!](https://discord.gg/sansarofficial)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sansar.com/latest/script-api-docs/example-scripts/example-scripts-in-sansar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
