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.
Component.Animation
[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.
Component.AnimationMixer
AnimationPlayer
Component that handles playing animation clips as well as binding callbacks to user defined events.
Component.AnimationPlayer
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.AudioComponent
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.AudioEffectComponent
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.AudioListenerComponent
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.BaseMeshVisual
FaceStretchVisual
, HairVisual
, LiquifyVisual
, MaskingComponent
, MaterialMeshVisual
, Text
, VFXComponent
[DEPRECATED] BlendShapes
Controls blend shapes connected to imported animation content.
Note: this class has been deprecated. Please use the blend shapes functions in RenderMeshVisual.
Component.BlendShapes
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.BlurNoiseEstimation
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.BodyComponent
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.Camera
Camera.BaseRenderTarget
, Camera.ColorRenderTarget
, Camera.CubemapFace
, Camera.DepthBufferMode
, Camera.DepthStencilRenderTarget
, Camera.DeviceProperty
, Camera.Type
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.Canvas
Canvas.SortingType
, Canvas.UnitType
ClearScreen
Clears depth in the drawing order.
Component.ClearScreen
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.ClothVisual
ClothVisual.BendMode
ColliderComponent
Collider used by the Hair Visual for its simulation.
Physics.ColliderComponent
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.
Component.ColocatedTrackingComponent
Component
The base class for all components. Components are attached to SceneObjects.
Component
Animation
, AnimationMixer
, AnimationPlayer
, 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
, WorldComponent
ConstraintComponent
Used to apply a constraint to an object.
Physics.ConstraintComponent
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.DepthSetter
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.DeviceLocationTrackingComponent
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.DeviceTracking
EyeColorVisual
Applies an eye color effect to a face.
Component.EyeColorVisual
FaceInsetVisual
Draws a section of a tracked face.
Component.FaceInsetVisual
FaceMaskVisual
Applies a face mask effect. See the Face Mask Guide for more information.
Component.FaceMaskVisual
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.FaceStretchVisual
GaussianSplattingVisual
Renders Gaussian Splats.
Component.GaussianSplattingVisual
[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.Gyroscope
HairVisual
Component that renders hair simulation.
Component.HairVisual
Head
Binds the SceneObject to a tracked face. See the Head Attached 3D Objects Guide for more information.
Component.Head
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.HintsComponent
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.Image
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.InteractionComponent
[DEPRECATED] Label
Displays text in the scene. This is now deprecated in favor of Text. See the Text guide for more information.
Component.Label
LightSource
Acts as a source of light in the scene. See the Light and Shadows guide for more information about lighting.
Component.LightSource
LiquifyVisual
Applies a liquify effect to anything rendered behind it.
Component.LiquifyVisual
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.LocatedAtComponent
LookAtComponent
Every frame, LookAtComponent rotates its SceneObject to face towards a target SceneObject.
Component.LookAtComponent
LookAtComponent.AimVectors
, LookAtComponent.LookAtMode
, LookAtComponent.WorldUpVector
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.MLComponent
ManipulateComponent
Handles input information from user touch input via the TouchComponent to control Scale, Rotation, and Translation of objects.
Component.ManipulateComponent
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.MarkerTrackingComponent
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.MaskingComponent
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.MaterialMeshVisual
ClothVisual
, EyeColorVisual
, FaceInsetVisual
, FaceMaskVisual
, GaussianSplattingVisual
, Image
, PostEffectVisual
, RenderMeshVisual
, RetouchVisual
, SpriteVisual
, Text3D
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.MeshVisual
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.ObjectTracking
ObjectTracking3D
Component used for tracking objects in 3D space.
Component.ObjectTracking3D
ObjectTracking3D.TrackingMode
PinToMeshComponent
Attaches the SceneObject to the mesh surface of a different SceneObject. See the Pin To Mesh guide for more information.
Component.PinToMeshComponent
PinToMeshComponent.Orientation
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.PostEffectVisual
DepthSetter
RectangleSetter
Applies ScreenTransform positioning to match the cropped region of a texture. For more information, see the Crop Textures guide.
Component.RectangleSetter
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.RenderMeshVisual
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.RetouchVisual
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.ScreenRegionComponent
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.ScreenTransform
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.ScriptComponent
Skin
Represents skinning data for rigged meshes. See also: MeshVisual.
Component.Skin
SpriteAligner
Represents transform data for screen-aligned 2D sprites. Use on SceneObjects with a SpriteVisual Component. See also: SpriteVisual.
Component.SpriteAligner
[DEPRECATED] SpriteVisual
This class has been deprecated and replaced with the Image component.
Represents a renderable 2D visual in Lens Studio.
Component.SpriteVisual
Label
Text
Visual component that renders dynamic text. See the Text guide for more information.
Component.Text
Text3D
Renders a given text with a 3D mesh.
Component.Text3D
TrackedPointComponent
Allows you to bind the position and rotation of an object with this component to a TrackedPoint.
Component.TrackedPointComponent
VFXComponent
A VFX visual used to show a VFX Asset.
Component.VFXComponent
VertexCache
Used to help control vertex animations on the SceneObject.
Component.VertexCache
Visual
Base class for all visual Components (e.g. MeshVisual).
Component.Visual
BaseMeshVisual
, ClearScreen