- Home /
How to paint a texture transparent ?
Hi everyone, I wanna paint a texture transparent with a eraser during runtime. This is my eraser in the Script:
function Eraser (p1 : Vector2,p2 : Vector2) {
Drawing.NumSamples=AntiAlias;
if (p2 == Vector3.zero) {
p2 = p1;
}
Drawing.PaintLine (p1,p2,eraser.width,Color.clear,eraser.hardness,baseTex);
baseTex.Apply ();
}
I tried using color.clear to make it transparent but it just made it black. How can I paint transparent with my eraser?
Thanks for reading this question
Comment
Drawing.PaintLine() is not part of Unity's core that I'm aware of. Are you using some sort of third-party package?
Im using the unitypaint package from here: http://www.arongranberg.com/unity/unitypaint/
The solution will be either in a feature of this package or making changes in the guts of the package. Only someone with specific knowledge of this package will be able to help you.