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.
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.
Click Add Component and add PlayMakerFSM.
Click Edit on the added PlayMakerFSM to move to the PlayMaker editing screen.
In State1, name a New Variable [Main Camera], set the Variable Type to [Game Object], and click Add to add it.
Next, name another variable [MainCameraComponent], set the Variable Type to [Object], and click Add to add it.
Change the Object Type of the added MainCameraComponent to UnityEngine→Camera.
Move to the State, click [Action Browser], search for [Get Main Camera], and add it.
Add [Get Component], [Set Property] ×2 in the same way.
Specify the previously created [Main Camera] for the StoreGameObject of [Get Main Camera].
Set GameObject of [Get Component] to SpecifyGameObject, click the double-line icon, and specify [Main Camera].
Specify [MainCameraComponent] for StoreComponent.
Set the first [Set Property].
Drag and drop the Canvas from the Canvas Inspector into the TargetObject section.
Set the Property to worldCamera→Camera.
Specify [MainCameraComponent] for SetValue.
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.
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.
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.
How to create an account