# Snapped Object
How to achieve object persistence for a lasting experience
The SnappedObject script facilitates the persistence of objects by allowing for their placement and anchorage within the physical environment. Upon application of this script to your Prefabs, the objects remain firmly in place and consistent across sessions or application closures. In the event of renaming an object, it is advisable to reapply the script to ensure its continued persistence.
# Getting Started
Follow the instructions to setup a clean project with Resight Engine
# Resight Engine Settings
Make sure to create the AR components from the Getting Started section
- Once done, your project hierarchy should look like the following:
Create an empty 'Resight' game object and add the 'LibResight' script to it
- Enter your developer key (provided by Resight) and a namespace
- A namespace can be any string (without spaces), for example, Default / Production / Test-1
- A namespace is a unique data store under your developer account
- Mapping data and snapped objects are not shared between different namespaces
To obtain the development key, sign-up (opens new window) on our website. If you've registered and haven't received it yet, please contact us.
- The following steps are required in order to facilitate snapped objects:
- EntitiesManager (set the origin to the XR origin object)
- Create or select a Prefab in your project folder
- Double click it to get into Prefab Editting mode
- Add 'SnappedObject' script to your Prefab
Persistent objects should be placed in the "Resources" folder.
# Build & Run
From the 'Build Settings' build and run the app on your iOS device.
Move around with your app running and let Resight Engine create the 3D scan as you go.