Placing Objects in AR

Sylvain Joly

Search Knowledge Base by Keyword

You are here:

Placing Objects in AR

(Note: This section only concerns SpatialStories for AR)

Placing objects in AR is very different from how you would do in VR, as you cannot control the environment of your end user. In Unity, your objects can be placed in the scene as you would place them in reality in relation to the camera but when you start your app on a mobile device, you need to have a system smart enough to know how to place those objects depending on what the device is detecting.

Luckily for you we’ve prepared an automated system allowing you to place your characters, objects, and more the way you need. The ‘Object Mover Behaviour’ allows you to place objects that are visible and setup in your scene and the ‘Object Instantiator’ allows you to instantiate prefabs at runtime. Both use what we call a Cursor System. You will be able to define a cursor (visual representation) for each object that you place.

CURSORS

Each object to move or instantiate can have its custom cursor in the Cursor Visual field (optional). Cursors show the position where an object can be placed (depending on the constraints you defined). Usually Cursors are Prefabs of your project. They can either be a representation of the object or a general cursor (like a circle or a target image).

For instance, if you want to instantiate a Chair but before spawning it definitely, you want a representation of your chair while you’re moving around (like a semi-transparent chair), you would define the ghost chair as your Cursor Visual for the chair.

Here, the ghost character with the green circle around is a cursor, it shows up when the device finds a flat surface. Then when the user taps on the screen the actual character (Object to move) is placed there and your interactive experience can start.