Hey Rainy,
I want to gray out a live2D character when they're not talking (like in fire emblem https://www.youtube.com/watch?v=0uunZ14DnJE&list=PLrbkJ3FwVRbu3EgxJ-X2QZvWY6eo3H04v&ab_channel=justonegamr). I am wondering what the best method for that is?
I have taken a look, and it seems that updating the material to allow light to impact them would be the best way, as I could then just shine a gray light on the characters that are not currently talking (let me know if there is a better way).
I tried to follow the manual here: https://rainyrizzle.github.io/en/AdvancedManual/AD_MaterialLibrary.html
But I bumped into issues despite following the steps to update the material and re-bake the character, even though I think I've set things up correctly - the game view has a black silhouette while the scene view shows the character.
What step am I missing? Best Regards, Clement
Sweet! Controlling it directly seems like a much better option :) Especially since there's an easy option to restore it to default.
Love all the functionality you've got here. Apologies for all the questions, I do find it a bit hard to navigate the info pages to find the right places to look
Hi!
Using lights is a good idea, but it can be difficult to set them precisely because they affect other characters or objects depending on the range.
So when you want to change the color, the general way is to directly control the color of meshes with a script.
There are a variety of functions available to control the color of the mesh.
The simplest of these is "SetMeshColorAll".
You can darken the character by writing a script like this:
public apPortrait portrait; void Update() { if(Input.GetKeyDown(KeyCode.A)) { // Darken the character. portrait.SetMeshColorAll(new Color(0.2f, 0.2f, 0.2f, 1.0f)); } if(Input.GetKeyDown(KeyCode.S)) { // Revert to its original color. portrait.ResetMeshMaterialToBatchAll(); } }
AnyPortrait controls colors in a "2X Multiply" method, so the default value is (0.5, 0.5, 0.5, 1.0).
So if you want to make it darker, you need to enter a smaller value.
When restoring colors to their original values, the "ResetMeshMaterialToBatchAll" function is convenient.
Using this script, you can change the color of your character as shown above.
Functions that control the material of the mesh can be found in the following manual.
https://rainyrizzle.github.io/en/Script/SC_Mesh.html
If you want to create another color effect, you can write a custom shader to implement it.
https://rainyrizzle.github.io/en/Script/SC_CustomShader.html
https://rainyrizzle.github.io/en/AdvancedManual/AD_MaterialLibrary.html
If you have any further questions, please leave a comment!
Thank you.
Ahh, I'm sorry - I thought my point light range was large enough. It wasn't. After extending my point light, it is working as expected.