Skip to main content

Components

Components are attached to SceneObjects and define object behavior. See also: Inspector Panel

[DEPRECATED] 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.

Lens Studio v1.0.0+
Scripting Name: Component.Animation
Inherits from Component

[DEPRECATED] 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.

Lens Studio v1.0.0+
Scripting Name: Component.AnimationMixer
Inherits from Component

AnimationPlayer

Component that handles playing animation clips as well as binding callbacks to user defined events.

Lens Studio v5.0.10+
Scripting Name: Component.AnimationPlayer
Inherits from Component

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.

Lens Studio v1.0.0+
Scripting Name: Component.AudioComponent
Inherits from Component

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.

Lens Studio v1.7.0+
Scripting Name: Component.AudioEffectComponent
Inherits from Component

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.

Lens Studio v4.0+
Scripting Name: Component.AudioListenerComponent
Inherits from Component

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.

Lens Studio v2.3+
Scripting Name: Component.BaseMeshVisual
Inherits from Visual

[DEPRECATED] BlendShapes

Controls blend shapes connected to imported animation content.

Note: this class has been deprecated. Please use the blend shapes functions in RenderMeshVisual.

Lens Studio v1.0.0+
Scripting Name: Component.BlendShapes
Inherits from Component

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.

Lens Studio v4.22.0+
Scripting Name: Component.BlurNoiseEstimation
Inherits from Component

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.

Lens Studio v4.10.0+
Scripting Name: Physics.BodyComponent
Inherits from ColliderComponent

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.

Lens Studio v1.0.0+
Scripting Name: Component.Camera
Inherits from Component

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.

Lens Studio v4.31.0+
Scripting Name: Component.Canvas
Inherits from Component

ClearScreen

Clears depth in the drawing order.

Lens Studio v1.0.0+
Scripting Name: Component.ClearScreen
Inherits from Visual

ClothVisual

Handles the mesh data of cloth and prepares it for cloth simulation. Also controls all the parameters of the cloth simulator and colliders.

Lens Studio v4.0+
Scripting Name: Component.ClothVisual
Inherits from MaterialMeshVisual
Inner Classes: ClothVisual.BendMode

ColliderComponent

Collider used by the Hair Visual for its simulation.

Lens Studio v4.1+
Scripting Name: Physics.ColliderComponent
Inherits from Component
Child Classes: BodyComponent

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.

Lens Studio v4.0+
Scripting Name: Component.ColocatedTrackingComponent
Inherits from Component

ConstraintComponent

Used to apply a constraint to an object.

Lens Studio v4.10.0+
Scripting Name: Physics.ConstraintComponent
Inherits from Component

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.

Lens Studio v2.2+
Scripting Name: Component.DepthSetter
Inherits from PostEffectVisual

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.

Lens Studio v2.0.0+
Scripting Name: Component.DeviceLocationTrackingComponent
Inherits from Component

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.

Lens Studio v1.0.0+
Scripting Name: Component.DeviceTracking
Inherits from Component

EyeColorVisual

Applies an eye color effect to a face.

Lens Studio v1.5.0+
Scripting Name: Component.EyeColorVisual
Inherits from MaterialMeshVisual

FaceInsetVisual

Draws a section of a tracked face.

Lens Studio v1.5.0+
Scripting Name: Component.FaceInsetVisual
Inherits from MaterialMeshVisual

FaceMaskVisual

Applies a face mask effect. See the Face Mask Guide for more information.

Lens Studio v1.5.0+
Scripting Name: Component.FaceMaskVisual
Inherits from MaterialMeshVisual

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.

Lens Studio v1.5.0+
Scripting Name: Component.FaceStretchVisual
Inherits from BaseMeshVisual

GaussianSplattingVisual

Renders Gaussian Splats.

Lens Studio v5.0.14+
Scripting Name: Component.GaussianSplattingVisual
Inherits from MaterialMeshVisual

