How to get map of material on object that is playing back a video?

This code used to work in older versions of Needle for Unity, I had a videoplayer on a mesh set to material override, in a script on the gameobject I used this code to grab the .map of the material on the object and assign it to the alpha slot of the material but is now null in newer Needle versions and the video still plays on the gameobject, Iā€™ve tried looking at the slots on this.mainMaterial but there is nothing there to grab as a map anymore, does the video texture get assigned somewhere else now?

  awake() {
    this.meshTarget = this.gameObject as unknown as Mesh;
    this.mainMaterial = this.meshTarget.material as MeshStandardMaterial;
    this.mainMaterial.alphaMap =; = null;

Original Post on Discord

by user 103054507105067008

Awake is most likely too early - the videoplayer only also just starts initialization in awake. Try moving this into start instead. I think the videoTexture is also exposed on the VideoPlayer - but i have to check later. The VideoPlayer still does all these things, it didnt change

That fixed it thanks!

by user 103054507105067008