How to make ARFeatheredPlane transparent?
Hi all,
I want to make the ARFeatheredPlane invisible / transparent, but keep its Collider and other functionalities so that models can placed on that plane.
What I have tried so far is disabling the Renderer, but the planes are still rendered and it looks like their collider is not working anymore. I cannot move or place models on this plane:
arPlaneManager.GetAllPlanes(allPlanes);
foreach (ARPlane arplane in allPlanes)
{
rend = arplane.GetComponent<MeshRenderer>();
if (rend != null)
{
rend.GetComponent<Renderer>().enabled = false;
}
}
Alternatively, how could I access the alpha channels of the Shader FeatheredPlaneMaterial? Even if I just print the shader name of the ARPlane, I cannot place models on that plane anymore.
arPlaneManager.GetAllPlanes(allPlanes);
foreach (ARPlane arplane in allPlanes)
{
rend = arplane.GetComponent<MeshRenderer>();
if (rend != null)
{
debugBox.text += rend.material.shader.name;
}
}
Why are you trying to access through code ? You can access from project window, just find the material and make its alpha to zero. I use this way for 6 months and it works like charm.
Thanks for your reply. I would like to access it through code, because I need to switch the ARPlanes' visibility dynamically/ at runtime, i.e. on and off on button click.
You can use different materials instead and rather then switching material values, you can simply replace plane material.
Thank you @m3rt32 , That is the best workaround so far. After switching the materials two times, the feathered plane looses its fading contours, it has a hard cut contour. But, this is not that important.