Hello everyone;
I am continuing my previous question( 1 ). Now its working as per this demo.
and the coding written to set cutoff is here :
function Update () {
renderer.material.SetFloat("_Cutoff", Mathf.InverseLerp(0, Screen.width, Input.mousePosition.x));
}
But i want to set cutoff value , depending up on distance between two object.
one object position will be static. and i am moving another object and if my object gets far distance then cutoff should be 0. and if the object gets closer then depending up on the distance between these two object , i want to set cutoff value.
so how do i set cutoff value?
Please help me guys?
Thanks in advance for your support and help in advance.
My objects are in 2d scene. so depending up on x-y axis value i want to set cutoff.
– Ekta-Mehta-D