I’ve made a texture with a gradient in After Effects, imported it into Unity and applied it on a plane as a Transparent/Cutout/Diffuse texture which allows me to move the Alpha Cutoff handle in the inspector and that makes my texture “grow” or appear from left to right, for example. It’s a glowing light rod that I want to grow on mouse click, when I click another object for a little mini game.
My question is how can I, via scripting, make the alpha cutoff change by clicking another object in game?
The game is simply this: When you click a square plane it rotates and allows a “stream” to pass through and connect to another square. its a simple puzzle game. If anyone knows of a better way to achieve the growing effect I’m all ears. Thanks!
It works, but its not a smooth transition and the more frames i put in the slower the grow effect. Ill try your link and play around with the settings. Thanks again!
I used the Link you gave me @mgear and replaced the “_Shininess” with “_Cutoff” since that is what the alpha cutoff is called but it doesn’t change the alpha. When I press play it still makes shininess handle appear in the inspector.
Yes it works when I do it manually with the default shader Transparent/Cutout/Diffuse. I only need to activate it from a script and to be able to define its parameters. When I do it manually its just a matter of scrolling the handle from left to right in the inspector.