How do I change the model's expressions during gameplay?
I have checked the live2D Manual at "Cubism SDK > platform > Unity", and I haven't found a clear way to change a model's expressions or animations through code.
What I'm trying to do is a function I can call, for example "ShowHappyCharacter();" and "ShowSadCharacter();" that I can use to change the expressions during gameplay.
0 ·
Comments
I think change of model's expressions is a code only to SampleApp1 project of Live2D Unity SDK.
It has change of model's expressions in LAppModel.cs .
[SampleApp1/Assets/Scripts/sample/LAppModel.cs]
Good luck !Naotaro, I think I have not explained my situation properly, but I am thankful for your response. What I want to do is to have the live2d model's emotion to change during gameplay, so I think that a function that uses "Input" during the "Update()" is required, but I don't know which.
For example, when I press "A", the emotion changes to "Confident Smile", and when I press "B", it changes to "Laughing".
Finding a function that changes the expression during "Update()" depending on a variable would also solve my issue.
You can switch facial expression by changing /sample/Simple/simpleModel.cs of Live2D SDK like below:
Add L2DExpressionMotion.cs to the project because L2DExpressionMotion is used to load exp.json.
L2DExpressionMotion is in /framework folder of Live2D SDK.
I hope this will answer your question.
Thank you very much naotaro for your help and y_a_s_ for the code!