Cutout
The Cutout asset lets you create a World Lens by importing just a 2D image or animation. A cutout includes movement, scale, rotation, shadow and the ability to always look at the camera. Multiple Cutouts can be added to the Lens allowing you to create a 3D scene with movable 2D objects.
You can find this asset in the Asset Library with the name Cutout
.
Guide
Once you import the asset from Asset Library, you can find the package in the Asset Browser
panel.
Drag the prefab Cutout__PLACE_IN_SCENE
inside the Cutout
folder, into the Scene Hierarchy
panel to create a new instance.
You can add as many cutout as you'd like into your project. To add more, Learn more in the Multiple Cutouts section.
If it's not added yet, your project's Camera
(in the Scene Hieararchy
panel), should contain a Device Tracking
component (Inspector
panel > Add Component +
button).
The Device Tracking
component allows your Lens to track the world. This is important as this asset is designed for the rear camera, when you are moving your cut outs along the surface of the world.
Switch Preview Video
Switch the preview video to one of our World Lens preview videos. In the preview panel, press the Image / Video Mode
button. Then, in the drop down at the top of the Preview
panel, select any video under the World
category.
If you don’t see the World
category, press the Switch Camera
button to switch your preview to the rear camera.
Add Resource
First import a custom 2D texture by dragging and dropping it into the Asset Browser
panel. This can be a PNG
, JPG
or GIF
animation. For more information on importing 2D Animation, refer to the 2D Animation guide.
Select Cutout Controller
Next, in the Scene Hierarchy
panel, select the CutoutController [EDIT_ME]
object.
Configure Cutout
With the CutoutController [EDIT_ME]
object selected, you can configure its settings in the Inspector
panel. First, click the Texture
field and set it to your newly imported Texture resource.
You can then configure the following settings to tune your cutout.
- Ground Offset: How far above or below the cutout is from the ground
- Shadow: When enabled, the cutout casts a real time shadow on the ground. It is derived from the silhouette of the 2D image
- Look At Camera: When enabled, the cutout will always face the camera about the Y axis
- Flip: The 2D image will be mirrored horizontally
- Camera: The camera the cutout should look at.
Scale Cutout
To resize the Cutout object, select the CutoutController
object in the Scene Hierarchy
panel. Then, in the Scene
panel, press the R
keyboard shortcut to enable the object's scale handles. Drag the cyan
cube in the center of the object to scale up or down the object uniformly.
Multiple Cutouts
After you've added a new Cutout Controller object, you'll want to offset its starting position so it's not overlapping your original cutout. To do this, select the duplicated object in the Scene Hierarchy
panel. Then, in the Scene
panel, press the W
keyboard shortcut to enable the object's movement handles. Drag the red
and blue
handles to offset it along the x and y axis.
Shadow
You can turn on Shadow in your Lens by toggling the Shadows
tickbox in the Light Source
component of a Directional
Light Type.
For example, in the Scene Hieararchy
panel, select the Light
object, then in the Inspector
panel, modify the Light Source
component.
The direction of the shadow can be adjusted by selecting the Light
object in the Scene Hierarchy
panel. Then, with the light selected, in the Scene
panel rotate the light by pressing E
keyboard shortcut to activate the object's rotation handle, and dragging the axis rings.