I have been trying to get an AC menu using a Unity UI prefab to work as a video player, but although the text and button elements work, I can't seem to manage to get the menu to display the video element.
I tried using the Unity canvas I created in a stand-alone project and it works fine, but not when I link it to the AC menu.
In the canvas, I tried using both a Plane 3D object (without linking it to an AC menu element) and a Raw Image (tried having it without a link and with a link to a graphic element in the AC menu), but nothing works. The video does load (test before for video prepared using Playmaker) and does play (as I can hear the sound, as the Video Player component on the Plane/Raw Image is linked to a Sound Source component).
The canvas renders in Screen Space - Camera mode (as do the other canvases I created and linked to AC menus). For the game objects which carry the video player component, the settings are:
1) with Raw Image
Texture: Video renderer (Render Texture)
Material: Video renderer (Matierial)
2) with Plane
Materials, Element 0: Video renderer (Matierial)
Any insights into why this may not work?
Comments
The difference may be that a AC-connected UI prefab is spawned in at runtime, and enabled/disabled as and when needed. You could try change the "Source" to Unity Ui In Scene, and having a local copy of the UI canvas in the scene.
Could perhaps be interesting as a future feature to allow the video player component to act as an element of an AC menu.
Thanks.
In my Canvas's hierarchy, I have a VideoPlayer component that renders to a Render Texture, and that Render Texture is used by a Raw Image on a separate object. I then made my Canvas a prefab, and hooked it up to the Menu Manager as normal.
Try removing Playmaker from things for the moment, and just have the VideoPlayer play on awake.
If I have this play outside of an AC menu in my game and it works, so there must be something I'm missing or a problem somewhere. Let me know if you can spot the issue.
I will send you a link to the test project as a message.
Following your instructions does make it work. Thanks again.