Components
Components are attached to SceneObjects and define object behavior. See also: Inspector Panel
Animation
Used by AnimationMixer to animate a single object in the hierarchy. These are automatically added to SceneObjects when importing animated FBX files. See also: Playing 3D Animation Guide, AnimationMixer, AnimationLayer.
Component.AnimationThis is the API for Lens Studio 4. For the latest API documentation, click here.
AnimationMixer
Controls playback of animations on the attached SceneObject and its child objects. Please refer to the Playing 3D Animation Guide for setting up and playing animations.
Component.AnimationMixerThis is the API for Lens Studio 4. For the latest API documentation, click here.
AudioComponent
Used to play audio in a Lens. You can assign an AudioTrackAsset to play through script or through the AudioComponent's inspector in Lens Studio. See the Playing Audio guide for more information.
Component.AudioComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
AudioEffectComponent
Used to add an audio effect to a Lens. When present in the scene, it will automatically apply the selected audio effect to recordings made with the Lens. See the Audio Effect guide for more information.
Component.AudioEffectComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
AudioListenerComponent
A component that receives input from Audio Components that have Spatial Audio enabled. Calculates their positions relative to the scene object it is attached to,and properly mixes them.
Component.AudioListenerComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
BaseMeshVisual
The base class for all mesh rendering components. Comparable to the former class "MeshVisual", which was split into the classes: BaseMeshVisual, MaterialMeshVisual, and RenderMeshVisual.
Component.BaseMeshVisualFaceStretchVisual, HairVisual, LiquifyVisual, MaskingComponent, MaterialMeshVisual, Text, VFXComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
BlendShapes
Controls blend shapes connected to imported animation content.
Note: this class has been deprecated. Please use the blend shapes functions in RenderMeshVisual.
Component.BlendShapesThis is the API for Lens Studio 4. For the latest API documentation, click here.
BlurNoiseEstimation
Used to analyze the camera input and apply similar image artifacts to your AR objects in order to allow it to blend and match the real world better.
Component.BlurNoiseEstimationThis is the API for Lens Studio 4. For the latest API documentation, click here.
BodyComponent
Derived from ColliderComponent, attaching this to a SceneObject turns it into a dynamic rigid-body that is automatically moved by the physics simulation in response to gravity, collisions, and other forces.
Physics.BodyComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
Camera
Renders the scene to a Render Target texture. A Camera will only render a SceneObject if the SceneObject's render layer is enabled on the Camera. For more information, see the Camera and Layers guide.
Component.CameraCamera.BaseRenderTarget, Camera.ColorRenderTarget, Camera.CubemapFace, Camera.DepthBufferMode, Camera.DepthStencilRenderTarget, Camera.DeviceProperty, Camera.TypeThis is the API for Lens Studio 4. For the latest API documentation, click here.
Canvas
A 2D canvas anchored in 3D space that acts as the root of the ScreenTransform hierarchy. ScreenTransform SceneObjects can be placed on the Canvas, and the Canvas can be sized and placed anywhere in 3D space. It is like a painter’s canvas for ScreenTransforms.
Component.CanvasThis is the API for Lens Studio 4. For the latest API documentation, click here.
ClearScreen
Clears depth in the drawing order.
Component.ClearScreenThis is the API for Lens Studio 4. For the latest API documentation, click here.
ClothVisual
Handles the mesh data of cloth and prepares it for cloth simulation. Also controls all the parameters of the cloth simulator and colliders.
Component.ClothVisualClothVisual.BendModeThis is the API for Lens Studio 4. For the latest API documentation, click here.
ColliderComponent
Collider used by the Hair Visual for its simulation.
Physics.ColliderComponentBodyComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
ColocatedTrackingComponent
Creates Colocated Connected Lenses experiences by enabling the creation and tracking of a shared space which can be used to place several users in the same coordinate frame. This shared space will be made available and can be tracked by any friend you invite to join your session via Snapcode. Users are expected to be located in the same room when using the colocated feature. This component needs to be attached to the camera.
Component.ColocatedTrackingComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
Component
The base class for all components. Components are attached to SceneObjects.
ComponentAnimation, AnimationMixer, AudioComponent, AudioEffectComponent, AudioListenerComponent, BlendShapes, BlurNoiseEstimation, Camera, Canvas, ColliderComponent, ColocatedTrackingComponent, ConstraintComponent, DeviceLocationTrackingComponent, DeviceTracking, Gyroscope, Head, HintsComponent, InteractionComponent, LightSource, LocatedAtComponent, LookAtComponent, ManipulateComponent, MarkerTrackingComponent, MeshVisual, MLComponent, ObjectTracking, ObjectTracking3D, PinToMeshComponent, RectangleSetter, ScreenRegionComponent, ScreenTransform, ScriptComponent, Skin, SplineComponent, SpriteAligner, TrackedPointComponent, VertexCache, Visual, WorldComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
ConstraintComponent
Used to apply a constraint to an object.
Physics.ConstraintComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
DepthSetter
Writes video feed depth information to the depth buffer, which automatically sets up depth occlusion for 3D visuals. Only works in some cases, such as in Lenses for Spectacles 3. See the Lenses for Spectacles guide for more information.
Component.DepthSetterThis is the API for Lens Studio 4. For the latest API documentation, click here.
DeviceLocationTrackingComponent
Used to track a landmarker in the camera. Moves the SceneObject's transform to match the detected landmarker scene. See the Landmarker guide for more information.
Component.DeviceLocationTrackingComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
DeviceTracking
Moves or rotates the SceneObject to match device orientation.
If using "Surface" tracking mode, adding this to a SceneObject enables surface tracking for the scene, and moves the
object to a position and rotation that matches the physical camera's pose in the world. Surface tracking can also be enhanced
with native AR by enabling the "Use Native AR" option in the Inspector panel, or through script by setting the
component's surfaceOptions.enhanceWithNativeAR property.
If using "Rotation" tracking mode, adding this to a SceneObject will apply the device's real world rotation to the object.
If using "World" tracking mode, adding this to a SceneObject enables native AR tracking for the scene, and moves the object to a position and rotation that matches the physical camera's pose in the world.
See the Tracking Modes guide for more information.
Note: This component was named "WorldTracking" in previous versions of Lens Studio.
Component.DeviceTrackingThis is the API for Lens Studio 4. For the latest API documentation, click here.
EyeColorVisual
Applies an eye color effect to a face.
Component.EyeColorVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
FaceInsetVisual
Draws a section of a tracked face.
Component.FaceInsetVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
FaceMaskVisual
Applies a face mask effect. See the Face Mask Guide for more information.
Component.FaceMaskVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
FaceStretchVisual
Applies a face stretch effect. Face stretch features can be added to a FaceStretchVisual through the Inspector panel in Lens Studio. See the Face Stretch Guide for more information.
Component.FaceStretchVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
[DEPRECATED] Gyroscope
This class has been Deprecated. Please instead use the DeviceTracking component with Tracking Mode set to Rotation. See the Tracking Modes guide for more information.
Applies the device's gyroscope rotation to the SceneObject it is attached to.
Component.GyroscopeThis is the API for Lens Studio 4. For the latest API documentation, click here.
HairVisual
Component that renders hair simulation.
Component.HairVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
Head
Binds the SceneObject to a tracked face. See the Head Attached 3D Objects Guide for more information.
Component.HeadThis is the API for Lens Studio 4. For the latest API documentation, click here.
HintsComponent
Used to show and hide hints to the user. For more information and useful helper scripts, see the Scripting Hints Guide.
| Hint ID | Hint Message |
|---|---|
| “lens_hint_blow_a_kiss” | “Blow A Kiss” |
| “lens_hint_come_closer” | “Come Closer” |
| “lens_hint_do_not_smile” | “Do Not Smile” |
| “lens_hint_do_not_try_with_a_friend” | “Do Not Try With A Friend” |
| “lens_hint_find_face” | “Find Face” |
| “lens_hint_keep_raising_your_eyebrows” | “Keep Raising Your Eyebrows” |
| “lens_hint_kiss” | “Kiss” |
| “lens_hint_kiss_again” | “Kiss Again” |
| “lens_hint_look_around” | “Look Around” |
| “lens_hint_look_down” | “Look Down” |
| “lens_hint_look_left” | “Look Left” |
| “lens_hint_look_right” | “Look Right” |
| “lens_hint_look_up” | “Look Up” |
| “lens_hint_make_some_noise” | “Make Some Noise!” |
| “lens_hint_nod_your_head” | “Nod Your Head” |
| “lens_hint_now_kiss” | “Now Kiss” |
| “lens_hint_now_open_your_mouth” | “Now Open Your Mouth” |
| “lens_hint_now_raise_your_eyebrows” | “Now Raise Your Eyebrows” |
| “lens_hint_now_smile” | “Now Smile” |
| “lens_hint_open_your_mouth” | “Open Your Mouth” |
| “lens_hint_open_your_mouth_again” | “Open Your Mouth Again” |
| “lens_hint_raise_eyebrows_or_open_mouth” | “Raise Your Eyebrows / Or / Open Your Mouth” |
| “lens_hint_raise_your_eyebrows” | “Raise Your Eyebrows” |
| “lens_hint_raise_your_eyebrows_again” | “Raise Your Eyebrows Again” |
| “lens_hint_smile” | “Smile” |
| “lens_hint_smile_again” | “Smile Again” |
| “lens_hint_swap_camera” | “Swap Camera” |
| “lens_hint_tap” | “Tap!” |
| “lens_hint_tap_a_surface” | “Tap A Surface” |
| “lens_hint_tap_ground” | “Tap The Ground” |
| “lens_hint_tap_ground_to_place” | “Tap Ground To Place” |
| “lens_hint_tap_surface_to_place” | “Tap Surface To Place” |
| “lens_hint_try_friend” | “Try It With A Friend” |
| “lens_hint_try_rear_camera” | “Try It With Your Rear Camera” |
| “lens_hint_turn_around” | “Turn Around” |
| “lens_hint_walk_through_the_door” | “Walk Through The Door” |
Component.HintsComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
Image
A 2D visual used for drawing texture assets. Commonly used with ScreenTransform for drawing images on the screen.
See the Image guide for more information.
Component.ImageThis is the API for Lens Studio 4. For the latest API documentation, click here.
InteractionComponent
Allows the MeshVisual provided to this component to handle touches on the screen (blocking Snapchat from receiving the touches), and optionally let certain touch types to pass through (let Snapchat handle the touch).
Possible TouchType values:
- "TouchTypeNone"
- "TouchTypeTouch"
- "TouchTypeTap"
- "TouchTypeDoubleTap"
- "TouchTypeScale"
- "TouchTypePan"
- "TouchTypeSwipe"
Component.InteractionComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
[DEPRECATED] Label
Displays text in the scene. This is now deprecated in favor of Text. See the Text guide for more information.
Component.LabelThis is the API for Lens Studio 4. For the latest API documentation, click here.
LightSource
Acts as a source of light in the scene. See the Light and Shadows guide for more information about lighting.
Component.LightSourceThis is the API for Lens Studio 4. For the latest API documentation, click here.
LiquifyVisual
Applies a liquify effect to anything rendered behind it.
Component.LiquifyVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
LocatedAtComponent
A component which modifies the Transform of the object it is on to a position in the real world, based on a LocationAsset and a position.
Component.LocatedAtComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
LookAtComponent
Every frame, LookAtComponent rotates its SceneObject to face towards a target SceneObject.
Component.LookAtComponentLookAtComponent.AimVectors, LookAtComponent.LookAtMode, LookAtComponent.WorldUpVectorThis is the API for Lens Studio 4. For the latest API documentation, click here.
MLComponent
Transforms inputs (Textures or Float32Array) into outputs (Textures or Float32Array) using a neural network.
The neural network is represented by an MLAsset, which is set as the model property.
For more information, see the MLComponent Overview.
Component.MLComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
ManipulateComponent
Handles input information from user touch input via the TouchComponent to control Scale, Rotation, and Translation of objects.
Component.ManipulateComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
MarkerTrackingComponent
Used to track images in the camera. Moves the containing object's transform to match the detected image. For more information, see the Marker Tracking guide.
Component.MarkerTrackingComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
MaskingComponent
Clips visuals and Interaction Component events within a tree hierarchy. Any Visual or Interaction Components will be clipped user defined 2D bounds. These 2D bounds are defined by a Screen Transform. Useful for clipping some screen transforms--for example a scroll view.
Component.MaskingComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
MaterialMeshVisual
Base class for all MeshVisual components using Materials to render. Comparable to the former class "MeshVisual", which was split into the classes: BaseMeshVisual, MaterialMeshVisual, and RenderMeshVisual.
Component.MaterialMeshVisualClothVisual, EyeColorVisual, FaceInsetVisual, FaceMaskVisual, Image, PostEffectVisual, RenderMeshVisual, RetouchVisual, SpriteVisual, Text3DThis is the API for Lens Studio 4. For the latest API documentation, click here.
MeshVisual
This class has been DEPRECATED starting in Lens Studio 2.3.
The Component.MeshVisual typename is now an alias for BaseMeshVisual.
When upgrading a project to Lens Studio 2.3 or higher, any instances of the MeshVisual component will be upgraded to RenderMeshVisual.
This class was split into the following three classes, to better distinguish the behaviors of child classes.
BaseMeshVisual: Base class for all visual classes using meshes to render
MaterialMeshVisual: Child class of BaseMeshVisual, gives access to the Materials used to render
RenderMeshVisual: Child class of MaterialMeshVisual, gives access to the RenderMesh used to render
Component.MeshVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
ObjectTracking
Used to track objects in the camera. Moves the local ScreenTransform to match the detected image.
See the Object Tracking guide and the Hand Gestures Guide for more information.
Component.ObjectTrackingThis is the API for Lens Studio 4. For the latest API documentation, click here.
ObjectTracking3D
Component used for tracking objects in 3D space.
Component.ObjectTracking3DObjectTracking3D.TrackingModeThis is the API for Lens Studio 4. For the latest API documentation, click here.
PinToMeshComponent
Attaches the SceneObject to the mesh surface of a different SceneObject. See the Pin To Mesh guide for more information.
Component.PinToMeshComponentPinToMeshComponent.OrientationThis is the API for Lens Studio 4. For the latest API documentation, click here.
PostEffectVisual
Uses an input color lookup table image to adjust the coloring of the Lens. See the Color Correction Post Effect guide for more information.
Component.PostEffectVisualDepthSetterThis is the API for Lens Studio 4. For the latest API documentation, click here.
RectangleSetter
Applies ScreenTransform positioning to match the cropped region of a texture. For more information, see the Crop Textures guide.
Component.RectangleSetterThis is the API for Lens Studio 4. For the latest API documentation, click here.
RenderMeshVisual
Renders a RenderMesh asset in the scene. Comparable to the former class "MeshVisual", which was split into the classes: BaseMeshVisual, MaterialMeshVisual, and RenderMeshVisual.
Component.RenderMeshVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
RetouchVisual
Visual effect used to add subtle retouching effects to detected faces (soft skin, teeth whitening, etc.). To learn more, visit the Retouch Guide.
Component.RetouchVisualThis is the API for Lens Studio 4. For the latest API documentation, click here.
ScreenRegionComponent
Overrides the settings on a local ScreenTransform to fit a screen region on the device. See the Screen Transform guide for more information.
Component.ScreenRegionComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
ScreenTransform
Used for positioning objects in 2d screen space. It overrides the regular Transform component on the SceneObject it's attached to.
See the Screen Transform guide for more information.
Component.ScreenTransformThis is the API for Lens Studio 4. For the latest API documentation, click here.
ScriptComponent
Binds scripts to Events and executes them when triggered. Any script can access the ScriptComponent executing them through the variable script.
See also: Scripting Overview, Script Events Guide.
Component.ScriptComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
Skin
Represents skinning data for rigged meshes. See also: MeshVisual.
Component.SkinThis is the API for Lens Studio 4. For the latest API documentation, click here.
SplineComponent
Component.SplineComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
SpriteAligner
Represents transform data for screen-aligned 2D sprites. Use on SceneObjects with a SpriteVisual Component. See also: SpriteVisual.
Component.SpriteAlignerThis is the API for Lens Studio 4. For the latest API documentation, click here.
[DEPRECATED] SpriteVisual
This class has been deprecated and replaced with the Image component.
Represents a renderable 2D visual in Lens Studio.
Component.SpriteVisualLabelThis is the API for Lens Studio 4. For the latest API documentation, click here.
Text
Visual component that renders dynamic text. See the Text guide for more information.
Component.TextThis is the API for Lens Studio 4. For the latest API documentation, click here.
Text3D
Renders a given text with a 3D mesh.
Component.Text3DThis is the API for Lens Studio 4. For the latest API documentation, click here.
TrackedPointComponent
Allows you to bind the position and rotation of an object with this component to a TrackedPoint.
Component.TrackedPointComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
VFXComponent
A VFX visual used to show a VFX Asset.
Component.VFXComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.
VertexCache
Used to help control vertex animations on the SceneObject.
Component.VertexCacheThis is the API for Lens Studio 4. For the latest API documentation, click here.
Visual
Base class for all visual Components (e.g. MeshVisual).
Component.VisualBaseMeshVisual, ClearScreenThis is the API for Lens Studio 4. For the latest API documentation, click here.
WorldComponent
Groups physics objects in its subtree into an independent world simulation.
Physics.WorldComponentThis is the API for Lens Studio 4. For the latest API documentation, click here.