Change text in material in facemask
Hi fellow lens-people!
I am making a lens that has text as a facemask. When tapped, the text should change to the next string I have defined in an array of strings.
I have made a Label Material in the ressources panel, and added the material to the facemask object. And it works with the text I manually have written in the material text object (in ressources). But when I try to access the actual text of the material via script, I get an error.
I have tried accessing it by with:
script.overlay.mainPass.baseTex.text
where overlay is:
Component.FaceMaskVisual
I have also tried without .text at the end.
Nothing works - I cannot access the actual text in the material.
Anyone who can help?
Update:
I found the solution!
Needed to use
and then access the actual text property with
Hey Mads, glad you were able to figure this out!
FYI, you could have also created a Label component which can drive a custom Label material. In a new Label component, change the Material field from Default to your own custom Label material.