Skip to main content

Avatar Starter Scene

This page will show you a sample scene named Avatar Starter Scene. It will break down how to control an Avatar like a player.

info

This page will be using version X.Y.Z 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 Avatar SDK package on the left side menu.

Click the Samples tab and click the Import button next to the Avatar Starter Scene sample.

Download Sample

Open the Sample Scene

In your Project window, open the Assets > Samples > Genies Avatar SDK > X.Y.Z > Avatar Starter Scene > Scenes folder. Double click the AvatarStarter scene to open it.

Sample Scene

Test the Sample Scene

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

Move the Avatar

Press the Play button. Log in to your Genies account using the email OTP login UI in the Game window.

Once logged in, move and look around using WASD buttons and the mouse. You can also run and jump with the shift and space bar buttons.

Move Avatar

info

This is using a GeniesAvatarController script to spawn the Avatar and make it move with player input.

Open the Avatar Editor

Click the top button to open the Avatar Editor.

Avatar Editor

Use Touch Controls

Touch controls allows for mobile devices to use a joystick UI and buttons to move and jump the Avatar.

Enable Touch Controls

Exit Play mode. In the Hierarchy, select the AvatarSpawn object. In the Inspector, activate the Enable Touch Controls property.

Enable Touch

Test the Scene

Enter Play mode. The joystick UI, jump button, and run button should appear. Those should be the only input that works now.

Touch Controls

Conclusion

There is a prefab found in the Assets > Samples > Genies Avatar SDK > X.Y.Z > Avatar Starter Scene > Prefabs folder. This can be dropped into a separate scene to spawn the Avatar with a character controller attached.

Spawn Prefab

tip

Check out the First Project with Avatars tutorial to see how to add this prefab to a new scene.