Visitor Tracker
Example Scripts: Visitor Tracker
Last updated
Example Scripts: Visitor Tracker
Last updated
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:
Download the script file from the download link at the end of this article.
Follow the instructions provided in Working with scripts to upload the script and add it to an object.
Open the object's Properties panel and go to the Script Settings section.
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.
Once you have finished these steps, your script is ready. Save and build your scene.
If you want to verify if the script is running correctly, visit the built scene.
While visiting the scene, open the Chat app.
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.
Script parameters
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.
Have more questions? Join our Discord!