Search Unity

Question video Splash Screen.

Discussion in 'Audio & Video' started by WirealTalha, Jul 17, 2020.

  1. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    hi, I need to understand the splash screen animation.

    im creating an animation for splash screen on after-effects. The animation is of 7 seconds.

    what to do now? This portion is new for me(the video playing one).
    I guess creating a spritesheet for that animation is a no-go, cuz it will be too heavy handed.

    kindly guide me in the right direction.
     
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi!

    You need to render out your animation into a mp4 file, using the H.264 video codec (probably the default in After Effects). There are a lot of resources that can guide you through the After Effects part of it: here's one that looks pretty complete to me: https://www.schoolofmotion.com/blog/mp4-after-effects

    Then you can drag-and-drop this mp4 file into Unity's Assets and it will create a VideoClip asset. This is what you'll be able to use with the Unity VideoPlayer. The VideoPlayer can play the movie content into various destinations such as in the camera near or far planes, or it can update textures (either a RenderTexture, or the texture input of a shader used on a Material).

    The easiest to get you going is just to drag-and-drop the VideoClip from the Assets folder directly onto the Main Camera of an empty scene. When playing the scene, you will have your movie playing in full screen.

    A common scenario for playing movies in the context of your game UI is to play it into the texture of a RawImage. To do this however you need to do a bit of scripting, where you'll pass the VideoPlayer's output texture into the RawImage's input texture before starting the playback, like so:

    Code (CSharp):
    1. myVideoPlayer.renderMode = VideoRenderMode.APIOnly;
    2. myRawImage.texture = myVideoPlayer.texture;
    3. myVideoPlayer.Play();
    Hope this helps!

    Dominique Leroux
    A/V developer at Unity
     
    WirealTalha likes this.
  3. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Thanks alot mate. Ill check this out.