[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.

Lens Studio v1.0.0+
Scripting Name: Component.Gyroscope
Inherits from Component

HairVisual

Component that renders hair simulation.

Lens Studio v3.4+
Scripting Name: Component.HairVisual
Inherits from BaseMeshVisual

Binds the SceneObject to a tracked face. See the Head Attached 3D Objects Guide for more information.

Lens Studio v1.5.0+
Scripting Name: Component.Head
Inherits from Component

HintsComponent

Used to show and hide hints to the user. For more information and useful helper scripts, see the Scripting Hints Guide.

Hint IDHint 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”
Lens Studio v1.5.0+
Scripting Name: Component.HintsComponent
Inherits from Component

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.

Lens Studio v2.0.0+
Scripting Name: Component.Image
Inherits from MaterialMeshVisual

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"

Lens Studio v4.0+
Scripting Name: Component.InteractionComponent
Inherits from Component

[DEPRECATED] Label

Displays text in the scene. This is now deprecated in favor of Text. See the Text guide for more information.

Lens Studio v1.7.0+
Scripting Name: Component.Label
Inherits from SpriteVisual

LightSource

Acts as a source of light in the scene. See the Light and Shadows guide for more information about lighting.

Lens Studio v1.0.0+
Scripting Name: Component.LightSource
Inherits from Component

LiquifyVisual

Applies a liquify effect to anything rendered behind it.

Lens Studio v1.0.0+
Scripting Name: Component.LiquifyVisual
Inherits from BaseMeshVisual

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.

Lens Studio v4.19.0+
Scripting Name: Component.LocatedAtComponent
Inherits from Component

LookAtComponent

Every frame, LookAtComponent rotates its SceneObject to face towards a target SceneObject.

Lens Studio v1.0.0+
Scripting Name: Component.LookAtComponent
Inherits from Component

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.

Lens Studio v3.0+
Scripting Name: Component.MLComponent
Inherits from Component

ManipulateComponent

Handles input information from user touch input via the TouchComponent to control Scale, Rotation, and Translation of objects.

Lens Studio v1.0.0+
Scripting Name: Component.ManipulateComponent
Inherits from Component

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.

Lens Studio v1.7.0+
Scripting Name: Component.MarkerTrackingComponent
Inherits from Component

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.

Lens Studio v4.49.0+
Scripting Name: Component.MaskingComponent
Inherits from BaseMeshVisual

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.

Lens Studio v2.3+
Scripting Name: Component.MaterialMeshVisual
Inherits from BaseMeshVisual

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

Lens Studio v1.0.0+
Scripting Name: Component.MeshVisual
Inherits from Component

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.

Lens Studio v2.0.0+
Scripting Name: Component.ObjectTracking
Inherits from Component

ObjectTracking3D

Component used for tracking objects in 3D space.

Lens Studio v3.4+
Scripting Name: Component.ObjectTracking3D
Inherits from Component

PinToMeshComponent

Attaches the SceneObject to the mesh surface of a different SceneObject. See the Pin To Mesh guide for more information.

Lens Studio v1.7.0+
Scripting Name: Component.PinToMeshComponent
Inherits from Component

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.

Lens Studio v1.0.0+
Scripting Name: Component.PostEffectVisual
Inherits from MaterialMeshVisual
Child Classes: DepthSetter

RectangleSetter

Applies ScreenTransform positioning to match the cropped region of a texture. For more information, see the Crop Textures guide.

Lens Studio v3.0+
Scripting Name: Component.RectangleSetter
Inherits from Component

RenderMeshVisual

Renders a RenderMesh asset in the scene. Comparable to the former class "MeshVisual", which was split into the classes: BaseMeshVisual, MaterialMeshVisual, and RenderMeshVisual.

Lens Studio v2.3+
Scripting Name: Component.RenderMeshVisual
Inherits from MaterialMeshVisual

RetouchVisual

Visual effect used to add subtle retouching effects to detected faces (soft skin, teeth whitening, etc.). To learn more, visit the Retouch Guide.

Lens Studio v1.5.0+
Scripting Name: Component.RetouchVisual
Inherits from MaterialMeshVisual

ScreenRegionComponent

Overrides the settings on a local ScreenTransform to fit a screen region on the device. See the Screen Transform guide for more information.

Lens Studio v2.0.0+
Scripting Name: Component.ScreenRegionComponent
Inherits from Component

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.

Lens Studio v2.0.0+
Scripting Name: Component.ScreenTransform
Inherits from Component

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.

Lens Studio v1.0.0+
Scripting Name: Component.ScriptComponent
Inherits from Component

Skin

Represents skinning data for rigged meshes. See also: MeshVisual.

Lens Studio v1.0.0+
Scripting Name: Component.Skin
Inherits from Component

SplineComponent

Lens Studio v3.4+
Scripting Name: Component.SplineComponent
Inherits from Component

SpriteAligner

Represents transform data for screen-aligned 2D sprites. Use on SceneObjects with a SpriteVisual Component. See also: SpriteVisual.

Lens Studio v1.0.0+
Scripting Name: Component.SpriteAligner
Inherits from Component

[DEPRECATED] SpriteVisual

This class has been deprecated and replaced with the Image component.

Represents a renderable 2D visual in Lens Studio.

Lens Studio v1.0.0+
Scripting Name: Component.SpriteVisual
Inherits from MaterialMeshVisual
Child Classes: Label

Text

Visual component that renders dynamic text. See the Text guide for more information.

Lens Studio v2.0.0+
Scripting Name: Component.Text
Inherits from BaseMeshVisual

Text3D

Renders a given text with a 3D mesh.

Lens Studio v4.7+
Scripting Name: Component.Text3D
Inherits from MaterialMeshVisual

TrackedPointComponent

Allows you to bind the position and rotation of an object with this component to a TrackedPoint.

Lens Studio v3.4+
Scripting Name: Component.TrackedPointComponent
Inherits from Component

VFXComponent

A VFX visual used to show a VFX Asset.

Lens Studio v4.0+
Scripting Name: Component.VFXComponent
Inherits from BaseMeshVisual

VertexCache

Used to help control vertex animations on the SceneObject.

Lens Studio v1.6.0+
Scripting Name: Component.VertexCache
Inherits from Component

Visual

Base class for all visual Components (e.g. MeshVisual).

Lens Studio v1.0.0+
Scripting Name: Component.Visual
Inherits from Component
Child Classes: BaseMeshVisual, ClearScreen

WorldComponent

Groups physics objects in its subtree into an independent world simulation.

Lens Studio v4.10.0+
Scripting Name: Physics.WorldComponent
Inherits from Component
Was this page helpful?
Yes
No

AI-Powered Search