Adding video player and render texture

To render videos in Unity we can use a MovieTexture in conjunction with the VideoPlayer component.

  1. In the Assets/HowToChangeATire/Textures/ folder, create a Render Texture.
  2. Name it Video Render Texture; we can leave its default settings.

Now for the video player:

  1. In Hierarchy, create Video | Video Player.
  2. Check Loop and uncheck Play On Awake.
  3. Select Aspect Ratio: Fit Vertically.

And link to the texture:

  1. Drag the VideoRenderTexture onto the Target Texture slot.
  2. In Hierarchy, select the Video Graphic UI object.
  3. Drag the VideoRenderTexture onto its Raw ImageTexture slot.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset