Skip to main content

Sample Scene

This page will show how to use an example scene to test if the Genies SDK is working.

info

This page will be using version 1.0.0 of the Genies SDK Avatar package, but replace it with the latest package version.

Import the Sample Scene

From the top menu, select Windows > Package Manager window. Then select Packages: In Project on the top left dropdown and also select the Genies SDK Avatar package on the left side menu.

Click the Samples tab and click the Import button next to the SDK Functions sample.

Download Sample

Open the Example Scene

In your Project window, open the Assets > Samples > Genies SDK Avatar > 1.0.0 > SdkFunctions > Scenes folder. Double click the SdkFunctions scene to open it.

Example Scene

Test the Example Scene

The next steps will show to test the example scene functionality.

Start the OTP Login

The first step will be to login to your Genies account. Press the Play button.

In the Hierarchy window, select the Editor_RuntimeSdkFunctions object. Then in the Inspector window, click the (Re)Start Email OTP Login button.

Play Scene

Submit Email

A new component should appear. Enter your email in the input field. Then press the Submit Email button.

Submit Phone

Submit the OTP Code

The component should update and you should receive an email. Add the OTP code into the input field and click the Submit Email Code button.

Submit OTP

tip

Click the Resend Email Code button if you did not receive an email.

Confirm the Login

A new component should appear and display your Genies login name if the login was succesful.

Confirm Login

Spawn the User Avatar

Click the Spawn User Avatar button.

Spawn User

Confirm the User Avatar Spawned

You should now see the user Avatar spawn in the Scene window.

User Avatar

Open the Avatar Editor

Click the Open Avatar Editor button.

Open Editor

Test the Avatar Editor

The Avatar Editor should appear . Try changing your Avatar's looks.

Avatar Editor

Close the Avatar Editor

Click the Close Avatar Editor button.

Close Editor

Spawn the Default Avatar

Click the Spawn Default Avatar button.

Spawn Default

Confirm the Default Avatar Spawned

You should now see the default Avatar spawn in the Scene window. You may have to move one of the Avatar objects to see both of them.

Default Avatar

note

Your user Avatar may look identical to the default Avatar if you have never edited your Avatar before.

Destroy All the Avatars

Click the Destroy All Spawned Avatars button. The Avatars should be deleted from the scene.

Destroy Avatars

Test the Instant Login

Exit Play mode. Activate the Instant Login On Start button. Press the Play button. It should login instantly using your cached credentials.

Instant Login

Example Scripts

All of the logic for this example scene can be found in the Assets > Samples > Genies SDK Avatar > 1.0.0 > SdkFunctions > Scripts folder. It's recommended to look through these scripts to understand how it works.

Example Scripts

Second Sample

There is a second sample named Load avatar with controller that you should check out. It has an example scene with the user login, Avatar loading, and a simple character controller.

Second Sample

Next Steps

Check out the First Project with Avatar SDK tutorial to attach a character controller to the loaded Avatar.