Skip to main content
Version: 5.x
Supported on
Snapchat

4 Randomizers

This sample project demonstrates 4 different experiences with randomization logic. Objects switch for a selected amount of time and then stop at a random frame. After that, the animation can be restarted by clicking on the "Randomize" button.

Customizing the Sample Project

This sample project allows you to create a unique lens for Snapchatters by modifying assets. To get started go to the Home page in Lens Studio and find the 4 Randomizers card in the Sample Project section. Click on the project card to download the project.

As mentioned before, the project contains 4 different approaches, so you’ll need to choose only one of them. To switch between randomizers, you can turn on one of the Randomizer x [Switch ON to Enable object, and turn off the others.

Randomizer 1

To change the title of the first randomizer, find [EDIT_ME] Tagline SceneObject under the 3D_Camera [Randomizer 1]. There is a Text Component where you can edit the tagline.

There is the Random group SceneObject right after the [EDIT_ME] Tagline SceneObject and if you expand it, you find frames SceneObject (Frame 1, Frame 2, Frame 3, Frame 4). These are circle frames you see on the screen. To change texts on the first frame, select Text static SceneObject and modify its TextComponent. Frame 2 and Frame 3 have multiple text options that are switching in randomizing. You can edit them in Frame 2(3) Text SceneObjects:

Finally, Frame 4 contents an Image Component, so you need to replace randomizing textures in Third Frame Randomizer script inputs:

The number of the textures are not static, so you can remove unnecessary ones or add more if you want.

Randomizer 2

The second randomizer randomizes 3 text lines. To change text options, expand the Head SceneObject under the [Randomizer 2] in FE_Camera. There are Random 1, Random 2 and Random 3 SceneObjects. They are randomizing lines. There is the ? SceneObject under all of them. It’s a default option that presents before the randomizer starts. You can edit the label in its Text Component. Random Text SceneObjects contain randomizing text options that you edit by changing the text inside.

You’ll need to duplicate the labels in [Randomizer 2] no_head (under VFX_FG_Camera). There are the same labels but which present when the head disappears.

Randomizer 3

Randomizer 3 randomizes only textures. These textures are the same for all 3 frames. By enabling Different Results in the Randomizer Chain script you can ensure that textures won’t be repeated after randomization. If you don’t need this, disable the checkbox.

Also, the textures must be replaced in First Frame Randomizer, Second Frame Randomizer and Third Frame Randomizer scripts:

Randomizer 4

To edit the label of the fourth randomizer, find Tagline object under [Randomizer 4] in VFX_FG_Camera:

Circles can also be modified. Expand the Randomizer SceneObject that is near the Tagline. Text 1, Text 2, Text 3 and Text 4 are labels above the circles. If you want to modify them, edit their Text components. First 3 circles randomize text lines. You can customize them in Text components under BG object:

The last circle randomizes images. Edit them also under the BG object.

Randomizer Custom Components

All timings, object/Texture groups, the order of randomization you can adjust in Randomizer and Randomizer Chain scripts.

Previewing Your Lens

You’re now ready to preview your Lens experience. To preview your Lens in Snapchat, follow the Pairing to Snapchat guide.

Was this page helpful?
Yes
No