How to include UI in shooting with STYLY

The UI is not included in photos when using the regular STYLY capture function.

This article explains how to include the UI in photos in STYLY.

Capture with UI

Capture with UI

This time, we will use PlayMaker.

First, make sure to add the STYLY Plugin and PlayMaker to your Unity project.

Start by adding UI elements like buttons and text to the scene.

This time, we added a button.

When you add a button, a Canvas is automatically added. In the Inspector, change the Canvas’s RenderMode to ScreenSpace – Camera.

RenderMode→ScreenSpace - Camera

RenderMode→ScreenSpace – Camera

Click Add Component and add PlayMakerFSM.

Add Component→PlayMakerFSM

Add Component→PlayMakerFSM

Click Edit on the added PlayMakerFSM to move to the PlayMaker editing screen.

Move to PlayMaker editing screen

Move to PlayMaker editing screen

In State1, name a New Variable [Main Camera], set the Variable Type to [Game Object], and click Add to add it.

[Main Camera]→[Game Object]

[Main Camera]→[Game Object]

Next, name another variable [MainCameraComponent], set the Variable Type to [Object], and click Add to add it.

[MainCameraComponent]→[Object]

[MainCameraComponent]→[Object]

Change the Object Type of the added MainCameraComponent to UnityEngine→Camera.

Object Type→UnityEngine→Camera

Object Type→UnityEngine→Camera

Move to the State, click [Action Browser], search for [Get Main Camera], and add it.

[Get Main Camera]

[Get Main Camera]

Add [Get Component], [Set Property] ×2 in the same way.

[Get Component], [Set Property]

[Get Component], [Set Property]

Specify the previously created [Main Camera] for the StoreGameObject of [Get Main Camera].

[Get Main Camera]StoreGameObject→[Main Camera]

[Get Main Camera]StoreGameObject→[Main Camera]

Set GameObject of [Get Component] to SpecifyGameObject, click the double-line icon, and specify [Main Camera].

Specify [MainCameraComponent] for StoreComponent.

StoreComponent→[MainCameraComponent]

StoreComponent→[MainCameraComponent]

Set the first [Set Property].

Drag and drop the Canvas from the Canvas Inspector into the TargetObject section.

Drag and drop Canvas

Drag and drop Canvas

Set the Property to worldCamera→Camera.

worldCamera→Camera

worldCamera→Camera

Specify [MainCameraComponent] for SetValue.

SetValue=[MainCameraComponent]

SetValue=[MainCameraComponent]

Similarly, for the second [Set Property], drag and drop the Canvas from the Canvas Inspector, and set the Property to planeDistance.

Set SetValue to 1.

planeDistance planeDistance[/caption>

However, this will not work unless you adjust the order of the States correctly.

The order of States affects the processing sequence, so be careful.

Drag the States to rearrange them in the order shown in the image below.

Reorder States Reorder States

This completes the setup to include UI in STYLY captures.

Upload to STYLY

Let’s upload it to STYLY for use.
This system works with both Scene and Prefab uploads. However, when uploading as a Prefab, set the Canvas Layer to Default.

Set Canvas Layer to Default Set Canvas Layer to Default

Create a STYLY account

How to create an account