Search Unity

Video Is there some way to have a background video in a main menu?

Discussion in 'Audio & Video' started by Rventima, Oct 24, 2021.

  1. Rventima

    Rventima

    Joined:
    Oct 16, 2021
    Posts:
    8
    Hello.
    I'm making a little game and for the main menu I rendered the title in Blender. I don't know how to show it in the scene, I looked in youtube and forums how, but I only found how to make the main menu building the scene in Unity. I don't want to do that in this way because personally I have more control in Blender.
    Also, I got show the video with a Raw Image but at time of running the game in Unity it shows the Raw Image and then the videio in it, in other ocasions the video don't play.
     
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    If I understand correctly, you created a video in Blender, and you would like to play the video as RawImage in the UI? If you want to do that:

    1. Create a RenderTexture the size of your video
    2. Add a VideoPlayer and changes the renderer mode to RenderTexture
    3. Set the RenderTexture in the VideoPlayer
    4. Set the RenderTexture in the RawImage as the texture
    If the VideoPlayer has PlayOnAwake on, you should see your video in the UI.
     
    jcqu and BrotherEmmet like this.