I try to implement video fade in on a video playing on a 3D surface. So I am setting the video player to Render Mode “Override Material” and the video plays just fine. Next I need to make it fade in, not just appear, so I thought - “easy, I will just override the target material’s alpha”, and tried to do that via the target renderer:
videoPlayer.targetMaterialRenderer: “Renderer which is targeted when Video.VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride”, so exactly the case I have, and then:
Color col = videoPlayer.targetMaterialRenderer.material.color;
videoPlayer.targetMaterialRenderer.material.color = new Color(col.r, col.g, col.b, currentAlpha);
However, for my surprise targetMaterialRenderer is null.
I am not sure what I am missing, or is there another approach to this.
Any help or thoughts on this are much appreciated.
Thank you, I missed that part somehow.
Changing the color of the MeshRenderer has no impact on the video transparency though - the video is shown and playing even with transparency set to zero. I mean is visible as if the alpha is completely disregarded, which is not the case on another object - Cube or so…