AnyPortrait > Manual > Execution order problem with assets

Execution order problem with assets


1.0.0

When using AnyPortrait with other assets to create games, etc., there may be a problem that is not fully compatible.
Because assets have unique characteristics, not all assets and AnyPortrait are compatible with each other.
However, because our team develops with compatibility in mind for assets that use Unity's basic functions,
compatibility issues maybe resolved with appropriate solutions for some situations.
This page describes how to troubleshoot problems with "Script Execution Order".
This page describes an asset named Cinemachine provided by Unity as an example.




It is the screen that Cinemachine is connected to the demonstration of AnyPortrait.
You can control the camera with Cinemachine.




When you run the game, the eyes of the character created by AnyPortrait are rendered strangely.
It is that AnyPortrait's Clipping Mask function is not working properly.
AnyPortrait calculates how to render according to the camera's position, orientation, and setting.
This includes Clipping Masks, Billboards, and Perspective calculation.
However, there is a conflict between the logic that controls the camera with Cinemachine and the camera computation logic of AnyPortrait, so it does not render properly.
If similar logic conflicts with each other, the problem can usually be resolved by making the script in AnyPortrait run later.




Execute Script Execution Order in Edit > Project Settings in Unity's menu.
Depending on the version of Unity Editor, it may be different from the above screen.
However, if you run Project Settings, Script Execution Order menu will be same.




If another asset has been installed, there may be additional execution orders for that asset in addition to Default Time in the Script Execution Order screen.
You can see in the above screen that Cinemachine's script is set to run later than Default Time.
AnyPortrait needs to run scripts later than Cinemachine.
(1) Press the + button.




Select AnyPortrait.apPortrait.




Makes AnyPortrait run later than other assets.
(1) Enter an execution order that is larger than the other assets.
(2) Click the Apply button.




When you run the game, the problem is resolved and it will render normally.